feat(cli): self-ignore generated .lectio/ and dist/ dirs - #31
Merged
Conversation
`lectio` now writes a `.gitignore` (`*`) inside each generated directory, so `.lectio/` and `dist/` stay out of the consumer's `git status` without the CLI ever touching their root `.gitignore`. Delete the dir and its ignore goes with it — no stale root entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the lectio CLI to keep generated output directories from appearing as untracked files in consumer repositories by writing a self-ignoring .gitignore into generated directories instead of requiring users to edit their root .gitignore.
Changes:
- Write a self-ignoring
.gitignoreinto the collected-content output directory (config.output). - Write a self-ignoring
.gitignoreinto the build output directory (dist/). - Add a changeset documenting the behavior change.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/site-builder/bin/lectio.mjs | Writes self-ignoring .gitignore files into generated output directories. |
| .changeset/self-ignore-generated.md | Documents the new self-ignore behavior as a patch changeset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
lectio build/devleave.lectio/anddist/in the consumer's repo asuntracked noise. Rather than modify their root
.gitignore, the CLI now writesa self-ignoring
.gitignoreinside each generated dir:*ignores the whole directory (including the.gitignoreitself), so the dirsnever show up in
git status— and the CLI only ever writes inside directoriesit owns. Delete a dir and its ignore goes with it; no stale root entry.
Verified
In a fresh git repo,
lectio buildproduced.lectio/.gitignoreanddist/.gitignore, andgit statusstayed completely clean.