Commit 72ddc75
committed
fix(build): handle multi-line import statements in fix-esm-imports
The existing regex `[^'"\n]*` excluded newlines, so imports that span
multiple lines — common after destructuring a dozen named exports
across visual formatting — silently kept their extension-less form.
Downstream ESM loaders reject those paths (Node, vitest) which broke
test runs and production startup on certain module entry points.
Widen the middle capture to `[\s\S]*?` (non-greedy, newline-aware)
while still anchoring to the start-of-line `import`/`export` keyword
and the trailing `from` + quote. The non-greedy quantifier prevents
cross-statement over-matching when multiple imports appear in the
same file.
Discovered via wilds-ai vitest run against @framers/agentos@0.2.0
npm artifact (cognitive_substrate/GMI.js line 17 referenced
'./IGMI' without .js). Four other dist files had the same shape.
A republish of the affected agentos version should include this fix
so downstream consumers don't need to patch node_modules locally.1 parent a2030ba commit 72ddc75
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
0 commit comments