Commit 235b94a
#5387 taught doctor to READ serve's `.env*` cascade but applied the overlay to
one reader only — the env-derived checks. `loadConfig()` stayed outside it, so
both commands still bundled the user's config under two different environments:
a config reading `process.env` at top level saw different values, and a config
that throws on a missing value landed in the wide config-analysis `catch` and
printed "Could not load config for analysis" — #5382's misattribution surviving
in the one path #5387 deliberately left alone — while `os serve` booted the
same directory.
`loadConfig()` now runs under the same `dotenvReading` resolved once at the top
of `run()`. A new `withDotenvOverlayAsync` is required rather than cosmetic: a
config's top level runs inside `bundleRequire`'s dynamic `import()`, so the
synchronous wrapper's `finally` fires while the promise is still pending —
overlay applied, then removed before anything reads it. Both wrappers share one
apply/revert (dotenv-flow's own `unload()` test), so the policy is not restated.
Config-check verdicts that change are the fix, not a side effect: a config that
previously failed to load now loads and its checks RUN, so warnings never
printed before can appear. A genuinely broken config still warns — the fix must
not be a silencer. `environmentSourcesCheck` remains the single place reporting
the cascade and now states that these files also reach the config load; sources
only, never values, which matters more now that the overlay carries whatever
keys the config chose rather than a declared subset.
Claude-Session: https://claude.ai/code/session_01VkPSGsX9o17MsGv3Lbxu2w
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 98369a8 commit 235b94a
3 files changed
Lines changed: 544 additions & 12 deletions
File tree
- .changeset
- packages/cli/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
0 commit comments