TypeScript
Prerequisites
Section titled “Prerequisites”Node.js 22.6 or later to execute generated .ts files through native type stripping.
Compile and run
Section titled “Compile and run”From a prepared source module containing a main package:
goalchemy compile -target typescript -out out/typescript .cd out/typescriptnode --enable-source-maps main.tsOr use goalchemy run -target typescript . to compile and execute in a temporary directory. Add -gate cooperative for source tasks or suspending operations.
Generated output
Section titled “Generated output”The executable target emits ES2022 TypeScript in native ESM modules: main.ts, pkg_*.ts, leaf shared.ts, and selected rt/ files. Cooperative output adds portable program.ts and host.ts; main.ts remains the Node executable wrapper.
Every output includes its own README.md, selected runtime files, source mappings, and goalchemy.manifest.json. See the full output reference for the inventory and entry behavior.
Native libraries
Section titled “Native libraries”Library output provides portable JavaScript and declarations for Node and browsers. The WebCrypto/fetch library graph is tested in Node and an actual browser. Browser consumers use the library API or portable host entry rather than the Node executable wrapper. Read the TypeScript library boundary.
Runtime and diagnostics
Section titled “Runtime and diagnostics”Byte slices and arrays use native Uint8Array storage while retaining source nil, length, capacity, and aliasing behavior. Per-file .ts.map source maps support stack traces. The portable runHost(host) entry takes an explicit output/failure adapter.