diff --git a/.eslintignore b/.eslintignore index af71376a4..f347f0364 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ /cli/assets +**/locales/index.js diff --git a/.github/workflows/node-lint.yml b/.github/workflows/node-lint.yml new file mode 100644 index 000000000..706ea4aa5 --- /dev/null +++ b/.github/workflows/node-lint.yml @@ -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 diff --git a/.github/workflows/node-publish.yml b/.github/workflows/node-publish.yml new file mode 100644 index 000000000..56d0e0e19 --- /dev/null +++ b/.github/workflows/node-publish.yml @@ -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: 'apps@dhis2.org' + GIT_COMMITTER_NAME: '@dhis2-bot' + GIT_COMMITTER_EMAIL: 'apps@dhis2.org' + 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b22369ba5..000000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -node_js: - - lts/* -script: - - yarn build -deploy: - - provider: script - skip_cleanup: true - script: - - npx @dhis2/cli utils release --publish npm - on: - tags: false - branch: master -env: - global: - - GIT_AUTHOR_NAME=@dhis2-bot - - GIT_AUTHOR_EMAIL=apps@dhis2.org - - GIT_COMMITTER_NAME=@dhis2-bot - - GIT_COMMITTER_EMAIL=apps@dhis2.org - - secure: NqFcKQzLDz7TOwEjjnMJ3YpLvZ8bK79F+a33S/Mi/k9y5Ocs1wmLLdsiROK3MjzGzuF9c6lLFbCQqrluGkSjVZfWpRVAWWNlzCdL62RYR49koxr5f7k0d5CHHYK//+/i9TKklVLc6JX454flp6swRqGsibkpbq6MetnQLjtqknex4pLKNvEEr7LZnnUjA/5xm3p1W04zyvnvpZi5yyrrc7Wycc/O76doqZ4YFs1wBg92z14T37lqERc24c7rJZN4KFwVNeDOEczemm71nLv1fmDdsHNO1d3ERhCAy0ihPhZRyjtx5f18H4XYZzh48UZvDkozoAlFyE4rDQ2F9AguPbysNXTgTFoEPEsuVcZ55rwY57hBmX3wAa/KINX4WzVxtsnOkEKXkiDAEtdKQmk0Amrpa8A4AABiWXA9ZRLuDyDmob0O4Cx/VpLTKpkHwFGxQzhtNfr8vQsmAlYXg3wFQbLZGJX+fp7NdvMlczfq12SlNFea/BcAJoGGc9NlTq/tCDksA8T6SZsZ0we97Y0sM896cG044WC86bZJ7leXFTjDitTnc+vg0LPpPcH2INHvSPQubGk/Um1qxtrzi1IDHqgHa3MUZcsfcTZl1w61Lo2FC2OBD1nHwieS4vTYAXJtjjCYQcuiQejH9LMYaaKjEfYnaQE1xZ94J3t/s8GC1UM= - - secure: HHKfk5sD8g4ETCkUC225gG/kOvgqD6JSHkYuhQuCQ1AVNUF0V1QD6mL6hJ5Gp6ikscyUpZenbnIPkQ4iHL4VfywAb3bs4jEJMTlGHNDkVSAD2v4pJUeGcdiqC+lbmrWpQM8oigwigl5AGh/Or5Om3QfpOZJLfNcYVYhQH729xYZFFLDFYp3H+FI9wVcLhD0luh9itCXxoNIclPiyb3aiUBJqfd4rQEXC3LKnfWbuHJ4CttI44t+kEaYdlWf75IpWsug/+J88yK80vNF1wpf5u/CIvYbBsuP1/k3NClvyqCl+LCUuu4Xsiu2n4SL+R43zHhi2ekftGOBXqMfd9axifczAZG75sC7dmiQW0YDtN/2tBAWJ4LVfX+/cWzW7UfPY2VfN2/6sg3guQVXr1CsMKXklphx6Ff9l76ymz4ldycE4wS2wL7DluGuMWybZSwxPZeiNBo22LuT38ocY4QZjzbsx4Zs/opRnOrWHavpJJtcGiGSv6QYdgEivQmIf9ZaQPgrL2iffPR6dDY6HpesP4AMYUFWzwY6WJDBOkerstU/ywRupx5Si97edGbOrAJf37vPQcnvzG+ULp2c2uomjU8ZbHkN099LOo5fBxtlTZghWDJBpRSzgDtc3tF+GonoareOnLiZ+0H2TymK39gmb0crC/Iw0Zkd/KtNjmho6ARk= diff --git a/CHANGELOG.md b/CHANGELOG.md index 85473ca8c..075702848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [4.0.0](https://github.com/dhis2/app-platform/compare/v3.2.9...v4.0.0) (2020-04-02) + + +### chore + +* update node engine to >= 10 ([#346](https://github.com/dhis2/app-platform/issues/346)) ([d29c11e](https://github.com/dhis2/app-platform/commit/d29c11e264d2bac58ce01d64715d877f0e388a0c)) + + +### BREAKING CHANGES + +* Require Node version 10 or above. + +* ci(actions): give checkout action our custom pat + ## [3.2.9](https://github.com/dhis2/app-platform/compare/v3.2.8...v3.2.9) (2020-03-26) diff --git a/adapter/package.json b/adapter/package.json index 5a889d0e6..dc455e832 100644 --- a/adapter/package.json +++ b/adapter/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/app-adapter", - "version": "3.2.9", + "version": "4.0.0", "repository": { "type": "git", "url": "https://github.com/amcgee/dhis2-app-platform", @@ -21,7 +21,7 @@ "moment": "^2.24.0" }, "devDependencies": { - "@dhis2/cli-app-scripts": "3.2.9" + "@dhis2/cli-app-scripts": "4.0.0" }, "scripts": { "build": "d2-app-scripts build" diff --git a/cli/config/app.babel.config.js b/cli/config/app.babel.config.js index 5b5f06321..6286e15a0 100644 --- a/cli/config/app.babel.config.js +++ b/cli/config/app.babel.config.js @@ -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')], + }, + }, } diff --git a/cli/config/jest.config.js b/cli/config/jest.config.js index d42fb6275..d22a8f2f6 100644 --- a/cli/config/jest.config.js +++ b/cli/config/jest.config.js @@ -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' + ), }, } diff --git a/cli/package.json b/cli/package.json index 474a56b9c..4d83ee15f 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,9 @@ { "name": "@dhis2/cli-app-scripts", - "version": "3.2.9", + "version": "4.0.0", + "engines": { + "node": ">=10" + }, "repository": { "type": "git", "url": "https://github.com/amcgee/dhis2-app-platform", @@ -29,7 +32,7 @@ "@babel/preset-env": "^7.6.2", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.6.0", - "@dhis2/app-shell": "3.2.9", + "@dhis2/app-shell": "4.0.0", "@dhis2/cli-helpers-engine": "^1.5.0", "archiver": "^3.1.1", "babel-jest": "^24.9.0", diff --git a/docs/config/d2-config-js-reference.md b/docs/config/d2-config-js-reference.md index f9fe3d6c9..416f904ae 100644 --- a/docs/config/d2-config-js-reference.md +++ b/docs/config/d2-config-js-reference.md @@ -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) | -| **entryPoints.index** | _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. | +| 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. | > _Note_: Dynamic defaults above may reference `pkg` (a property of the local `package.json` file) or `config` (another property within `d2.config.js`). diff --git a/docs/usage/dependencies.md b/docs/usage/dependencies.md index 60f4338d1..6546785bd 100644 --- a/docs/usage/dependencies.md +++ b/docs/usage/dependencies.md @@ -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 diff --git a/package.json b/package.json index 70f193844..24a932e90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "3.2.9", + "version": "4.0.0", "private": true, "repository": { "type": "git", @@ -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", diff --git a/shell/package.json b/shell/package.json index d602e0618..c9478b3a2 100644 --- a/shell/package.json +++ b/shell/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/app-shell", - "version": "3.2.9", + "version": "4.0.0", "repository": { "type": "git", "url": "https://github.com/amcgee/dhis2-app-platform", @@ -12,7 +12,7 @@ "access": "public" }, "dependencies": { - "@dhis2/app-adapter": "3.2.9", + "@dhis2/app-adapter": "4.0.0", "@dhis2/app-runtime": "^2.0.4", "@dhis2/d2-i18n": "^1.0.5", "@dhis2/ui-core": "^4.6.1",