Files
Robert Fleischmann 7ddfe1dddb ci: verify the packed artifact from a consumer's point of view
Three defects shipped this cycle that neither `npm run build` nor
`npm run typecheck` could see, because all three only exist from outside the
package: exported types silently degrading to `any` under skipLibCheck when
the declarations carried extensionless relative imports, the ESM default
import resolving to the module namespace instead of the class, and callbacks
being bound at runtime but not typed that way.

scripts/verify-package.sh packs the package, installs the tarball into a
throwaway project, and typechecks a real consumer against it under node16,
nodenext and bundler resolution with skipLibCheck deliberately off, then
smoke-tests require(), import, and callback binding at runtime. The fixtures
in scripts/package-fixtures include the Readme's gradient example verbatim,
so the documented API cannot drift from the shipped types.

Verified against both historical failures: reverting the `this` typing or the
.js import extensions makes it fail.

Runs as its own CI job, once rather than per Node version, since it checks the
artifact and not the runtime.
2026-07-22 12:07:45 -04:00
..