Skip to content

fix(init-workspace): durable consumer seam for repo-root ignores - #1100

Merged
c-vigo merged 4 commits into
devfrom
bugfix/1092-gitignore-consumer-seam
Jul 15, 2026
Merged

c-vigo merged 4 commits into
devfrom
bugfix/1092-gitignore-consumer-seam

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes #1092. Part of #1096.

Problem

The managed root .gitignore is fully overwritten on every install.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, and flake.nix even instructed an edit to the managed .gitignore that the next upgrade destroyed.

Change

  • New preserved .gitignore.project (mirrors justfile.project): the durable, consumer-owned home for repo-root ignores. render_gitignore() appends its contents to the regenerated .gitignore after the per-language fragments, so they survive every upgrade. Added to PRESERVE_FILES and to _BANNER_SKIP (its content is inlined into the managed file, so it carries a hand-written header, not a preserved banner).
  • Auto-seed the .pre-commit-config.yaml ignore when the flake-hooks opt-in makes it a /nix/store symlink — gated strictly on the store-symlink condition, so a hand-managed committed file is never ignored.
  • Node byproducts: dist/src/ (.d.ts/.d.ts.map) is ignored while the committed bundle dist/index.js/dist/package.json stays tracked — no blanket dist/.
  • flake.nix:68 no 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). Full prek run --all-files green locally; init-workspace.bats 184 ok / 0 fail.

Merge note

Cut from and re-merged onto dev (includes the chore: merge dev commit; conflict-free). Siblings #1093 and #1099 also touch CHANGELOG.md — whichever merges second/third will need a one-click "Update branch" (trivial changelog union).

c-vigo added 4 commits July 15, 2026 09:39
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
@c-vigo c-vigo added bug Something isn't working priority:high Should be done in the current milestone area:workspace Workspace tooling, justfile, templates labels Jul 15, 2026
@c-vigo
c-vigo merged commit 9a3aa17 into dev Jul 15, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1092-gitignore-consumer-seam branch July 15, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Workspace tooling, justfile, templates bug Something isn't working priority:high Should be done in the current milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant