Skip to content

feat(gitignore): Auto-manage cache directory in .gitignore#10

Merged
fbosch merged 1 commit into
masterfrom
feature/init-update-gitignore
Feb 1, 2026
Merged

feat(gitignore): Auto-manage cache directory in .gitignore#10
fbosch merged 1 commit into
masterfrom
feature/init-update-gitignore

Conversation

@fbosch
Copy link
Copy Markdown
Owner

@fbosch fbosch commented Feb 1, 2026

Summary

Automatically add cache directory to .gitignore during init and add operations.

Changes

  • New gitignore module with entry detection and writing
  • Updated add and init commands to prompt for gitignore inclusion
  • Enhanced CLI output to report gitignore updates

Copilot AI review requested due to automatic review settings February 1, 2026 14:25
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 1, 2026

Open in StackBlitz

npx https://pkg.pr.new/fbosch/docs-cache@10

commit: ab5bf3b

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds automatic management of the cache directory in .gitignore during initialization and when adding sources to a new configuration. The implementation includes a new gitignore module for detecting and writing entries, prompts in the init and add commands, and enhanced CLI output.

Changes:

  • New gitignore module with entry normalization, detection, and writing functionality
  • Init command prompts users to add cache directory to .gitignore (skipped if entry already exists)
  • Add command automatically updates .gitignore when creating a new config file
  • CLI output reports when .gitignore is updated

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/gitignore.ts New module implementing gitignore entry detection and writing with normalization logic
src/init.ts Integrated gitignore status checking and prompting, added return fields for gitignore updates
src/add.ts Added automatic gitignore updates when initializing new config, tracks whether config previously existed
src/cli/index.ts Added output messages to report gitignore updates for both init and add commands
tests/init.test.js Updated test stubs and added tests for gitignore writing and prompt skipping
tests/cli-add.test.js Added test to verify gitignore is written when add command creates new config
.gitignore Removed duplicate .docs entries and replaced with single .docs/ entry
AGENTS.md Added testing expectations section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fbosch fbosch merged commit 851f313 into master Feb 1, 2026
11 checks passed
@fbosch fbosch deleted the feature/init-update-gitignore branch February 1, 2026 14:30
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