Skip to content

Commit

Permalink
fix: update react-scripts and cli-style at same time to use eslint 7 (#…
Browse files Browse the repository at this point in the history
…475)

* chore: update react-scripts and cli-style

* ci: use unified workflows for caching
  • Loading branch information
varl committed Oct 30, 2020
1 parent 3fe0885 commit 8fd9225
Show file tree
Hide file tree
Showing 13 changed files with 8,392 additions and 4,383 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/cli/assets
**/locales/index.js
cli/config/init.entrypoint.js
cli/config/init.App.test.js

122 changes: 122 additions & 0 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: 'dhis2: verify (lib)'

on:
push:
branches:

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

jobs:
install:
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

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

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

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Build
run: yarn build

- uses: actions/upload-artifact@v2
with:
name: lib-build
path: |
**/build
!**/node_modules
retention-days: 1

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

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Build
run: yarn build

- name: Lint
run: yarn lint

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

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Test
run: yarn test

publish:
runs-on: ubuntu-latest
needs: [build, lint, test]
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

- uses: actions/download-artifact@v2
with:
name: lib-build

- name: Publish to NPM
run: npx @dhis2/cli-utils release --publish npm
87 changes: 0 additions & 87 deletions .github/workflows/dhis2-verify.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/npm-publish.yml

This file was deleted.

6 changes: 3 additions & 3 deletions cli/src/lib/bundleApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ module.exports = (inDir, outFile) => {
zlib: { level: 9 },
})

output.on('close', function() {
output.on('close', function () {
reporter.print(chalk.dim(`Total size: ${archive.pointer()} bytes`))
resolve()
})

archive.on('warning', function(err) {
archive.on('warning', function (err) {
if (err.code === 'ENOENT') {
reporter.warn('[bundler]', err)
} else {
reject(err)
}
})

archive.on('error', function(err) {
archive.on('error', function (err) {
reject(err)
})

Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib/compiler/compileLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const compileLibrary = async ({ config, paths, mode, watch }) => {
}
})

process.on('SIGINT', function() {
process.on('SIGINT', function () {
reporter.debug('Caught interrupt signal')
watcher.close()
})
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib/generateManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = (paths, config, publicUrl) => {
},
},
icons: {
'48': 'dhis2-app-icon.png',
48: 'dhis2-app-icon.png',
},
developer: config.author,

Expand Down
14 changes: 7 additions & 7 deletions examples/simple-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"license": "BSD-3-Clause",
"private": true,
"devDependencies": {
"@dhis2/cli-app-scripts": "file:../../cli"
"@dhis2/cli-app-scripts": "*"
},
"scripts": {
"start": "../../cli/bin/d2-app-scripts start",
"build": "../../cli/bin/d2-app-scripts build",
"test": "../../cli/bin/d2-app-scripts test",
"deploy": "../../cli/bin/d2-app-scripts deploy"
"start": "d2-app-scripts start",
"build": "d2-app-scripts build",
"test": "d2-app-scripts test",
"deploy": "d2-app-scripts deploy"
},
"resolutions": {
"@dhis2/app-shell": "file:../../shell",
"@dhis2/app-adapter": "file:../../adapter"
"@dhis2/app-shell": "*",
"@dhis2/app-adapter": "*"
},
"peerDependencies": {
"@dhis2/app-runtime": "*",
Expand Down
Loading

0 comments on commit 8fd9225

Please sign in to comment.