Commit 9d885fa
authored
fix: resolve @babel/traverse CJS/ESM interop for native .mts execution (#590)
* fix: resolve @babel/traverse CJS/ESM interop for native .mts execution
Node's ESM loader wraps CJS modules so the default export is a namespace
object, not the function itself. Extract `.default` at runtime with a
cast to satisfy TypeScript. Also bump .node-version to 25.9.0.
* fix: use consistent @babel/traverse CJS/ESM interop pattern
Apply the same runtime-safe interop resolution in both generate-sdk.mts
and bundle-validation.test.mts. The typeof check handles both Vitest
(where the import may already be the function) and native Node ESM
(where it's wrapped under .default).
* refactor: simplify traverse interop to nullish coalescing1 parent 7939e74 commit 9d885fa
3 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments