Today Canvas Kit
SDK packages

@todayai-labs/tck-shared-deps

Build tool that emits the host's importmap-served externals — react-runtime.mjs, tck.mjs, tck-host.mjs.

A build-time tool. Produces the shared-deps directory the host serves to widgets via an import map. Output is a small set of single-file ESM bundles (react-runtime.mjs, tck.mjs, tck-host.mjs) plus a manifest.json mapping bare specifiers to URLs.

Not to be confused with tck-bundle-formattck-bundle-format defines the .tckb wire format (bytes). tck-shared-deps produces the JS module artifacts that the host import-map resolves for widgets' import "react" calls. Opposite ends of the stack.

tck-shared-deps is not in the SDK fixed-release group. It versions independently because host apps depend on it via their own devDependencies; widgets never see it.

CLI

tck-shared-deps \
  --out  apps/web/public/__tck/v1 \
  --abi  v1 \
  --url-prefix /__tck/v1
  • --out — where to write the bundle files. Wiped and recreated each build (hermetic output).
  • --abi — informational only; defaults to v1. Appears in build logs and the result echo. Encode the actual ABI label via --out + --url-prefix.
  • --url-prefix — the path prefix the host will serve the output under. Determines what the emitted manifest.json URLs look like.

Programmatic surface

ExportWhat it does
buildPlatform(options)Programmatic build. Returns the manifest + per-group results.
defineConfig(config)Type-safe config helper for tck-shared-deps.config.ts.
DEFAULT_GROUPSThe default group definitions: react-runtime.mjs, tck.mjs, tck-host.mjs.
buildManifest, normalizeUrlPrefix, writeManifestManifest-shape helpers (specifier → URL).

Singleton invariant

Each npm package gets exactly one physical output bundle. react and react/jsx-runtime map to the same react-runtime.mjs; the bundle re-exports the union of names. Splitting a single package across two URLs would duplicate React fiber state and break hooks crossing the host/widget boundary.

Source

On this page