Skip to main content

Export map

Each JavaScript entry has a matching declaration file, and the declarations carry the source JSDoc that editors show for completions and hovers. The package does not ship TypeScript sources, so it does not ship declaration maps either. The 0.1.1 package did include .d.ts.map files, but they pointed to ../src/*.ts files that were not in the package, so editors could not follow them. JavaScript source maps embed their sources and work as shipped.

Supported imports

Do not import invariantcad/dist/..., internal chunks, src/..., or vendored runtime files. They are deliberately hidden by the export map and can change without a public API decision.

ESM only

The package defines "type": "module" and only an import condition. It does not ship a CommonJS wrapper, and require("invariantcad") is not supported. Use dynamic import() from a legacy CommonJS host if migration cannot happen immediately. CommonJS has no top-level await, so call it inside an async function:

Node and browser

The supported Node floor is 22.13. The root module and bundled Manifold runtime also target modern browsers. The OpenCascade kernel entry can run in both environments when its larger WASM asset is correctly served. Exact owned-runtime verification has separate environment entry points. Import invariantcad/kernels/occt/node only in Node.js and invariantcad/kernels/occt/browser only in a browser or module worker. Both return the same opaque runtime type consumed by createOcctKernel. See OCCT runtime attestation for byte acquisition, trust-pin, CSP, permission-model, lifetime, and non-claim details. Release CI verifies Node 22.13, 24, and 26 plus a production Vite build in Chromium.

Side effects and tree shaking

The package declares sideEffects: false. Importing the OCCT subpaths is separate so ordinary Manifold consumers need not execute exact-backend module initialization. WASM initialization occurs only when a kernel factory is called. The Node attestation loader installs a module hook only when loadAttestedOcctRuntime is called. Node 22.15 and newer use an isolated, short-lived hook per load; Node 22.13 and 22.14 retain the compatible process-wide worker-hook fallback.

Type compatibility

Published declarations are checked with publint and Are the Types Wrong under the ESM profile. The release gate also installs the packed tarball into a clean consumer instead of testing only repository-relative imports.

Semver before 1.0

  • Patch releases should repair behavior without changing frozen document meaning.
  • Minor releases may evolve the TypeScript authoring surface during 0.x.
  • Frozen document schemas and protocol versions remain independently parseable according to their compatibility policy.
Pin a minor line for production systems that cannot absorb pre-1.0 API changes, and read the changelog before upgrading.