ReviewOS

also looking at this

craft-native/craft

fix(sdk): keep version checks working in relocated bundles

#290
Merged glennmichael123 wants to merge codex/relocatable-sdk-version into main
3 files +63 -17
9 days ago

The CJS SDK previously embedded the build machine's absolute source directory when resolving its own version. Installed consumers could silently get unknown, disabling native/SDK version mismatch warnings. The SDK now imports its manifest version as a build-time value shared by ESM and CJS.

A regression test builds both formats from a temporary package with a sentinel version, removes the source checkout, and runs real consumers under Bun and Node. Matching versions stay quiet; mismatched versions report the correct SDK version, and runtime code contains no reference to the deleted source directory.

Validation: relocation test, SDK build, root typecheck, changed-file Pickier, and absolute-path scan of built JS/CJS artifacts. The complete SDK suite was also run with localhost access for its existing HMR tests.

Closes #284.

3 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.