[PR #220] [MERGED] feat: add /dist/ to .gitignore during vinext init #396

Closed
opened 2026-05-06 12:39:36 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/220
Author: @vikas5914
Created: 3/1/2026
Status: Merged
Merged: 3/3/2026
Merged by: @southpolesteve

Base: mainHead: feat/init-gitignore


📝 Commits (2)

  • f5fb22e feat: add /dist/ to .gitignore during vinext init
  • 3588cc3 fix: broaden .gitignore duplicate check to cover dist/ and dist variants

📊 Changes

2 files changed (+152 additions, -2 deletions)

View changed files

📝 packages/vinext/src/init.ts (+40 -2)
📝 tests/init.test.ts (+112 -0)

📄 Description

Summary

  • vinext init now adds /dist/ to .gitignore (Step 6 in the init flow)
  • Creates .gitignore if it doesn't exist, appends the entry if missing, skips if already present
  • Preserves all existing .gitignore entries

Changes

  • packages/vinext/src/init.ts: Added updateGitignore() function, wired into init() as Step 6, added updatedGitignore to InitResult, added summary log line
  • tests/init.test.ts: Added 8 new tests — 5 unit tests for updateGitignore() and 3 integration tests for the full init flow

Why

vite build outputs to /dist/ by default. Without this entry in .gitignore, users who run vinext init and then build will end up with build artifacts tracked in git.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/220 **Author:** [@vikas5914](https://github.com/vikas5914) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/3/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `feat/init-gitignore` --- ### 📝 Commits (2) - [`f5fb22e`](https://github.com/cloudflare/vinext/commit/f5fb22e6e483fe2a9f138ea40c43f314b89fb619) feat: add /dist/ to .gitignore during vinext init - [`3588cc3`](https://github.com/cloudflare/vinext/commit/3588cc35aeb2be0f6c778eb53524ffd71f1d8429) fix: broaden .gitignore duplicate check to cover dist/ and dist variants ### 📊 Changes **2 files changed** (+152 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/init.ts` (+40 -2) 📝 `tests/init.test.ts` (+112 -0) </details> ### 📄 Description ## Summary - `vinext init` now adds `/dist/` to `.gitignore` (Step 6 in the init flow) - Creates `.gitignore` if it doesn't exist, appends the entry if missing, skips if already present - Preserves all existing `.gitignore` entries ## Changes - **`packages/vinext/src/init.ts`**: Added `updateGitignore()` function, wired into `init()` as Step 6, added `updatedGitignore` to `InitResult`, added summary log line - **`tests/init.test.ts`**: Added 8 new tests — 5 unit tests for `updateGitignore()` and 3 integration tests for the full `init` flow ## Why `vite build` outputs to `/dist/` by default. Without this entry in `.gitignore`, users who run `vinext init` and then build will end up with build artifacts tracked in git. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:36 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#396
No description provided.