Skip to content

feat(cli): self-ignore generated .lectio/ and dist/ dirs - #31

Merged
losolio merged 1 commit into
mainfrom
feat/self-ignore-generated
Jul 25, 2026
Merged

feat(cli): self-ignore generated .lectio/ and dist/ dirs#31
losolio merged 1 commit into
mainfrom
feat/self-ignore-generated

Conversation

@losolio

@losolio losolio commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

lectio build/dev leave .lectio/ and dist/ in the consumer's repo as
untracked noise. Rather than modify their root .gitignore, the CLI now writes
a self-ignoring .gitignore inside each generated dir:

# Generated by lectio — safe to delete
*

* ignores the whole directory (including the .gitignore itself), so the dirs
never show up in git status — and the CLI only ever writes inside directories
it owns. Delete a dir and its ignore goes with it; no stale root entry.

Verified

In a fresh git repo, lectio build produced .lectio/.gitignore and
dist/.gitignore, and git status stayed completely clean.

`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>
Copilot AI review requested due to automatic review settings July 25, 2026 19:02

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.

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 .gitignore into the collected-content output directory (config.output).
  • Write a self-ignoring .gitignore into 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.

@losolio
losolio merged commit 2cf619d into main Jul 25, 2026
2 checks passed
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