Scope-B milestone NI-1, API side: the explicit call API that replaces the build container's hand-written node subprocess (api patch 09). - The new package @scriptc/node exports callSync(specifier, name, ...args) and call(...). The module loads with require() from the calling module; arguments and results cross as JSON copies; a thrown Error crosses as its nearest intrinsic class with its message and string code, other thrown values as JSON copies; callSync refuses a function that returns a promise. Its Node implementation runs the calls in-process with the same copies, so a program prints the same under Node and compiled. - The compiler lowers calls to the named or namespace imports (node-api-import.ts, lower-node-island.ts) to the nodeIsland.callSync and nodeIsland.call libCalls: the calling module's real path, the specifier, the export name and the boxed argument array, with the result checked against the declared type like `JSON.parse(s) as T`. Arguments and results whose types are not JSON data are refused at build time, and the functions and the namespace refuse as values. - Corpus programs 6800-6803 (sync and async results, errors, process.exit from Node with the program's exit listeners, Node's pending timers keeping the program alive) run under Node and as binaries that load libnode; `// @requires-libnode` skips them where SCRIPTC_LIBNODE names no pack (until the pack CI matrix publishes packs). The node-island harness covers loading Node only on the first call, the beside packaging, a missing pack, a pack of another Node version or bridge ABI, and the executable's symbols. - Release tooling publishes @scriptc/node with the other packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.3 KiB
Releasing
Releases are manual, single-commit affairs. The maintainer controls the changelog voice and format. @scriptc/runtime, every platform helper/runtime pack, @scriptc/compiler, @scriptc/experimental, @scriptc/node, @scriptc/threads, and scriptc always publish together at the same version.
To prepare a release:
- Bump the version in
packages/cli/package.json - Run
node scripts/sync-versions.mjsto stamp the same version into the runtime, helper, compiler, experimental, node, and threads packages, thenpnpm manifestto restamppackages/compiler/surface-manifest.jsonwith the new version, and commit both (the test suite's staleness guard fails on a version drift) - Fold the
## Unreleasedsection ofCHANGELOG.mdinto a new## <version>entry (newest first, below## Unreleased), and leave## Unreleasedempty for the next cycle - Wrap the new entry in
<!-- release:start -->and<!-- release:end -->markers; this marked block is also the GitHub release body - Remove the
<!-- release:start -->and<!-- release:end -->markers from the previous release entry; only the latest release should have markers - With Zig on
PATH, runSCRIPTC_CROSS=1 pnpm exec vitest run tests/harness/library-cross.test.tsand require the cross-target library conformance lane to pass - Commit to
main
CI (.github/workflows/release.yml) compares the version in packages/cli/package.json to what scriptc has on npm. If it differs, it builds platform packages on matching macOS, Linux, and Windows runners, verifies the version spine, and publishes the runtime, helper, compiler, and CLI packages in dependency order. After the publish succeeds, a separate job creates the git tag v<version> and the GitHub release with the marked changelog entry as its body, and attaches surface-manifest.json — the machine-readable listing of the surface the static tier compiles at that version (stable per-entry ids, so two releases diff mechanically; see packages/compiler/src/coverage/surface-manifest.ts for the schema). The job regenerates the manifest from the tree and fails on any byte difference from the committed file before attaching, so the asset is always the manifest of the code being released. The same file ships inside the @scriptc/compiler package as @scriptc/compiler/surface-manifest.json.
The release job builds each pinned LLVM helper, precompiled runtime pack, and native CLI on its matching host. The native CLI bundles its TypeScript checker, LLVM helper, runtime pack, declarations, and comptime evaluator. npm postinstall installs the matching native executable; Node is needed for npm installation but not native compilation or execution. The user's toolchain performs the final platform link. Sanitized builds also use it to instrument program LLVM and compile the C runtime. Platform packages publish ahead of @scriptc/compiler and scriptc. The GitHub release attaches standalone compiler archives, their SHA-256 checksums, and the surface manifest after npm publication succeeds.
Publishing uses npm trusted publishing (OIDC) — there is no npm token secret.
Each published package must have a GitHub Actions trusted publisher for
release.yml and the Release environment. A missing configuration fails
before upload. Re-runs skip package versions already present on npm, so a
partially published release can be resumed safely.