Skip to content

feat(env): simplify local and production configuration - #311

Closed
TheAlexLichter wants to merge 3 commits into
mainfrom
feat/simplify-env-secrets
Closed

TheAlexLichter wants to merge 3 commits into
mainfrom
feat/simplify-env-secrets

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

Simplifies environment handling by making .env the only local development source and moving production configuration to remote secrets.

  • Removes .env.example generation and the .secret()/.public() schema modifiers
  • Updates deploy validation to reject server environment keys baked into plaintext Worker variables while allowing client VITE_* values from build inputs or schema defaults.
  • Improves schema consistency across Vite, runtime, CLI, and HMR by using shared environment helpers and a process global registry.
  • Refreshes CLI guidance, documentation, playground configuration, and relevant tests to reflect the new environment model.

@TheAlexLichter
TheAlexLichter force-pushed the feat/simplify-env-secrets branch 2 times, most recently from daee572 to 0842f6f Compare September 14, 2026 08:27
@TheAlexLichter
TheAlexLichter force-pushed the feat/simplify-env-secrets branch from 0842f6f to 95cc099 Compare September 15, 2026 14:30
@TheAlexLichter
TheAlexLichter marked this pull request as ready for review September 15, 2026 20:52
@cpojer

cpojer commented Sep 16, 2026

Copy link
Copy Markdown
Member

Thanks, I'm rebasing on main and cherry-picking.

@cpojer cpojer closed this Sep 16, 2026
@TheAlexLichter
TheAlexLichter deleted the feat/simplify-env-secrets branch September 16, 2026 06:53
cpojer pushed a commit that referenced this pull request Nov 9, 2026
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](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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