libcascade

Toolchain

Build a custom OCCT WASM from a typed config — trim symbols, extend with C++, ship reproducible CI.

@libcascade/toolchain is the dev-time package for building your own OCCT WASM: a typed libcascade.config.ts, a CLI that drives the digest-pinned container for you, and an assemble step that turns the artifacts into an npm package surface.

If you do not need a custom binary, install the prebuilt libcascade package instead. The toolchain is a devDependency, it never runs on postinstall, and it does nothing until you invoke it.

What the types check

import { defineBuild } from '@libcascade/toolchain';

export default defineBuild({
  name: 'myapp',
  bindings: ['BRepPrimAPI_MakeBoox'],       // ✗ did you mean 'BRepPrimAPI_MakeBox'?
  settings: {
    INITIAL_MEMORY: '100mb',                // ✗ not a MemorySize
    ENVIRONMENT: 'web,worker',              // ✗ expects an array of literals
    EXPORT_ES7: true,                       // ✗ no such -s setting
  },
  variants: [{ name: 'single' }],
});

Symbol names come from a 6,257-literal union generated from the release's own API reference. Settings come from the pinned image's own emsdk, with their upstream documentation attached. A toolchain version cannot express a config its own images cannot build.

Two channels of configuration

Compile-time OCJS_* variables are baked into the published image; link-time settings and compilerFlags are yours. See Two-channel config model for why the split exists and what it buys.

On this page