From dd497d0ca6ef53906bff56a104ebd81c7b7d94bb Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 29 Jan 2024 12:57:55 -0800 Subject: [PATCH] chore(repo): add build:watch using rollup --- package.json | 5 ++--- packages/adapter-nextjs/package.json | 4 +--- packages/analytics/package.json | 3 +-- packages/api-graphql/package.json | 3 +-- packages/api-rest/package.json | 3 +-- packages/api/package.json | 3 +-- packages/auth/package.json | 3 +-- packages/aws-amplify/package.json | 3 +-- packages/core/package.json | 3 +-- packages/datastore-storage-adapter/package.json | 3 +-- packages/datastore/package.json | 3 +-- packages/geo/package.json | 3 +-- packages/interactions/package.json | 3 +-- packages/notifications/package.json | 3 +-- packages/predictions/package.json | 3 +-- packages/pubsub/package.json | 3 +-- packages/react-native/package.json | 3 +-- packages/rtn-push-notification/package.json | 3 +-- packages/rtn-web-browser/package.json | 3 +-- packages/storage/package.json | 3 +-- yarn.lock | 5 +++++ 21 files changed, 26 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index cb926b74190..e2feac11966 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,7 @@ "test:tsc-compliance": "yarn workspace tsc-compliance-test test:compliance", "docs": "typedoc packages/**/src --name amplify-js --hideGenerator --excludePrivate --ignoreCompilerErrors --mode file --out docs/api --theme docs/amplify-theme/typedoc/ --readme README.md", "build": "lerna run build --stream && yarn test:duplicates", - "build:watch": "concurrently 'lerna run build:cjs:watch --parallel' 'lerna run build:esm:watch --parallel' --raw", - "build:esm:watch": "lerna run build:esm:watch --parallel", - "build:cjs:watch": "lerna run build:cjs:watch --parallel", + "build:watch": "concurrently 'lerna run build:watch --parallel' --raw", "build:client-types": "cd scripts/dts-bundler && yarn && yarn run build", "clean": "lerna run clean --parallel", "clean:size": "lerna run clean:size --parallel", @@ -97,6 +95,7 @@ "json-loader": "^0.5.7", "lerna": "^7.4.2", "license-check-and-add": "^4.0.5", + "mkdirp": "^3.0.1", "prettier": "^3.1.0", "rimraf": "^2.6.2", "rollup": "^4.9.6", diff --git a/packages/adapter-nextjs/package.json b/packages/adapter-nextjs/package.json index ad2590a2255..be4f88bd909 100644 --- a/packages/adapter-nextjs/package.json +++ b/packages/adapter-nextjs/package.json @@ -60,9 +60,7 @@ "build": "npm run clean && npm run build:esm-cjs", "build-with-test": "npm test && npm run build", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:esm-cjs:watch": "npm run build:esm-cjs -- --watch", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "clean": "npm run clean:size && rimraf dist", "clean:size": "rimraf dual-publish-tmp tmp*", "format": "echo \"Not implemented\"", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 1ea661f8014..58c8b746cc2 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm run clean && npm run test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/api-graphql/package.json b/packages/api-graphql/package.json index a3c59a24c9b..15ec546487f 100644 --- a/packages/api-graphql/package.json +++ b/packages/api-graphql/package.json @@ -19,8 +19,7 @@ "build-with-test": "npm test && npm build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/api-rest/package.json b/packages/api-rest/package.json index dae870611bb..e0178f57a04 100644 --- a/packages/api-rest/package.json +++ b/packages/api-rest/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm test && npm build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/api/package.json b/packages/api/package.json index 797a8f9f08c..c08c0f424f6 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -18,8 +18,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/auth/package.json b/packages/auth/package.json index 30b9183d788..5eccee3f880 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -20,8 +20,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf lib-esm lib dist", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/aws-amplify/package.json b/packages/aws-amplify/package.json index 93f581e7576..9df883111cb 100644 --- a/packages/aws-amplify/package.json +++ b/packages/aws-amplify/package.json @@ -240,8 +240,7 @@ "build-with-test": "npm run clean && npm test && tsc && webpack -p", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m es6 --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", diff --git a/packages/core/package.json b/packages/core/package.json index 3215a21c678..3e59f46bfdd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,8 +21,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run generate-version && npm run build:esm-cjs && npm run build:umd", "generate-version": "genversion src/Platform/version.ts --es6 --semi --source ../aws-amplify", "clean": "npm run clean:size && rimraf dist lib lib-esm", diff --git a/packages/datastore-storage-adapter/package.json b/packages/datastore-storage-adapter/package.json index a7a8572b6e9..1d498dd1195 100644 --- a/packages/datastore-storage-adapter/package.json +++ b/packages/datastore-storage-adapter/package.json @@ -14,8 +14,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "rimraf dist lib lib-esm", "format": "echo \"Not implemented\"", diff --git a/packages/datastore/package.json b/packages/datastore/package.json index eec00515bb7..06602e81c1f 100644 --- a/packages/datastore/package.json +++ b/packages/datastore/package.json @@ -19,8 +19,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/geo/package.json b/packages/geo/package.json index fd6e247063d..f96db6de802 100644 --- a/packages/geo/package.json +++ b/packages/geo/package.json @@ -19,8 +19,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/interactions/package.json b/packages/interactions/package.json index 9b09a10d73f..fbf2c7e1006 100644 --- a/packages/interactions/package.json +++ b/packages/interactions/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm run clean && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/notifications/package.json b/packages/notifications/package.json index d634211bfe8..c6436b7b509 100644 --- a/packages/notifications/package.json +++ b/packages/notifications/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm run clean && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/predictions/package.json b/packages/predictions/package.json index 9b57980d452..9509df20564 100644 --- a/packages/predictions/package.json +++ b/packages/predictions/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm run clean && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 861fbe830d5..7fad5a366c4 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -16,8 +16,7 @@ "build-with-test": "npm run clean && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs && cp -R src/vendor dist/cjs/vendor && cp -R src/vendor dist/esm/vendor", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "mkdirp dist/esm/vendor && mkdirp dist/cjs/vendor && cp -R src/vendor dist/cjs/vendor && cp -R src/vendor dist/esm/vendor && rollup -c rollup.config.mjs --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 14ef481d580..efc58ed7728 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -15,8 +15,7 @@ "test:android": "./android/gradlew test -p ./android", "build-with-test": "npm run clean && npm test && tsc", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", diff --git a/packages/rtn-push-notification/package.json b/packages/rtn-push-notification/package.json index db09334a983..913a6fcd5fa 100644 --- a/packages/rtn-push-notification/package.json +++ b/packages/rtn-push-notification/package.json @@ -15,8 +15,7 @@ "test:android": "./android/gradlew test -p ./android", "build-with-test": "npm run clean && npm test && tsc", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", diff --git a/packages/rtn-web-browser/package.json b/packages/rtn-web-browser/package.json index ec40e417f56..5ce9bd740f6 100644 --- a/packages/rtn-web-browser/package.json +++ b/packages/rtn-web-browser/package.json @@ -15,8 +15,7 @@ "test:android": "./android/gradlew test -p ./android", "build-with-test": "npm run clean && npm test && tsc", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs", "clean": "rimraf dist lib lib-esm", "format": "echo \"Not implemented\"", diff --git a/packages/storage/package.json b/packages/storage/package.json index 82e8d36a987..74ff0c2e57a 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -26,8 +26,7 @@ "build-with-test": "npm test && npm run build", "build:umd": "webpack && webpack --config ./webpack.config.dev.js", "build:esm-cjs": "rollup -c rollup.config.mjs", - "build:cjs:watch": "rimraf dist/cjs && tsc -p tsconfig.watch.json -m commonjs --outDir dist/cjs --watch", - "build:esm:watch": "rimraf dist/esm && tsc -p tsconfig.watch.json -m esnext --outDir dist/esm --watch", + "build:watch": "npm run build:esm-cjs -- --watch", "build": "npm run clean && npm run build:esm-cjs && npm run build:umd", "clean": "npm run clean:size && rimraf lib-esm lib dist", "clean:size": "rimraf dual-publish-tmp tmp*", diff --git a/yarn.lock b/yarn.lock index 9be84512799..b41be18dbd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10740,6 +10740,11 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== + modify-values@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"