Repository navigation
fix(init-workspace): durable consumer seam for repo-root ignores - #1100
Merged
Merged
Conversation
Add bats cases for the consumer-owned durable root-ignore file: .gitignore.project preserved on upgrade and appended to the regenerated .gitignore; the node fragment ignoring dist/src/ byproducts while keeping dist/index.js tracked; and the flake-hooks store-symlink seeding the .pre-commit-config.yaml ignore while a real committed file is not. Refs: #1092
Add .gitignore.project, a preserved consumer-owned file (mirroring justfile.project) whose contents render_gitignore appends to the regenerated root .gitignore after the per-language fragments — the only committed home git honors for repo-ROOT ignores, which the managed .gitignore otherwise drops on every upgrade. Also seed the .pre-commit-config.yaml ignore automatically when the flake-hooks opt-in installs it as a /nix/store symlink (gated strictly on the store-symlink condition, never for a hand-managed real file), and add a dist/src/ ignore to the node fragment for the tsc/ncc declaration byproducts while keeping the committed dist/index.js bundle tracked. The base .gitignore header and the flake.nix opt-in note now point at .gitignore.project instead of instructing an edit the upgrade destroys. .gitignore.project is banner-skip-listed since its contents are appended into the managed .gitignore. Refs: #1092
This was referenced Jul 15, 2026
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 #1092. Part of #1096.
Problem
The managed root
.gitignoreis fully overwritten on everyinstall.sh --force, and there was no committed place a consumer could put repo-root ignores that survives — git only honors a root ignore from the root.gitignore, which devkit regenerates. The file's own advice ("put repo-specific ignores in a committed file your team owns") had no valid form for root paths, andflake.nixeven instructed an edit to the managed.gitignorethat the next upgrade destroyed.Change
.gitignore.project(mirrorsjustfile.project): the durable, consumer-owned home for repo-root ignores.render_gitignore()appends its contents to the regenerated.gitignoreafter the per-language fragments, so they survive every upgrade. Added toPRESERVE_FILESand to_BANNER_SKIP(its content is inlined into the managed file, so it carries a hand-written header, not a preserved banner)..pre-commit-config.yamlignore when the flake-hooks opt-in makes it a/nix/storesymlink — gated strictly on the store-symlink condition, so a hand-managed committed file is never ignored.dist/src/(.d.ts/.d.ts.map) is ignored while the committed bundledist/index.js/dist/package.jsonstays tracked — no blanketdist/.flake.nix:68no longer tells the opt-in consumer to edit the managed.gitignore; it points at the auto-seed /.gitignore.project.Tests / verification
7 new bats cases in
tests/bats/init-workspace.bats(preserve, append, dist/src, store-symlink seed vs real-file no-seed). Fullprek run --all-filesgreen locally;init-workspace.bats184 ok / 0 fail.Merge note
Cut from and re-merged onto
dev(includes thechore: merge devcommit; conflict-free). Siblings #1093 and #1099 also touchCHANGELOG.md— whichever merges second/third will need a one-click "Update branch" (trivial changelog union).