From 8950764e36b812395413633000d439e8dcd3f631 Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Wed, 13 May 2020 11:20:46 +0200 Subject: [PATCH 1/6] updated babel, rollup, react,... --- .babelrc | 11 +++--- package.json | 94 +++++++++--------------------------------------- rollup.config.js | 42 ++++++++++------------ 3 files changed, 41 insertions(+), 106 deletions(-) diff --git a/.babelrc b/.babelrc index 723ea64..20c1db0 100644 --- a/.babelrc +++ b/.babelrc @@ -1,9 +1,12 @@ { "presets": [ - ["env", { + ["@babel/preset-env", { "modules": false }], - "stage-0", - "react" + ["@babel/preset-react"] + ], + "plugins": [ + "@babel/plugin-transform-runtime", + "@babel/plugin-proposal-class-properties" ] -} +} \ No newline at end of file diff --git a/package.json b/package.json index c280da8..90bcd99 100644 --- a/package.json +++ b/package.json @@ -6,93 +6,31 @@ "repository": "openimis/openimis-fe-home_js", "main": "dist/index.js", "module": "dist/index.es.js", - "jsnext:main": "dist/index.es.js", "engines": { "node": ">=8", "npm": ">=5" }, "scripts": { - "test": "cross-env CI=1 react-scripts test --env=jsdom", - "test:watch": "react-scripts test --env=jsdom", "build": "rollup -c", - "start": "rollup -c -w", - "prepare": "yarn run build", - "predeploy": "cd example && yarn install && yarn run build", - "deploy": "gh-pages -d example/build" - }, - "peerDependencies": { - "@date-io/core": "^1.3.6", - "@material-ui/core": "^4.3.3", - "@material-ui/icons": "^4.2.1", - "@material-ui/pickers": "^3.2.2", - "@openimis/fe-core": ">=1.1.0", - "react-autosuggest": "^9.4.3", - "history": "^4.9.0", - "lodash": "^4.17.15", - "lodash-uuid": "^0.0.3", - "moment": "^2.24.0", - "prop-types": "^15.5.4", - "react": "^16.8.6", - "react-dom": "^16.8.6", - "react-intl": "^2.9.0", - "react-redux": "^7.0.3", - "react-router": "^5.0.0", - "react-router-dom": "^5.0.0", - "redux": "^4.0.1", - "redux-api-middleware": "^3.0.1", - "redux-thunk": "^2.3.0" + "start": "rollup -c -w" }, "devDependencies": { - "@date-io/core": "^1.3.6", - "@material-ui/core": "^4.3.3", - "@material-ui/icons": "^4.2.1", - "@material-ui/pickers": "^3.2.2", - "@openimis/fe-core": ">=1.1.0", - "react-autosuggest": "^9.4.3", - "@svgr/rollup": "^2.4.1", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-eslint": "^10.0.3", - "babel-plugin-external-helpers": "^6.22.0", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-0": "^6.24.1", - "classnames": "^2.2.6", - "cross-env": "^5.1.4", - "eslint": "^6.5.1", - "eslint-config-standard": "^14.1.0", - "eslint-config-standard-react": "^9.2.0", - "eslint-plugin-import": "^2.13.0", - "eslint-plugin-node": "^10.0.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-react": "^7.15.0", - "eslint-plugin-standard": "^4.0.1", - "gh-pages": "^1.2.0", - "history": "^4.9.0", - "lodash": "^4.17.15", - "lodash-uuid": "^0.0.3", - "moment": "^2.24.0", - "prop-types": "^15.5.4", - "react": "^16.8.6", - "react-dom": "^16.8.6", - "react-intl": "^2.9.0", - "react-redux": "^7.0.3", - "react-router": "^5.0.0", - "react-router-dom": "^5.0.0", - "react-scripts": "^1.1.4", - "redux": "^4.0.1", - "redux-api-middleware": "^3.0.1", - "redux-thunk": "^2.3.0", - "rollup": "^0.64.1", - "rollup-plugin-babel": "^3.0.7", - "rollup-plugin-commonjs": "^9.1.3", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-peer-deps-external": "^2.2.0", - "rollup-plugin-postcss": "^1.6.2", - "rollup-plugin-url": "^1.4.0" + "@babel/cli": "^7.8.4", + "@babel/core": "^7.9.6", + "@babel/plugin-proposal-class-properties": "^7.8.3", + "@babel/plugin-transform-runtime": "^7.9.6", + "@babel/preset-env": "^7.9.6", + "@babel/preset-react": "^7.9.4", + "@babel/runtime": "^7.9.6", + "@rollup/plugin-babel": "^5.0.0", + "@rollup/plugin-commonjs": "^11.1.0", + "@rollup/plugin-json": "^4.0.3", + "@rollup/plugin-node-resolve": "^7.1.3", + "@rollup/plugin-url": "^5.0.0", + "rollup": "^2.10.0" }, "files": [ "dist" - ] + ], + "dependencies": {} } \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index bf0733e..b7ffa8d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,41 +1,35 @@ -import babel from 'rollup-plugin-babel' -import commonjs from 'rollup-plugin-commonjs' -import external from 'rollup-plugin-peer-deps-external' -import postcss from 'rollup-plugin-postcss' -import resolve from 'rollup-plugin-node-resolve' -import url from 'rollup-plugin-url' -import json from 'rollup-plugin-json' -import svgr from '@svgr/rollup' - +import babel from '@rollup/plugin-babel' +import json from '@rollup/plugin-json' import pkg from './package.json' export default { input: 'src/index.js', output: [ - { - file: pkg.main, - format: 'cjs', - sourcemap: true - }, { file: pkg.module, format: 'es', sourcemap: true } ], + external: [ + /^@babel.*/, + /^@date-io\/.*/, + /^@material-ui\/.*/, + /^@openimis.*/, + "classnames", + "clsx", + "history", + /^lodash.*/, + "moment", + "prop-types", + /^react.*/, + /^redux.*/ + ], plugins: [ json(), - external(), - postcss({ - modules: true - }), - url(), - svgr(), babel({ exclude: 'node_modules/**', - plugins: [ 'external-helpers' ] + babelHelpers: 'runtime' }), - resolve(), - commonjs() ] -} +} \ No newline at end of file From 89f9cb8cd29d5fdd547cedde69b3054a0daf1247 Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Wed, 20 May 2020 15:49:15 +0200 Subject: [PATCH 2/6] add github workflow --- .github/workflows/npmpublish.yml | 50 ++++++++++++++++++++++++++++++++ package.json | 2 +- rollup.config.js | 5 ++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npmpublish.yml diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml new file mode 100644 index 0000000..2336d08 --- /dev/null +++ b/.github/workflows/npmpublish.yml @@ -0,0 +1,50 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: yarn install + - run: yarn build + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + scope: openimis + - run: yarn install + - run: yarn build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + - run: yarn install + - run: yarn build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index 90bcd99..5eaa9f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openimis/fe-home", - "version": "1.1.0", + "version": "1.2.0-rc1", "license": "AGPL-3.0-only", "description": "openIMIS Frontend Home reference module", "repository": "openimis/openimis-fe-home_js", diff --git a/rollup.config.js b/rollup.config.js index b7ffa8d..e9c148c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,6 +9,11 @@ export default { file: pkg.module, format: 'es', sourcemap: true + }, + { + file: 'dist/index.js', + format: 'cjs', + sourcemap: true } ], external: [ From 50f8d0d56d38c34d6a9829c4646aecd4b0d53d87 Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Wed, 20 May 2020 17:37:04 +0200 Subject: [PATCH 3/6] added lgtm badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9af9470..273d024 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ This repository holds the files of the openIMIS Frontend Home reference module. It is dedicated to be deployed as a module of [openimis-fe_js](https://github.com/openimis/openimis-fe_js). [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) +[![Total alerts](https://img.shields.io/lgtm/alerts/g/openimis/openimis-fe-home_js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/openimis/openimis-fe-home_js/alerts/) ## Main Menu Contributions None From 5614303870f03c9c2f9135cc83d173ffc181a893 Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Mon, 6 Jul 2020 08:32:22 +0200 Subject: [PATCH 4/6] added missing dev dependencies --- package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5eaa9f1..3bcfade 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,17 @@ "@rollup/plugin-json": "^4.0.3", "@rollup/plugin-node-resolve": "^7.1.3", "@rollup/plugin-url": "^5.0.0", + "moment": "^2.25.3", + "prop-types": "^15.7.2", + "react-autosuggest": "^10.0.2", + "react-intl": "^2.9.0", + "react-router-dom": "^5.2.0", + "redux": "^4.0.5", + "redux-api-middleware": "^3.2.1", "rollup": "^2.10.0" }, "files": [ "dist" ], "dependencies": {} -} \ No newline at end of file +} From 91a0840cb7f99a29480092998d2f62590ddedaa0 Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Mon, 5 Oct 2020 09:09:10 +0200 Subject: [PATCH 5/6] bumped v1.2.0-rc2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3bcfade..c95278a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openimis/fe-home", - "version": "1.2.0-rc1", + "version": "1.2.0-rc2", "license": "AGPL-3.0-only", "description": "openIMIS Frontend Home reference module", "repository": "openimis/openimis-fe-home_js", From 0c6d18c0f8e82c54a0af9c8dac72502d7d930efc Mon Sep 17 00:00:00 2001 From: Xavier Gillmann Date: Mon, 30 Nov 2020 14:46:44 +0100 Subject: [PATCH 6/6] hotfix: react-intl as peer dependency & bumped 1.2.0-rc3 --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c95278a..211e608 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openimis/fe-home", - "version": "1.2.0-rc2", + "version": "1.2.0-rc3", "license": "AGPL-3.0-only", "description": "openIMIS Frontend Home reference module", "repository": "openimis/openimis-fe-home_js", @@ -14,6 +14,9 @@ "build": "rollup -c", "start": "rollup -c -w" }, + "peerDependency": { + "react-intl": "^5.8.1" + }, "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.9.6", @@ -30,7 +33,6 @@ "moment": "^2.25.3", "prop-types": "^15.7.2", "react-autosuggest": "^10.0.2", - "react-intl": "^2.9.0", "react-router-dom": "^5.2.0", "redux": "^4.0.5", "redux-api-middleware": "^3.2.1", @@ -40,4 +42,4 @@ "dist" ], "dependencies": {} -} +} \ No newline at end of file