fix: env vars - #44
Merged
Merged
Conversation
…placeholders
Older scaffolded projects have a plain .env.example without {{TOKEN}}
placeholders. The wizard now silently falls back to the built-in template
instead of throwing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The wizard substitutes these placeholders when writing .env. Old projects with plain KEY=value format now silently fall back to the built-in template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
writeEnv now handles both formats: {{TOKEN}} placeholders (substituted
as before) and plain KEY=value lines (parsed and replaced for known keys).
Comments, blank lines, and unknown keys are preserved. Falls back to the
built-in template when no .env.example exists.
The scaffolded .env.example uses plain format — readable as-is for manual
copy, and the wizard fills in values automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests for plain KEY=value format: all known keys replaced, comments and
blank lines preserved, empty values produce KEY= lines. Existing {{TOKEN}}
format tests unchanged.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
writeEnvnow supports both.env.exampleformats:{{TOKEN}}placeholders (substituted as before) and plainKEY=valuelines (parsed and replaced for known keys). Comments, blank lines, and unknown keys are preserved..env.exampleexists — no more crash on older scaffolded projects..env.exampletemplate uses plainKEY=valueformat — readable as-is for manual copy, and the wizard fills in values automatically.Test plan
yarn transferwizard completes the env-setup path on a project with a plainKEY=value.env.exampleyarn transferwizard completes on a project with no.env.example(built-in template)yarn transferwizard completes on a project with a{{TOKEN}}.env.exampleyarn full— all tests pass🤖 Generated with Claude Code