Repository navigation
packages: sdk reports its own version from the build, not a relative package.json read - #206
Merged
Merged
Conversation
…package.json read The build stamps package.json's version into dist/sdk/build-version.js, so the published files and bundles made from them (OpenClaw, the Hermes sidecar) carry it as a literal. Unbuilt source still reads ../../package.json, which is correct from src/.
morajabi
force-pushed
the
claude/sdk-version-at-build
branch
from
December 1, 2026 10:20
37bbd1b to
4ea8330
Compare
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.
This is PLG-04 from the October plugins audit.
packages/sdk/src/sdk/sdk-version.tsread the SDK's version at runtime from../../package.json. That path is right fromsrc/sdk/, but wrong once the package is built todist/or bundled into a plugin, so the reported version could be missing or come from another file.Change
tsc, which can't inline values, so the build now runstsc && bun scripts/stamp-version.mjs. The script overwritesdist/sdk/build-version.jswith the version frompackage.json.sdk-version.tsprefers that stampedBUILD_VERSION. Only unbuilt source, used in monorepo dev and by OpenClaw's source-linked tests, falls back to readingpackage.json.bunbecause the MCP Docker image (oven/bun) builds the SDK.The plugins pick this up only after the next SDK release. They pin
@inline-chat/realtime-sdk0.0.28 from the registry.Verified
bun run test: 348 pass, 100% line coverage onsdk-version.ts. New tests: the version matchespackage.json; the stamp wins without reading the file; the stamp script's output imports correctly.bun run build:dist/sdk/build-version.jsholds"0.0.28". Importing the builtsdk-version.jsreports0.0.28, and so does abun buildbundle in a nested folder (inlined as a literal).typecheckandlintpass.🤖 Generated with Claude Code