Repository navigation
build(dist): untrack dist/src byproducts and gate the whole dist/ tree - #73
Merged
Merged
Conversation
dist/ tracked 32 tsc/ncc declaration byproducts under dist/src/ alongside the one real artifact, dist/index.js. tsconfig.json sets outDir ./dist with declaration + declarationMap, so both `npm run build` and `npm run bundle` emit them, while the .gitignore rule meant to exclude them (dist/__tests__) never matched their actual path (dist/src/__tests__). Their .d.ts.map files embed absolute file:// source paths, so they were regenerated differently at every checkout location -- which is what forced the #59 freshness gate to be scoped to dist/index.js rather than dist/. Untrack them, replace the dead rule with `dist/*` plus a `!dist/index.js` re-admit, and broaden both gates to the whole tree. The gates now test with `git status --porcelain -- dist/` rather than `git diff`, so uncommitted build output fails them too, not only drift in the committed bundle. Refs: #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #70.
What
dist/tracked 32 declaration byproducts underdist/src/**alongside the one real artifact,dist/index.js. The.gitignorerule meant to exclude them —dist/__tests__— never matched their actual path,dist/src/__tests__.Root cause is broader than the issue assumed:
tsconfig.jsonsetsoutDir: ./distwithdeclaration+declarationMap, so bothnpm run build(tsc) andnpm run bundle(ncc) emit them. ncc's own output listsdist/src/commit.d.tsamong its assets — a plainjust bundleis enough to regenerate all 17 of them.Changes
git rm -r dist/src— untrack the byproducts..gitignore: deaddist/__tests__rule →dist/*+!dist/index.js, so only the runtime artifactaction.ymlexecutes is tracked, and anything the build drops intodist/is ignored by default.dist-check.yml,release-extension.yml) broadened fromdist/index.jsto the wholedist/tree — now possible because the location-dependent.d.ts.mapfiles (which embed absolutefile://paths, and which forced [FEATURE] Guarantee a fresh dist/ bundle on every tagged release (CI dist-check + release-extension verification) #59 to scope narrowly) are gone from the index.The gates now test
git status --porcelain -- dist/instead ofgit diff --exit-code. That is strictly stronger:git diffonly sees tracked files, so build output that ncc starts emitting and nobody commits would slip through.git statuscatches both drift and uncommitted artifacts.Verification
Simulated CI in a fresh clone of this branch (
npm ci→npm run bundle):dist/src/, and the gate is clean:git status --porcelain -- dist/is empty. This is the case that matters, since the gate rebuilds before checking.src/retry.tsand rebuilding yieldsM dist/index.js→ gate exits 1.git diffgate reported clean.just precommit(full suite) green.Refs: #70