make build-theme never cleans, so artifacts from a previous build can leak into the bundle
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, playwright, typescript
- Domain
- build-system, testing-qa
Research direction
Start with the Makefile build-theme target and inspect the npm run clean script, which removes rimraf public/build build api. Add the clean step before the existing deployment cleanup, then build two theme revisions and compare their rendered output using the workflow documented in tests/visual/README.md and configured by playwright.config.ts.
Written by the indexing model from the issue text.
Description
The build-theme target removes only .deploy/<theme> before building. It then runs npm run prod:build, and neither the target nor that script runs npm run clean (rimraf public/build build api), so whatever build/ and public/build already contain survives the build — and Makefile lines 21-22 copy both directories wholesale into the bundle.
| Step | What it clears |
|---|---|
rm -rf .deploy/$(THEME) |
the deploy directory only |
npm run prod:build |
nothing — prod:copy, build:thebe, build:css, remix build, relative-css-asset-urls.mjs |
cp -r public / cp -r build |
copies both into the bundle, stale files included |
The consequence that matters is for A/B comparisons: building one revision, then another, and diffing the rendered output. This was hit while working on #225, where a bundle intended as the "baseline" rendered as the candidate instead, and npm run clean before building fixed it. I have verified the missing clean step and the wholesale copy above; I have not reproduced the exact file that leaked, so I would not want the issue to assert a precise mechanism beyond that. A plain single build is generally fine in practice, since remix build rewrites its own entry bundle each time — the hazard is stale other files and anything that compares two revisions.
That pattern is not exotic here: tests/visual/README.md and playwright.config.ts both document diffing one theme build against another as the way to validate a visual change, and THEME_TEMPLATE exists precisely to support it. So the trap sits directly in a documented workflow, and it fails silently — the comparison produces a plausible-looking result rather than an error.
Suggested fix
Add the clean to the target, so the documented workflow is safe by default:
build-theme: check
npm run clean
rm -rf .deploy/$(THEME)
Failing that, a note in tests/visual/README.md's "To diff one theme build against another" recipe and in CONTRIBUTING.md would at least make it discoverable. The target is already slow enough that a rimraf of three directories is not a meaningful cost.
🤖 Generated with Claude Code
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 56
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantEcon/quantecon-theme.mystmd
-
good first issue low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
broken-links
Difficulty 1/5 Under an hour Newbie friendliness 90/100
QuantEcon/quantecon-theme.mystmd#160 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in QuantEcon/quantecon-theme.mystmd
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100