Skip to content

chore(dist): untrack the gitignored dist/src byproducts - #135

Merged
c-vigo merged 1 commit into
devfrom
chore/134-untrack-dist-src
Aug 5, 2026
Merged

c-vigo merged 1 commit into
devfrom
chore/134-untrack-dist-src

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #134.

What

git rm -r --cached dist/src — 12 declaration byproducts stop being tracked. They stay on disk, stay gitignored (.gitignore line 51), and are regenerated by just bundle, as #70 intended.

Why

dist-check.yml and release-extension.yml both document, in their headers, that dist/src/ is gitignored and dist/index.js is the only tracked path under dist/ — which is what makes their tree-wide git status -- dist/ check "deterministic across checkout locations".

That invariant was false. The v0.3.0 finalize commit (1260b1d) re-added the byproducts via vig-os/devkit#1159, in which the release step walked a bare dist directory path and force-added every file it found without consulting .gitignore. devkit fixed that upstream — release-core.yml now derives its paths from git ls-files -co --exclude-standard — but the residue here was never cleaned up.

Each .d.ts.map embeds an absolute sourceRoot:

"sources":["file:///home/runner/work/commit-action/commit-action/src/retry.ts"]

So the check passed only because CI happens to rebuild at the same absolute path that was committed. Any other checkout location reported six modified files. That is what forced the hand-staging of dist/index.js in #132 — committing a locally built tree would have written developer-machine paths into the repo.

Verified

Assertion Result
git ls-files dist/ dist/index.js, dist/package.json only
just sync && just bundle then git status --porcelain -- dist/ empty on a developer machine — first time this has been true
release-core.yml DIST_PATHS (git ls-files -co --exclude-standard -- dist) dist/index.js,dist/package.json — non-empty, no-files guard still holds
prek run --all-files green

Both release gates get stronger, not weaker: dist-check.yml's git status --porcelain does not report untracked-and-ignored files, so it stays clean in CI and becomes honest everywhere else, and the finalize commit stops writing runner paths into every release tag.

Consumer impact

None. action.yml runs dist/index.js, which stays tracked. The .d.ts declarations are build byproducts with no runtime role.

Sequenced deliberately before the v0.3.2 release: deferring means the finalize commit re-commits the /home/runner paths into the v0.3.2 tag.

The TypeScript declaration byproducts under dist/src/ have been gitignored
since #70, but the v0.3.0 finalize commit re-added them (vig-os/devkit#1159:
the release step walked a bare `dist` path and force-added every file it
found without consulting .gitignore). devkit fixed that upstream; the
tracked residue survived here.

Each .d.ts.map embeds an absolute sourceRoot pointing at the CI runner's
checkout path, so a rebuild anywhere else reports six modified files. The
"deterministic across checkout locations" property that dist-check.yml and
release-extension.yml both document held only because CI happens to rebuild
at the same path that was committed.

Verified against the release gates: release-core.yml derives DIST_PATHS from
`git ls-files -co --exclude-standard -- dist`, which now yields exactly
dist/index.js,dist/package.json — non-empty, so its no-files guard still
holds and the finalize commit stops writing runner paths into each tag.
dist-check.yml's `git status --porcelain -- dist/` does not report
untracked-and-ignored files, so it stays clean in CI and becomes honest
everywhere else.

No consumer-visible change: action.yml runs dist/index.js, which stays
tracked. The declarations are build byproducts with no runtime role.

Refs: #134
@c-vigo
c-vigo merged commit bd96090 into dev Aug 5, 2026
15 checks passed
@c-vigo
c-vigo deleted the chore/134-untrack-dist-src branch August 5, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant