Skip to content

Keep a custom renderer's package files out of a parent .gitignore - #354

Merged
agorischek merged 3 commits into
mainfrom
agorischek-renderer-gitignore
Dec 4, 2026
Merged

agorischek merged 3 commits into
mainfrom
agorischek-renderer-gitignore

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

What changed

projections init --renderer custom declares the renderer's src/ and package.json as the definition's renderer sources, which projections read from Git. In the terraform-provider-aws trial (Refs githubnext/projections.trials#49), the repository's .gitignore ignores package.json. compare and sweep then failed with "Declared source …/renderer/package.json does not exist in working-tree", although the file was on disk. The scaffold's own .gitignore re-included only dist/.

It now also re-includes every file the scaffold writes, anchored to the package: package.json, tsconfig.json, vite.config.ts, playwright.config.ts, scenarios.json, src/** and browser/**. Each file is matched by name, so a parent pattern like *.tsx or src/ can't hide it either.

Evidence

  • cargo test -p projections-cli --test authoring init_adds_a_custom_renderer: passed. The existing "dist/ is committed even where ignored" check now uses a parent .gitignore that ignores dist/, package.json, tsconfig.json, *.ts, *.tsx, scenarios.json, src/ and browser/. It asserts with git check-ignore that no scaffolded file is ignored. With main's template it fails on renderer/package.json is ignored (checked).

  • npm run tools -- check --fast: passed (typecheck skipped as unbuilt; no TypeScript changed).

  • Documentation that this change affects is updated, and generated reference
    pages are regenerated (npm run docs:generate).

  • Fixes include a regression test.

  • A changelog fragment at changelog.d/<this PR's number>.md describes what
    users will notice, or the PR has the no changelog label (see
    changelog.d/README.md).

  • No credentials, private source or machine-specific paths are included.

agorischek and others added 2 commits December 4, 2026 09:34
projections init --renderer custom declares the renderer's src/ and
package.json as sources, which projections read from Git. In a repository
whose .gitignore ignores package.json (terraform-provider-aws), compare and
sweep failed with "Declared source .../renderer/package.json does not
exist in working-tree" though the file was on disk. The scaffold's
.gitignore re-included only dist/; it now re-includes every file the
scaffold writes.

Refs githubnext/projections.trials#49

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Refs githubnext/projections.trials#49

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes keeping custom renderer files visible to Git.

No open issues 🎉

What changed in this PR

Ensures custom renderer files remain visible to Git when parent ignore rules would otherwise hide sources needed by Projections.

Changes:

  • Adds package-local exceptions for renderer configuration, sources, and browser tests.
  • Expands regression coverage for conflicting parent ignore rules.
  • Documents the fix and migration steps for existing renderers.
File Description
packages/​cli/​tests/​authoring.rs Checks scaffolded files against conflicting parent ignore rules.
packages/​cli/​templates/​renderer/​gitignore Re-includes renderer package files and source directories.
changelog.d/​354.md Describes the fix and guidance for existing renderers.

Review effort: Balanced

@agorischek
agorischek merged commit aab35e8 into main Dec 4, 2026
60 of 62 checks passed
@agorischek
agorischek deleted the agorischek-renderer-gitignore branch December 4, 2026 11:38
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.

2 participants