The published package.json declares:
"module": "dist/widgets.m.js",
"typings": "dist/types/index.d.ts"
Neither file exists in the published tarball (checked 4.0.0 through 4.4.0). The files actually shipped are dist/widgets.js (CJS) and dist/types/src/index.d.ts.
Consequences for npm consumers:
- TypeScript:
import { Widgets } from "@alma/widgets" fails with TS7016: Could not find a declaration file for module '@alma/widgets' — the typings path resolves to nothing.
- Bundlers that honor
module have to fall back to main after failing to resolve dist/widgets.m.js (webpack and vite do this silently; stricter tooling errors).
- Even after pointing typings manually at
dist/types/src/index.d.ts, the emitted declarations import internal @/... path aliases that can't resolve outside your build, so the exported option types (PaymentPlanWidgetOptions etc.) degrade to any.
Current workaround: a local ambient declaration (declare module "@alma/widgets/dist/widgets.js" { export * from "@alma/widgets/dist/types/src/index"; }) plus importing @alma/widgets/dist/widgets.js directly. Corrected field paths (or an exports map) and alias-free emitted .d.ts files would remove the need for it.
Related: #256 — if the published package.json gets touched for that one, both fixes could land in the same patch release.
The published
package.jsondeclares:Neither file exists in the published tarball (checked 4.0.0 through 4.4.0). The files actually shipped are
dist/widgets.js(CJS) anddist/types/src/index.d.ts.Consequences for npm consumers:
import { Widgets } from "@alma/widgets"fails withTS7016: Could not find a declaration file for module '@alma/widgets'— thetypingspath resolves to nothing.modulehave to fall back tomainafter failing to resolvedist/widgets.m.js(webpack and vite do this silently; stricter tooling errors).dist/types/src/index.d.ts, the emitted declarations import internal@/...path aliases that can't resolve outside your build, so the exported option types (PaymentPlanWidgetOptionsetc.) degrade toany.Current workaround: a local ambient declaration (
declare module "@alma/widgets/dist/widgets.js" { export * from "@alma/widgets/dist/types/src/index"; }) plus importing@alma/widgets/dist/widgets.jsdirectly. Corrected field paths (or anexportsmap) and alias-free emitted.d.tsfiles would remove the need for it.Related: #256 — if the published
package.jsongets touched for that one, both fixes could land in the same patch release.