Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 5034354

Browse files
committed
Support lerna commands with clean/build scripts
The top-level package defined clean and build scripts that were expected to run the (surprise!) clean and build steps of each package. However, most packages named their build step 'tsc' instead of 'build', and virtually none of them had 'clean' as a separate step.
1 parent 77110a1 commit 5034354

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

packages/datafile-manager/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@
5555
"@react-native-community/async-storage": "^1.2.0"
5656
},
5757
"scripts": {
58+
"clean": "rm -rf lib",
5859
"lint": "tsc --noEmit && eslint --fix 'src/**/*.ts' '__test__/**/*.ts'",
5960
"test": "jest",
6061
"posttest": "npm run lint",
61-
"tsc": "rm -rf lib && tsc",
62-
"prepare": "npm run tsc",
62+
"prebuild": "npm run clean",
63+
"build": "tsc",
64+
"prepare": "npm run build",
6365
"prepublishOnly": "npm test"
6466
}
6567
}

packages/event-processor/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"package.json"
2020
],
2121
"scripts": {
22-
"tsc": "rm -rf lib && tsc",
22+
"clean": "rm -rf lib",
23+
"prebuild": "npm run clean",
24+
"build": "tsc",
2325
"test": "jest",
24-
"prepare": "npm run tsc",
26+
"prepare": "npm run build",
2527
"prepublishOnly": "npm test"
2628
},
2729
"repository": {

packages/logging/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"package.json"
2020
],
2121
"scripts": {
22-
"tsc": "rm -rf lib && tsc",
22+
"clean": "rm -rf lib",
23+
"prebuild": "npm run clean",
24+
"build": "tsc",
2325
"test": "jest",
24-
"prepare": "npm run tsc",
26+
"prepare": "npm run build",
2527
"prepublishOnly": "npm test"
2628
},
2729
"repository": {

packages/optimizely-sdk/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
"react-native": "dist/optimizely.react_native.min.js",
99
"typings": "lib/index.d.ts",
1010
"scripts": {
11+
"clean": "rm -rf dist",
1112
"lint": "eslint 'lib/**/*.js'",
1213
"test": "mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js --recursive --exit --require esm --require lib/tests/exit_on_unhandled_rejection.js",
1314
"test-ci": "npm run test-xbrowser && npm run test-umdbrowser",
1415
"test-xbrowser": "karma start karma.bs.conf.js --single-run",
1516
"test-umdbrowser": "npm run build-browser-umd && karma start karma.umd.conf.js --single-run",
1617
"build-browser-umd": "rollup -c --environment BUILD_UMD_BUNDLE",
17-
"build": "rm -rf dist && rollup -c --environment BUILD_ALL",
18+
"prebuild": "npm run clean",
19+
"build": "rollup -c --environment BUILD_ALL",
1820
"cover": "istanbul cover _mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js",
1921
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls",
2022
"prepare": "npm run build",

packages/utils/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"package.json"
2020
],
2121
"scripts": {
22-
"tsc": "rm -rf lib && tsc",
22+
"clean": "rm -rf lib",
23+
"prebuild": "npm run clean",
24+
"build": "tsc",
2325
"test": "jest",
24-
"prepare": "npm run tsc",
26+
"prepare": "npm run build",
2527
"prepublishOnly": "npm test"
2628
},
2729
"repository": {

0 commit comments

Comments
 (0)