Skip to content

Commit 01ed9f6

Browse files
committed
refactor(dev): drop dev:cache:prune in favour of the existing dev:clean
`dev:cache:prune` duplicated `dev:clean`, which already existed in `apps/sim` and does strictly more (`rm -rf .next/dev/cache` covers the Turbopack cache plus the fetch and image caches). Two commands for one job is worse than one, and the docs pointed at the newer, narrower of the two. Removes it from both apps and gives `apps/docs` the `dev:clean` that `apps/sim` already had, so the recovery command is the same everywhere. `dev:cache:cap` stays — it is the chained step, used by more than one dev variant, and naming it keeps the relative script path out of each command. Verified `dev:clean` is a real remedy: corrupt a cache block, run it, restart — canvas serves 200 with no panic. Also corrects an overstatement. A damaged cache does not *always* abort Turbopack; whether it panics depends on whether the damaged region is read, so it is not reliably reproducible. Both notes now say "can abort" and give the same remedy either way.
1 parent 5d64a3e commit 01ed9f6

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "bun run dev:cache:cap && next dev --port 3001",
88
"dev:cache:cap": "bun run ../../scripts/prune-turbopack-cache.ts",
9-
"dev:cache:prune": "bun run ../../scripts/prune-turbopack-cache.ts --force",
9+
"dev:clean": "rm -rf .next/dev/cache",
1010
"build": "fumadocs-mdx && NODE_OPTIONS='--max-old-space-size=8192' next build",
1111
"start": "next start",
1212
"postinstall": "fumadocs-mdx",

apps/sim/next.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ const nextConfig: NextConfig = {
241241
*
242242
* The cache is unbounded on disk (an abandoned one reached 78 GB here), so
243243
* `scripts/prune-turbopack-cache.ts` is chained into every `dev` script to cap it.
244-
* A *corrupted* cache is a hard Turbopack panic, not a silent fallback —
245-
* `bun run dev:cache:prune` and restart is the fix.
244+
* A *corrupted* cache can abort Turbopack outright ("Cache corruption
245+
* detected: checksum mismatch") rather than falling back — it depends whether
246+
* the damaged region is read. `bun run dev:clean` and restart is the fix.
246247
*
247248
* If you re-measure any of this: `next dev` compiles routes on demand, so
248249
* startup time means nothing — time the first request to a route, restart the

apps/sim/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"dev:minimal": "bun run dev:cache:cap && SIM_DEV_MINIMAL_REGISTRY=1 next dev --port 3000",
1313
"dev:capped": "bun run dev:cache:cap && NODE_OPTIONS='--max-old-space-size=4096' next dev --port 3000",
1414
"dev:cache:cap": "bun run ../../scripts/prune-turbopack-cache.ts",
15-
"dev:cache:prune": "bun run ../../scripts/prune-turbopack-cache.ts --force",
1615
"dev:clean": "rm -rf .next/dev/cache",
1716
"dev:webpack": "next dev --webpack",
1817
"load:workflow": "bun run load:workflow:baseline",

0 commit comments

Comments
 (0)