1.4.1 • Published 12 months ago

@ecmwf.int/app-template v1.4.1

Weekly downloads
26
License
ISC
Repository
-
Last release
12 months ago

ECMWF app template

Installation

npm

$ npm install "@ecmwf.int/app-template"

yarn

$ yarn add @ecmwf.int/app-template

Usage

To run it manually:

npm

 $ npx ecmwf-app-template -c ./path/to/config/file

yarn

 $ yarn ecmwf-app-template -c ./path/to/config/file

It might be a good idea to automate the process of generating the template. It could be done in various ways depending on particular requirements.

Example configuration of package.json to include generating template using npm 'pre' hooks.

{
  "scripts": {
    "generate-template": "yarn ecmwf-app-template -c template.config.json",
    
    "prestart": "yarn generate-template",
    "start": "command-to-start-app-server",
    
    "prebuild": "yarn generate-template",
    "build": "command-to-app"
  }
}

Configuration

Available configuration options:

OptionRequiredDescription
outputYesOutput directory path
titleYesDocument title
appNameYesApplication Name
layoutYesType of layout ('contained' or 'fluid')
authHostYesAuthentication endpoint host
gtmIdNoGoogle Tag Manager ID
headBlockNoBlock of content injected into the head of the page
contentBlockNoBlock of content injected into the main content of the page
helpBlockNoBlock of content injected into the logged-in user dropdown
userMenuBlockNoBlock of content injected into the help dropdown

Environment variables

Configuration file supports environment variables by using %VARIABLE_NAME% syntax.

Configuration file example

{
  "title": "ECMWF | Title",
  "appName": "Application Name",
  "output": "./public",
  "layout": "fluid",
  "headBlock": "./template/head.html",
  "contentBlock": "./template/content.html",
  "helpBlock": "./template/help.html",
  "userMenu": "./template/userMenu.html",
  "authHost": "%ECMWF_APP_TEMPLATE_AUTH_HOST%"
}

Development

There are two aspects of the package.

Template development

Building a template:

$ yarn build-template

Starting a development server:

$ yarn start

CLI tool and a binary to generate the template

Building a cli tool:

$ yarn build-cli

Publishing

npm

Bump a version:

$ npm version major|minor|patch

Publish:

$ npm publish

yarn

$ yarn publish
1.4.1

12 months ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

4 years ago

1.3.0-alpha.3

4 years ago

1.3.0-alpha.2

4 years ago

1.3.0-alpha.1

4 years ago

1.2.0

4 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago