Commit ed0cd5f
committed
chore(release): 0.12.1 — fix exports map so consumers get built JS (B-2026-05-22-1)
The 0.12.0 exports map had:
".": { "import": "./ts/index.ts", "default": "./js/index.js" }
When consumers do `import x from 'hds-lib'`, Node resolves the
`import` condition first → falls on the TS source under node_modules.
Node 24 refuses type-stripping for node_modules paths and crashes:
ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING:
Stripping types is currently unsupported for files under
node_modules, for "file:///app/node_modules/hds-lib/ts/index.ts"
This blocked bridge-mira (and any other Node-runtime consumer) from
deploying. Frontends were unaffected because Vite resolves the package
through its own bundler that doesn't honor the node-resolution-only
"import" condition.
Fix: remove the `"import": "./ts/index.ts"` line. The `default` (which
points at the built `./js/index.js`) now wins for both ESM-import and
CJS-require consumers. TypeScript projects continue to get `js/index.d.ts`
via the `types` condition. The explicit subpaths `./ts/*` and `./js/*`
stay (some consumers import specific files directly).
Verified: 513/513 unit tests pass.1 parent 6987e66 commit ed0cd5f
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
0 commit comments