Commit ab8e203
fix(auto-update): break cache.ts<->checker.ts circular import (cold-graph crash)
CI failed (Check plugin, 10/10 auto-update-checker tests) with:
SyntaxError: Export named 'isValidSemver' not found in module '.../cache.ts'
Root cause: a circular import introduced in b137074 when semver validation was
added — checker.ts imported isValidSemver from cache.ts, while cache.ts already
imported getCurrentRuntimePackageJsonPath from checker.ts. On a cold module
graph (fresh CI install) the cycle breaks static export resolution, so the whole
checker.test.ts file fails to load — including pure tests like extractChannel().
A warm local bun module cache tolerated the cycle, which is why it passed
locally and only surfaced in CI (and would equally bite a fresh user install).
Fix: move the pure leaf isValidSemver into its own dependency-free module
(auto-update-checker/semver.ts). checker.ts now imports it from there and no
longer imports cache.ts at all, breaking the cycle. cache.ts keeps using it via
the new leaf import.
Reproduced CI's condition locally (cold BUN_INSTALL_CACHE_DIR) — fails before,
10/10 pass after. plugin 1888/0, tsc + biome clean.
Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>1 parent a16f6a6 commit ab8e203
3 files changed
Lines changed: 20 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 187 | | |
200 | 188 | | |
201 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| 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 | + | |
0 commit comments