Skip to content

Commit

Permalink
chore: update node engine to >= 10 (#346)
Browse files Browse the repository at this point in the history
* chore: update node engine to >= 10

* Migrate to GH Actions from Travis
* Reformat accoring to code style

BREAKING CHANGE: Require Node version 10 or above.

* ci(actions): give checkout action our custom pat
  • Loading branch information
varl committed Apr 2, 2020
1 parent e53c4c1 commit d29c11e
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 41 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/node-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'dhis2: lint (node)'

on: push

jobs:
check:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install
run: yarn install --frozen-lockfile

- name: Run linters
run: |
yarn d2-style js check
yarn d2-style text check
env:
CI: true
49 changes: 49 additions & 0 deletions .github/workflows/node-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'dhis2: publish (node)'

on:
push:
branches:
# match branches in:
# https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches
- master
- next
- next-major
- alpha
- beta
- '[0-9]+.x'
- '[0-9]+.x.x'
- '[0-9]+.[0-9]+.x'

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: '[email protected]'
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GH_TOKEN: ${{secrets.GH_TOKEN}}

jobs:
publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Lint
run: yarn lint

- name: Publish to NPM
run: npx @dhis2/cli-utils release --publish npm
env:
CI: true
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

12 changes: 5 additions & 7 deletions cli/config/app.babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ module.exports = {
production: {
plugins: [
[require('styled-jsx/babel'), { optimizeForSpeed: true }],
]
],
},
development: {
plugins: [
[require('styled-jsx/babel'), { optimizeForSpeed: true }],
]
],
},
test: {
plugins: [
require('styled-jsx/babel-test')
]
}
}
plugins: [require('styled-jsx/babel-test')],
},
},
}
4 changes: 3 additions & 1 deletion cli/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module.exports = {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': require.resolve(
'./jest.file.mock.js'
),
'^styled-jsx/(css|macro)$': require.resolve('./jest.styled-jsx-css.mock.js')
'^styled-jsx/(css|macro)$': require.resolve(
'./jest.styled-jsx-css.mock.js'
),
},
}
3 changes: 3 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "@dhis2/cli-app-scripts",
"version": "3.2.9",
"engines": {
"node": ">=10"
},
"repository": {
"type": "git",
"url": "https://github.com/amcgee/dhis2-app-platform",
Expand Down
20 changes: 10 additions & 10 deletions docs/config/d2-config-js-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ All properties are technically optional, but it is recommended to set them expli

The following configuration properties are supported:

| Property | Type | Default | Description |
| :-------------------: | :-------: | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type** | _string_ | **app** | Either **app** or **lib** |
| **name** | _string_ | `pkg.name` | A short, machine-readable unique name for this app |
| **title** | _string_ | `config.name` | The human-readable application title, which will appear in the HeaderBar |
| **description** | _string_ | `pkg.description` | A full-length description of the application |
| **author** | _string_ | `pkg.author` | The name of the developer to include in the DHIS2 manifest |
| **entryPoints.app** | _string_ | **./src/App** | The path to the application entrypoint (not used for libraries) |
| Property | Type | Default | Description |
| :-----------------: | :-------: | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type** | _string_ | **app** | Either **app** or **lib** |
| **name** | _string_ | `pkg.name` | A short, machine-readable unique name for this app |
| **title** | _string_ | `config.name` | The human-readable application title, which will appear in the HeaderBar |
| **description** | _string_ | `pkg.description` | A full-length description of the application |
| **author** | _string_ | `pkg.author` | The name of the developer to include in the DHIS2 manifest |
| **entryPoints.app** | _string_ | **./src/App** | The path to the application entrypoint (not used for libraries) |
| **entryPoints.lib** | _string_ | **./src/index** | The path to the library entrypoint (not used for applications) |
| **coreApp** | _boolean_ | **false** | **ADVANCED** If true, build an app artifact to be included as a root-level core application |
| **standalone** | _boolean_ | **false** | **ADVANCED** If true, do NOT include a static BaseURL in the production app artifact. This includes the `Server` field in the login dialog, which is usually hidden and pre-configured in production. |
| **coreApp** | _boolean_ | **false** | **ADVANCED** If true, build an app artifact to be included as a root-level core application |
| **standalone** | _boolean_ | **false** | **ADVANCED** If true, do NOT include a static BaseURL in the production app artifact. This includes the `Server` field in the login dialog, which is usually hidden and pre-configured in production. |

> _Note_: Dynamic defaults above may reference `pkg` (a property of the local `package.json` file) or `config` (another property within `d2.config.js`).
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following NPM packages are automatically provided by the platform, so their
- `prop-types`
- `styled-jsx`

> _Note_: You may optionally specify a different version of one of these libraries as a runtime dependency in your `package.json`. To avoid duplicate versions in your application bundle, particularly for dependencies like `react` and `@dhis2/app-runtime` which require stable references, you may also need to add a [`resolutions` map entry](https://legacy.yarnpkg.com/en/docs/selective-version-resolutions/) to `package.json`.
> _Note_: You may optionally specify a different version of one of these libraries as a runtime dependency in your `package.json`. To avoid duplicate versions in your application bundle, particularly for dependencies like `react` and `@dhis2/app-runtime` which require stable references, you may also need to add a [`resolutions` map entry](https://legacy.yarnpkg.com/en/docs/selective-version-resolutions/) to `package.json`.
## Custom dependencies

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"concurrently": "^5.0.0"
},
"scripts": {
"format": "d2-style js apply --all --no-stage",
"format": "d2-style js apply",
"lint": "d2-style js check",
"build:adapter": "cd adapter && yarn build",
"build": "yarn build:adapter && yarn install:example",
"install:example": "cd examples/simple-app && yarn --force --check-files",
Expand Down

0 comments on commit d29c11e

Please sign in to comment.