feat: add /dist/ to .gitignore during vinext init#220
feat: add /dist/ to .gitignore during vinext init#220vikas5914 wants to merge 2 commits intocloudflare:mainfrom
Conversation
vinext build outputs to /dist/ which should not be committed. The init command now ensures /dist/ is in .gitignore, creating the file if needed and skipping if the entry already exists.
|
/bigbonk review this PR |
commit: |
|
Review posted. Here's a summary of my feedback: Main concern: The duplicate detection only checks for the exact string Minor notes:
Otherwise the PR is clean: the function handles file creation, appending, no-trailing-newline, and idempotency correctly. Tests are comprehensive with both unit and integration coverage, and all 54 tests pass. |
Address review feedback: detect dist/ (no leading slash) and bare dist as existing coverage for the dist directory to avoid adding a redundant /dist/ entry. Rename entry -> exactEntry for clarity.
|
@southpolesteve updated RR with changes from bigbonk. |
Summary
vinext initnow adds/dist/to.gitignore(Step 6 in the init flow).gitignoreif it doesn't exist, appends the entry if missing, skips if already present.gitignoreentriesChanges
packages/vinext/src/init.ts: AddedupdateGitignore()function, wired intoinit()as Step 6, addedupdatedGitignoretoInitResult, added summary log linetests/init.test.ts: Added 8 new tests — 5 unit tests forupdateGitignore()and 3 integration tests for the fullinitflowWhy
vite buildoutputs to/dist/by default. Without this entry in.gitignore, users who runvinext initand then build will end up with build artifacts tracked in git.