From 2e4c4753d18234e0043007515edc96cbf82c44ec Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:01:56 +0800 Subject: [PATCH 1/8] chore(config): make config up to es2018 --- packages/tsconfig/tsconfig.components.json | 4 ++-- tsconfig.components.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/tsconfig/tsconfig.components.json b/packages/tsconfig/tsconfig.components.json index b629bf9a..82c77d14 100644 --- a/packages/tsconfig/tsconfig.components.json +++ b/packages/tsconfig/tsconfig.components.json @@ -3,7 +3,7 @@ /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ES2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "target": "ES2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, "module": "ESnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ @@ -61,4 +61,4 @@ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, "resolveJsonModule": true } -} +} \ No newline at end of file diff --git a/tsconfig.components.json b/tsconfig.components.json index 5c18b3b8..91197d59 100644 --- a/tsconfig.components.json +++ b/tsconfig.components.json @@ -2,6 +2,5 @@ "extends": "@onr/tsconfig/tsconfig.components.json", "compilerOptions": { "importHelpers": true, - "target": "ES2016" } } \ No newline at end of file From 5a1e00e6949e813c39f79c1f670d779020cbbbdc Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:02:24 +0800 Subject: [PATCH 2/8] chore(core): add comment for transpile --- examples/next-starter/packages/app/next.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/next-starter/packages/app/next.config.js b/examples/next-starter/packages/app/next.config.js index 179b12de..d47f01ac 100644 --- a/examples/next-starter/packages/app/next.config.js +++ b/examples/next-starter/packages/app/next.config.js @@ -15,7 +15,9 @@ if (!files.length) { console.error(new Error('no files')); process.exit(1); } -const withTm = require('next-transpile-modules')([...files, '@onr/plugin-antd', '@onr/core']); +/** need to transpile the stuff, when using `next` in package + */ +const withTm = require('next-transpile-modules')([...files, '@onr/core', '@onr/plugin-antd']); const withPWA = require('next-pwa'); const withAntdLess = require('next-plugin-antd-less'); From 95d83294364fc2031ebbe7684ca6b28a5661630b Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:03:57 +0800 Subject: [PATCH 3/8] chore(logging): use rollup to transpile module to esm standard --- packages/logging/package.json | 13 ++++++++----- packages/logging/rollup.config.js | 15 +++++++++++++++ packages/logging/tsconfig.json | 16 +++++++++++----- 3 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 packages/logging/rollup.config.js diff --git a/packages/logging/package.json b/packages/logging/package.json index e8e8a470..4d42be84 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -16,16 +16,16 @@ "types", "src" ], - "types": "types/index.d.ts", + "types": "lib/index.d.ts", "repository": { "type": "git", "url": "git+https://github.com/OnrampLab/onr-react-ui.git" }, "scripts": { - "dev": "tsc --watch --preserveWatchOutput", + "dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development", "lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx", "format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx", - "build": "tsc --build tsconfig.json", + "build": "rollup -c ./rollup.config.js --environment NODE_ENV:production", "prepublishOnly": "yarn build", "test": "jest --coverage --passWithNoTests" }, @@ -37,17 +37,20 @@ "@livy/contracts": "^1.1.1", "@livy/http-handler": "^1.0.3", "@livy/logger": "^1.0.5", - "@livy/util": "^1.0.5" + "@livy/util": "^1.0.5", + "typescript": "^4.3.4" }, "devDependencies": { "@babel/preset-typescript": "^7.12.7", "@onr/eslint-config": "^0.3.0", "@onr/prettier-config": "^1.1.1", + "@rollup/plugin-typescript": "^8.3.0", "@types/debug": "^4.1.5", "@types/luxon": "^1.25.0", "debug": "^4.3.1", "eslint": "^7.29.0", "prettier": "^1.18.2", + "rollup": "^2.62.0", "typescript": "^4.3.4" }, "prettier": "@onr/prettier-config", @@ -55,4 +58,4 @@ "access": "public" }, "type": "module" -} +} \ No newline at end of file diff --git a/packages/logging/rollup.config.js b/packages/logging/rollup.config.js new file mode 100644 index 00000000..c3b748dd --- /dev/null +++ b/packages/logging/rollup.config.js @@ -0,0 +1,15 @@ +import typescript from '@rollup/plugin-typescript'; +import { defineConfig } from 'rollup'; +export default defineConfig({ + input: ['./src/index.ts', './src/ConsoleHandler.ts'], + output: { + dir: 'lib', + format: 'es', + }, + plugins: [typescript({ tsconfig: './tsconfig.json' })], + treeshake: { + correctVarValueBeforeDeclaration: true, + }, +}); + +console.log(process.env.NODE_ENV); diff --git a/packages/logging/tsconfig.json b/packages/logging/tsconfig.json index 7239ffc5..765aa1e1 100644 --- a/packages/logging/tsconfig.json +++ b/packages/logging/tsconfig.json @@ -2,10 +2,16 @@ "extends": "../../tsconfig.components.json", "compilerOptions": { "outDir": "lib", - "declarationDir": "./types", + "declarationDir": "./lib", "sourceMap": true, - "target": "es6" + "target": "es2021", + "module": "ESNext", + "moduleResolution": "Node" }, - "include": ["src/**/*"], - "exclude": ["**/*.spec.tsx?"] -} + "include": [ + "src/**/*" + ], + "exclude": [ + "**/*.spec.tsx?" + ] +} \ No newline at end of file From bf7ff219674eee7d10e5ba8979c64d7328107bcb Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:04:20 +0800 Subject: [PATCH 4/8] chore(ant): use rollup to transpile module to esm standard --- plugins/antd/package.json | 11 +++++++---- plugins/antd/rollup.config.js | 14 ++++++++++++++ plugins/antd/tsconfig.json | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 plugins/antd/rollup.config.js diff --git a/plugins/antd/package.json b/plugins/antd/package.json index 52f28b84..a2ea3455 100644 --- a/plugins/antd/package.json +++ b/plugins/antd/package.json @@ -15,16 +15,16 @@ "types", "src" ], - "types": "types/index.d.ts", + "types": "lib/index.d.ts", "repository": { "type": "git", "url": "git+https://github.com/OnrampLab/onr-react-ui.git" }, "scripts": { - "dev": "tsc --watch --preserveWatchOutput", + "dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development", "lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx", "format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx", - "build": "tsc --build tsconfig.json", + "build": "rollup -c --environment NODE_ENV:production", "test": "jest --coverage --passWithNoTests", "test:watch": "yarn test --watch", "prepublishOnly": "yarn build" @@ -55,6 +55,8 @@ "@babel/preset-typescript": "^7.12.7", "@onr/eslint-config": "^0.3.0", "@onr/prettier-config": "^1.1.1", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-typescript": "^8.3.0", "@types/antd": "^1.0.0", "@types/lodash-es": "^4.17.5", "@types/node": "^14.14.21", @@ -62,6 +64,7 @@ "@types/react-dom": "^17.0.0", "change-case": "^4.1.2", "eslint": "^7.29.0", + "rollup": "^2.62.0", "typescript": "^4.3.4" }, "prettier": "@onr/prettier-config", @@ -69,4 +72,4 @@ "access": "public" }, "type": "module" -} +} \ No newline at end of file diff --git a/plugins/antd/rollup.config.js b/plugins/antd/rollup.config.js new file mode 100644 index 00000000..a3197bdd --- /dev/null +++ b/plugins/antd/rollup.config.js @@ -0,0 +1,14 @@ +import commonjs from '@rollup/plugin-commonjs'; +import typescript from '@rollup/plugin-typescript'; +import { defineConfig } from 'rollup'; +export default defineConfig({ + input: './src/index.ts', + output: { + dir: 'lib', + format: 'es', + }, + plugins: [typescript({ tsconfig: './tsconfig.json' }), commonjs()], + treeshake: { + correctVarValueBeforeDeclaration: true, + }, +}); diff --git a/plugins/antd/tsconfig.json b/plugins/antd/tsconfig.json index 879e2fcc..99324035 100644 --- a/plugins/antd/tsconfig.json +++ b/plugins/antd/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.components.json", "compilerOptions": { "outDir": "lib", - "declarationDir": "./types", + "declarationDir": "./lib", "sourceMap": true }, "include": [ From ba1240115df3d7acf6cc2634ca8fc7c42416dec7 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:04:31 +0800 Subject: [PATCH 5/8] chore(ant): use rollup to transpile module to esm standard --- packages/core/package.json | 15 ++++++++------- packages/core/rollup.config.js | 14 ++++++++++++++ packages/core/tsconfig.json | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 packages/core/rollup.config.js diff --git a/packages/core/package.json b/packages/core/package.json index bad6a23f..cfb29586 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,10 +7,6 @@ "license": "ISC", "main": "lib/index.js", "source": "src/index.ts", - "exports": { - ".": "./lib/index.js", - "./api": "./lib/api/index.js" - }, "directories": { "lib": "lib", "test": "__tests__" @@ -22,16 +18,16 @@ "api", "api.js" ], - "types": "types/index.d.ts", + "types": "lib/index.d.ts", "repository": { "type": "git", "url": "git+https://github.com/OnrampLab/onr-react-ui.git" }, "scripts": { - "dev": "yarn build && tsc --watch --preserveWatchOutput", + "dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development", "lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx", "format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx", - "build": "tsc && node ./config/build.js", + "build": "rollup -c --environment NODE_ENV:production", "test": "jest --coverage --passWithNoTests", "test:watch": "yarn test --watch", "prepublishOnly": "yarn build" @@ -62,11 +58,16 @@ "@babel/preset-typescript": "^7.12.7", "@onr/eslint-config": "^0.3.0", "@onr/prettier-config": "^1.1.1", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-typescript": "^8.3.0", "@types/lodash-es": "^4.17.5", "@types/node": "^14.14.21", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "eslint": "^7.29.0", + "rollup": "^2.62.0", + "rollup-plugin-dts": "^4.1.0", "typescript": "^4.3.4" }, "prettier": "@onr/prettier-config", diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js new file mode 100644 index 00000000..5e292760 --- /dev/null +++ b/packages/core/rollup.config.js @@ -0,0 +1,14 @@ +import commonjs from '@rollup/plugin-commonjs'; +import typescript from '@rollup/plugin-typescript'; +import { defineConfig } from 'rollup'; +export default defineConfig({ + input: { index: './src/index.ts', api: './src/api/index.ts' }, + output: { + dir: 'lib', + format: 'es', + }, + plugins: [typescript({ tsconfig: './tsconfig.json' }), commonjs()], + treeshake: { + correctVarValueBeforeDeclaration: true, + }, +}); diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 879e2fcc..99324035 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.components.json", "compilerOptions": { "outDir": "lib", - "declarationDir": "./types", + "declarationDir": "./lib", "sourceMap": true }, "include": [ From 3fe8b66dbecf2eb36b49664aebac69dd4d1dc4b7 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 12:05:04 +0800 Subject: [PATCH 6/8] chore(packages): update lock file --- yarn.lock | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 92ea7b6b..d7c90907 100644 --- a/yarn.lock +++ b/yarn.lock @@ -57,6 +57,13 @@ dependencies: "@babel/highlight" "^7.14.5" +"@babel/code-frame@^7.16.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + "@babel/compat-data@^7.12.1", "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7": version "7.14.7" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" @@ -417,6 +424,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + "@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" @@ -459,6 +471,15 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" + integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.12.11", "@babel/parser@^7.12.3", "@babel/parser@^7.12.7", "@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.4.3": version "7.14.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" @@ -3448,6 +3469,27 @@ "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" +"@rollup/plugin-commonjs@^21.0.1": + version "21.0.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz#1e57c81ae1518e4df0954d681c642e7d94588fee" + integrity sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + +"@rollup/plugin-multi-entry@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-multi-entry/-/plugin-multi-entry-4.1.0.tgz#e531511d4a9f490f766dbee1f10d6d94d26b3863" + integrity sha512-nellK5pr50W0JA2+bDJbG8F79GBP802J40YRoC0wyfpTAeAn5mJ4eaFiB/MN+YoX9hgb/6RJoZl9leDjZnUFKw== + dependencies: + "@rollup/plugin-virtual" "^2.0.3" + matched "^5.0.0" + "@rollup/plugin-node-resolve@^11.2.1": version "11.2.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" @@ -3468,6 +3510,19 @@ "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" +"@rollup/plugin-typescript@^8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz#bc1077fa5897b980fc27e376c4e377882c63e68b" + integrity sha512-I5FpSvLbtAdwJ+naznv+B4sjXZUcIvLLceYpITAn7wAP8W0wqc5noLdGIp9HGVntNhRWXctwPYrSSFQxtl0FPA== + dependencies: + "@rollup/pluginutils" "^3.1.0" + resolve "^1.17.0" + +"@rollup/plugin-virtual@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-virtual/-/plugin-virtual-2.0.3.tgz#0afc88d75c1e1378ab290b8e9898d4edb5be0d74" + integrity sha512-pw6ziJcyjZtntQ//bkad9qXaBx665SgEL8C8KI5wO8G5iU5MPxvdWrQyVaAvjojGm9tJoS8M9Z/EEepbqieYmw== + "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" @@ -4658,6 +4713,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/estree@*": + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -9616,6 +9676,11 @@ estree-walker@^1.0.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -12146,6 +12211,13 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.2, is-regex@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" @@ -14452,6 +14524,14 @@ marksy@^8.0.0: he "^1.2.0" marked "^0.3.12" +matched@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/matched/-/matched-5.0.1.tgz#620606d9dac6b7f4e955354b82e02ef4e3a62dc3" + integrity sha512-E1fhSTPRyhAlNaNvGXAgZQlq1hL0bgYMTk/6bktVlIhzUnX/SZs7296ACdVeNJE8xFNGSuvd9IpI7vSnmcqLvw== + dependencies: + glob "^7.1.6" + picomatch "^2.2.1" + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -18682,6 +18762,15 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rollup-plugin-dts@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-4.1.0.tgz#63b1e7de3970bb6d50877e60df2150a3892bc49c" + integrity sha512-rriXIm3jdUiYeiAAd1Fv+x2AxK6Kq6IybB2Z/IdoAW95fb4uRUurYsEYKa8L1seedezDeJhy8cfo8FEL9aZzqg== + dependencies: + magic-string "^0.25.7" + optionalDependencies: + "@babel/code-frame" "^7.16.0" + rollup-plugin-terser@^7.0.0: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -18699,6 +18788,13 @@ rollup@^2.43.1: optionalDependencies: fsevents "~2.3.2" +rollup@^2.62.0: + version "2.62.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.62.0.tgz#9e640b419fc5b9e0241844f6d55258bd79986ecc" + integrity sha512-cJEQq2gwB0GWMD3rYImefQTSjrPYaC6s4J9pYqnstVLJ1CHa/aZNVkD4Epuvg4iLeMA4KRiq7UM7awKK6j7jcw== + optionalDependencies: + fsevents "~2.3.2" + route-recognizer@^0.3.3: version "0.3.4" resolved "https://registry.yarnpkg.com/route-recognizer/-/route-recognizer-0.3.4.tgz#39ab1ffbce1c59e6d2bdca416f0932611e4f3ca3" @@ -20652,9 +20748,9 @@ typeorm@^0.2.30: zen-observable-ts "^1.0.0" typescript@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" - integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== + version "4.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" + integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== ua-parser-js@^0.7.18: version "0.7.28" From 54bf2768f6613bc12f3e4ebc8dde3714641b2089 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Wed, 5 Jan 2022 14:41:21 +0800 Subject: [PATCH 7/8] fix(plugins/user): fix error catch --- plugins/user/src/containers/UserListPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/user/src/containers/UserListPage.tsx b/plugins/user/src/containers/UserListPage.tsx index 6487a803..97465056 100644 --- a/plugins/user/src/containers/UserListPage.tsx +++ b/plugins/user/src/containers/UserListPage.tsx @@ -108,7 +108,8 @@ const UserListContainer: React.FC = () => { message.success(`User ${user.name} deleted`); fetchUserListData(); } catch (e) { - message.error(`Failed to delete user${e.message && `: ${e.message}`}`); + if (e instanceof Error) + message.error(`Failed to delete user${e.message && `: ${e.message}`}`); } }; From 1863b876dd91ec4dcaadf2e8aef8bfc18555f5f5 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Thu, 6 Jan 2022 10:05:55 +0800 Subject: [PATCH 8/8] fix(sample): api using incorrect --- .../packages/app/src/pages/api/auth/[...nextauth].ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/next-starter/packages/app/src/pages/api/auth/[...nextauth].ts b/examples/next-starter/packages/app/src/pages/api/auth/[...nextauth].ts index 309f3900..0e81f868 100644 --- a/examples/next-starter/packages/app/src/pages/api/auth/[...nextauth].ts +++ b/examples/next-starter/packages/app/src/pages/api/auth/[...nextauth].ts @@ -1,4 +1,4 @@ -import { createNextAuthApi } from '@onr/core/api'; +import { createNextAuthApi } from '@onr/core/lib/api'; import { AuthService } from '@onr/plugin-auth'; import { app } from '../../../components/app';