chore: remove rimraf#11913
Conversation
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
Can you explain why premove is a better dependency than rimraf? |
|
sorry, the info is in the related issue rimraf is ~3MB for what's basically a we can use |
Since we're only using Also baring in mind that |
and this is how we end up with bloated dependency trees. this stuff matters, even dev dependencies. if you can avoid pulling in 3MB of bloat to do something as simple as an im looking at the wider picture here, far beyond this repo. if we stop using it here, and every other significant repo, we've saved the world from petabytes worth of dead code. you can see my efforts of this on e18e.dev (the community i run which focuses on this). premove is very much maintained. it genuinely hasn't needed changing in 5 years is all, and that is fine i think. |
petebacondarwin
left a comment
There was a problem hiding this comment.
The only uses of premove appear to be in package.json scripts where we want to clean up directories. Let's just write a tiny node.js script that does this with native APIs and then avoid this dependency too!
|
that makes sense to me too 👍 i'll rework it soon |
|
Would you like me to do it? |
|
sure if you have time! i am stretched across a lot of things right now so it'd probably take me longer |
Part of cloudflare#11854. Summary of changes: - `jest-image-snapshot` dropped `rimraf` in 6.5.x. Updating means we can stop pulling it in across the board - miniflare now uses `premove` - pages-shared didn't use `rimraf`, so it has been removed - workers-shared didn't use `rimraf`, so it has been removed - workflows-shared now uses `premove` This means `rimraf` is totally gone: ```sh > pnpm why -r rimraf (blank) ```
|
On it. |
Create a simple cross-platform TypeScript utility in tools/clean/ that uses Node.js's built-in fs.rmSync with recursive and force options. This removes the premove dependency from wrangler, miniflare, and workflows-shared packages.
89849dd to
260d236
Compare
Part of #11854.
Summary of changes:
jest-image-snapshotdroppedrimrafin 6.5.x. Updating means we canstop pulling it in across the board
premoverimraf, so it has been removedrimraf, so it has been removedpremoveThis means
rimrafis totally gone:> pnpm why -r rimraf (blank)