Skip to content

fix(init): stop un-ignoring .env.example in scaffolded projects - #759

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
karthickeyan-dev:fix/init-gitignore-env-example
Nov 9, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
karthickeyan-dev:fix/init-gitignore-env-example

Conversation

@karthickeyan-dev

Copy link
Copy Markdown
Contributor

Closes #757

Problem

void init writes !.env.example to .gitignore, but since #311 Void refuses to start when that file exists. New projects were being told to commit a file that stops dev and build.

Changes

  • Remove !.env.example from SCAFFOLD_GITIGNORE_LINES, so .env.* now ignores it.
  • When .env.example is one of the reported files, the dev/build error and void env check now add: "env.ts lists the keys this app expects, so .env.example is not needed." Other legacy files such as .env.local get the same message as before.
  • Update the init unit test and the packed-consumer assertion that expected the file to stay un-ignored, and add coverage for the new message on both paths.

Existing projects are unaffected: void init only appends missing .gitignore lines, so a line already there stays.

Verification

  • vp run check, format and lint pass.
  • vp test run: passes. The first run had failures from a missing Playwright browser and stale playground builds, plus one port conflict; after installing Chromium and running vp run build:all, all 33 of those files passed when rerun.
  • .github/scripts/packed-consumer.mjs was not run locally, so CI will be the first run of that assertion.

Note

Both errors tell users to "follow the env migration guide", but no guide with that name exists in docs/. That wording predates this PR and is left unchanged.

🤖 Generated with Claude Code

Void refuses to start when .env.example exists, so the scaffolded
.gitignore should not allow committing it. Mention env.ts in the error
for anyone adding the file out of habit.

Closes voidzero-dev#757

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@karthickeyan-dev
karthickeyan-dev requested a review from a team as a code owner November 9, 2026 09:13

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@cpojer
cpojer merged commit 655a0d9 into voidzero-dev:main Nov 9, 2026
2 checks passed
@karthickeyan-dev
karthickeyan-dev deleted the fix/init-gitignore-env-example branch November 9, 2026 15:25
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.

void init .gitignore still allows .env.example, which stops Void from starting

2 participants