Skip to content

Commit 97e6d36

Browse files
authoredMar 21, 2025··
[🔥AUDIT🔥] Update 'cleanup' script to remove _all_ node_modules folders (#1137)
🖍 _This is an audit!_ 🖍 ## Summary: I am blocked from landing #1123 because the `clean` step does not remove all `node_modules` directories. We use the `preactjs/compressed-size-action` to check build size changes in each PR. This action switches to the upstream branch after building on the PR branch. It then issues a 'clean' command (which we defined in our `package.json`). Finally, it installs packages and builds on the upstream branch. When a PR (#1123) switches package managers and leaves some `node_modules` folders in place after cleaning we have issues. In this case`yarn` ttempts to install over a `./node_modules` that was set up by `pnpm`, and [fails](https://github.com/Khan/wonder-stuff/actions/runs/13980489827/job/39144501346?pr=1123) (see screenshot below): <img width="1196" alt="image" src="https://github.com/user-attachments/assets/e47dd396-deb8-4a88-8a3c-6eec23f9d369" /> Issue: --none-- ## Test plan: I ran the following steps which simulate what's happening in the Check Builds step of PR #1123: 1. `git co jer/pnpm` 2. `find . -name node_modules -prune -exec rm -rf {} \;` # make sure _all_ node_modules are deleted 3. `pnpm install` 4. `git co jer/fix-cleanup` 5. `pnpm clean` # yes, using `pnpm` as that's how the `preactjs/compressed-size-action` does it 6. `yarn install` # this is the step that fails in the GitHub Action Success. Author: jeremywiebe Auditors: somewhatabstract Required Reviewers: Approved By: somewhatabstract Checks: ✅ 14 checks were successful, ⏭️ 3 checks have been skipped Pull Request URL: #1137
1 parent 74896c9 commit 97e6d36

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎.changeset/green-months-compare.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"build:types": "yarn tsc --build --verbose tsconfig-build.json && ./build-settings/check-type-definitions.ts",
8787
"build:docs": "typedoc",
8888
"watch": "yarn rollup --watch",
89-
"clean": "rm -rf packages/wonder-stuff-*/dist && rm -rf packages/wonder-stuff-*/node_modules && rm -f packages/*/*.tsbuildinfo",
89+
"clean": "rm -rf packages/wonder-stuff-*/dist && rm -rf node_modules && rm -rf packages/*/node_modules && rm -f packages/*/*.tsbuildinfo",
9090
"coverage": "yarn run jest --coverage",
9191
"format": "prettier --write .",
9292
"lint": "yarn lint:ci .",

0 commit comments

Comments
 (0)
Please sign in to comment.