Repository navigation
fix(release): ship runtime-functions.js in the npm publish artifact - #2776
Merged
Merged
Conversation
`runtime-functions.ts` arrived in #2740 without being added to `tsconfig.json`'s `include`. tsc compiles a reachable import whether or not it is listed, so it kept emitting `runtime-functions.js` and every local build and `js.yml` run stayed green. Two things broke on that omission. `publish-js.yml` builds the package once and ships the result as the `js-stubs` artifact, and that list is derived by hand from `include`, so it never gained the file. And `scripts/tests/test_js_publish_files.py`, the guard added after 0.18.2 shipped without `langchain.js`, reads its notion of "tsc output" out of the same `include` -- so the guard was blind to exactly the file that was missing from it. v0.20.0 therefore published to crates.io and PyPI while all fifteen `Publish JS` test jobs failed on `ERR_MODULE_NOT_FOUND` for runtime-functions.js, which `wrapper.js` (the package `main`) imports at its first line. `release-js` is gated on those jobs, so npm was never reached and both npm packages remain on 0.19.0. Had the tests been bypassed, the published tarball would have omitted the file too: `package.json` `files` lists it and the publish job never runs tsc. Fixes the root omission in both tsconfigs, adds the two outputs to the artifact, and closes the guard's blind spot by checking `include` against the sources on disk instead of trusting it. `tsconfig.check.json` overrides `include` rather than extending it, so it needs the entry too. Before / After, reproducing the CI failure locally: $ mv runtime-functions.js /tmp/ && node __test__/fixtures/runtime-functions-shutdown.mjs Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../crates/bashkit-js/runtime-functions.js' imported from .../crates/bashkit-js/wrapper.js With the file present, resolution moves past it to the native binding that CI supplies via the `js-bindings-*` artifact. The new guard fails on the pre-fix tree: AssertionError: 'runtime-functions.ts' not found in {'scripted.ts', 'langchain.ts', 'internal.ts', 'anthropic.ts', 'wrapper.ts', 'ai.ts', 'openai.ts'} : runtime-functions.ts is a package source but is not in tsconfig.json include and restoring `include` alone then makes the two pre-existing checks fail independently on the artifact gap, confirming the chain. Verified: 181/181 script tests pass; `tsc --noEmit -p tsconfig.check.json` reports an identical error set before and after (11 environmental errors from the absent napi-generated `index.d.ts`, no new ones); prettier, check-okf, check-doc-links, check-workflow-parity, check-capability-parity and check-changelog pass; the artifact now covers every tsc output. This does not republish 0.20.0. A failed npm publish cannot be recovered by re-dispatching from `main`, since only a `refs/tags/vX.Y.Z` ref publishes as `latest`; npm needs a patch release once this has landed. Claude-Session: https://claude.ai/code/session_01RE65s6DTUE7LzZgc1o6Hzi
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | d247e14 | Commit Preview URL Branch Preview URL |
Oct 25 2026, 09:17 AM |
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The npm publish lane now ships
runtime-functions.js/.d.ts, soPublish JScan get past its test stage and@everruns/bashkitcan reach npm again.runtime-functions.tsis declared in both tsconfigs, the two outputs are added to thejs-stubsartifact, and the existing publish guard no longer has a blind spot: it checkstsconfigincludeagainst the.tssources on disk instead of trusting it.No library or package behavior changes — this is release plumbing.
Why
runtime-functions.tsarrived in #2740 without being added totsconfig.json'sinclude. tsc compiles a reachable import whether or not it is listed, so it kept emittingruntime-functions.js, and every local build andjs.ymlrun stayed green.Two things broke on that one omission:
publish-js.ymlbuilds the package once and ships the result as thejs-stubsartifact. That list is maintained by hand frominclude, so it never gained the file. The test jobs download the artifact rather than running tsc, so the file was simply absent.scripts/tests/test_js_publish_files.py— the guard added after 0.18.2 shipped withoutlangchain.js— reads its notion of "tsc output" out of that sameinclude. So the guard was blind to exactly the file missing from it.The result: v0.20.0 published to crates.io and PyPI, but both npm packages are still on 0.19.0. All fifteen
Publish JStest jobs failed onERR_MODULE_NOT_FOUND, andrelease-jsis gated on them, so npm was never reached (run 40147171021).wrapper.jsis the packagemainand imports./runtime-functions.json its first line, so had the tests been bypassed the published tarball would have been broken for every consumer too:package.jsonfileslists the file and the publish job never runs tsc.Before / After
Reproducing the CI failure locally by simulating the artifact gap:
With the file present, resolution moves past it to the native binding that CI supplies via the
js-bindings-*artifact — i.e. the reported failure is exactly this missing file.The new guard fails on the pre-fix tree:
Restoring
includealone then makes the two pre-existing checks fail independently on the artifact gap, which confirms the chain end to end:After the fix, every tsc output is covered by the artifact (verified by parsing the workflow against
tsconfig.json):tsc outputs missing from artifact: none.Validation:
tsc --noEmit -p tsconfig.check.jsonreports an identical error set before and after the change (11 errors, all environmental — the napi-generatedindex.d.tsis absent without a Rust napi build); no new type errors.prettier --check,check-okf,check-doc-links,check-workflow-parity,check-capability-parity,check-changelogall pass.Risk
includelists, a test, and knowledge. No interpreter, builtin, or package runtime code. Adding an already-compiled file toincludechanges no emit (confirmed by the identical error sets), and widening an upload list cannot remove anything..tsthat is not an entry point (a config file, say) would fail it and need an explicit exclusion. That is the intended trade — the failure message names the file.This PR does not republish 0.20.0. Only a
refs/tags/vX.Y.Zref publishes as npmlatest, so a failed publish cannot be recovered by re-dispatching frommain; npm needs a patch release once this lands.Separately, and not fixed here:
Publish Web(run 40147172644) failed for an unrelated reason —npm error 404 PUT @everruns/bashkit-wasmafter provenance signing. The workflow is structurally identical to the one that published 0.19.0 successfully, so this looks like theNPM_TOKENsecret having expired or lost publish scope. That needs a credential rotation, not a code change.Checklist
include-completeness guard, written failing firsthttps://claude.ai/code/session_01RE65s6DTUE7LzZgc1o6Hzi
Generated by Claude Code