Skip to content

Commit 2a2a12f

Browse files
lobsterkatieAbhiPrasad
authored andcommitted
ref(dev): Split up top-level yarn clean script (#5095)
This splits the repo-level `yarn clean` command, which currently leaves the repo in a broken state (build artifacts deleted, and unable to be rebuilt because package-level `node_modules` folders - though not the top `node_modules` folder - have also been deleted), into a number of new, more focused commands. In the `clean:deps` command, it now deletes _all_ `node_modules` folders (repo- and package-level) and reinstalls dependencies, so that the repo is no longer broken after running it. The new commands: ``` // Meant to be a useful default for day-to-day use "clean": "run-p clean:build clean:caches" // Runs all package-level clean commands, which delete build and testing artifacts "clean:build": "lerna run --parallel clean" // TODO: Are there other caches we should add here? "clean:caches": "yarn rimraf eslintcache && yarn jest --clearCache" // Nuke all node modules and reinstall dependencies "clean:deps": "lerna clean --yes && rm -rf node_modules && yarn" // insert "Clean all the things!" meme here "clean:all": "run-p clean:build clean:caches clean:deps" ```
1 parent 3cda0f8 commit 2a2a12f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"build:types:watch": "ts-node scripts/build-types-watch.ts",
1313
"build:npm": "lerna run --parallel build:npm",
1414
"circularDepCheck": "lerna run --parallel circularDepCheck",
15-
"clean": "lerna run --parallel clean && lerna clean --yes && yarn rimraf eslintcache",
15+
"clean": "run-p clean:build clean:caches",
16+
"clean:build": "lerna run --parallel clean",
17+
"clean:caches": "yarn rimraf eslintcache && yarn jest --clearCache",
18+
"clean:deps": "lerna clean --yes && rm -rf node_modules && yarn",
19+
"clean:all": "run-p clean:build clean:caches clean:deps",
1620
"codecov": "codecov",
1721
"fix": "lerna run --parallel fix",
1822
"link:yarn": "lerna exec --parallel yarn link",

0 commit comments

Comments
 (0)