feat(cli): require --env-path instead of auto-loading .env.local#3098
Open
jorgemoya wants to merge 4 commits into
Open
feat(cli): require --env-path instead of auto-loading .env.local#3098jorgemoya wants to merge 4 commits into
jorgemoya wants to merge 4 commits into
Conversation
The CLI auto-loaded .env.local from cwd but not .env, an inconsistent bit of magic that surprised users. Drop automatic env-file loading entirely: env files are now loaded only when passed explicitly via --env-path. This removes the .env vs .env.local asymmetry and makes env resolution explicit and predictable. Help text is updated to match. BREAKING: users who relied on auto-loaded .env.local must now pass --env-path .env.local (or the appropriate path). Refs LTRAC-1091 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: c5823d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Bundle Size ReportComparing against baseline from No bundle size changes detected. |
Contributor
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
The changeset body was hard-wrapped mid-paragraph, which rendered as pre-split lines in the changelog. Put each paragraph on a single line to match the repo's changeset style. Refs LTRAC-1091 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The top-level description restated that env files aren't auto-loaded, which is already covered by the --env-path option help. Keep the (now accurate) configuration-priority line and let --env-path document the behavior. Refs LTRAC-1091 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Instead of removing env-file auto-loading globally, restrict it to the only commands that need storefront env vars: `build` and `deploy`. Both now auto-load `.env.local` then `.env` from the current directory (`.env.local` wins; neither overrides the real environment), or an explicit `--env-path`. The global `--env-path` option is removed so no other command is affected by on-disk env files. The env is loaded before the build runs so the build child process (and any pre-build checks) can see the variables. Adds a shared `loadBuildEnv` helper and moves `--env-path` to a per-command option via `envPathOption`. Refs LTRAC-1091 Co-Authored-By: Claude Opus 4.8 (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.
Linear: LTRAC-1091
What/Why?
The CLI auto-loaded
.env.localfrom cwd but not.env, an inconsistent bit of magic that surprised users. Per sign-off, this drops automatic env-file loading entirely: env files are now loaded only when passed explicitly via--env-path. This removes the.envvs.env.localasymmetry and makes env resolution explicit and predictable. Help text is updated to match.Testing
index.spec.ts(7 tests) covers no-auto-load without--env-pathand correct loading with--env-path.typecheckandlintpass.Migration
Breaking behavior change. Users who relied on the auto-loaded
.env.localmust now pass it explicitly:(or the appropriate path, e.g.
--env-path ./core/.env.local).