Repository navigation
Keep a custom renderer's package files out of a parent .gitignore - #354
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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
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.
What changed
projections init --renderer customdeclares the renderer'ssrc/andpackage.jsonas the definition's renderer sources, which projections read from Git. In the terraform-provider-aws trial (Refs githubnext/projections.trials#49), the repository's.gitignoreignorespackage.json.compareandsweepthen failed with "Declared source …/renderer/package.json does not exist in working-tree", although the file was on disk. The scaffold's own.gitignorere-included onlydist/.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/**andbrowser/**. Each file is matched by name, so a parent pattern like*.tsxorsrc/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.gitignorethat ignoresdist/,package.json,tsconfig.json,*.ts,*.tsx,scenarios.json,src/andbrowser/. It asserts withgit check-ignorethat no scaffolded file is ignored. Withmain's template it fails onrenderer/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>.mddescribes whatusers will notice, or the PR has the
no changeloglabel (seechangelog.d/README.md).
No credentials, private source or machine-specific paths are included.