Build React WASM package from same-run artifact - #1049
Conversation
|
| # npm version re-resolves the stale Feedz entry in package-lock.json. | ||
| # Install the WASM tarball produced earlier in this run instead. | ||
| npm pkg set "version=$VERSION" "dependencies.@elsa-workflows/elsa-studio-wasm=$VERSION" --workspace wrappers/react-wrapper | ||
| npm install --force --no-save --package-lock=false "../../packages/wasm/wwwroot/elsa-workflows-elsa-studio-wasm-$VERSION.tgz" |
There was a problem hiding this comment.
This install disables the workspace lockfile while building the release wrapper, so dependencies other than the local WASM tarball resolve from manifest ranges instead of the checked-in pins. A newly published dependency version can therefore change or break a release built from unchanged source, while the unchanged lockfile no longer describes what was built. This must be fixed before merging.
Artifacts
- This authored shell script creates an isolated npm workspace, a locally packed WASM-like tarball, and a deliberately stale lockfile before executing the exact line-126 npm options; it is the executable test source.
- This captured execution ran the supplied reproduction from `/home/user/repo` with exit code 0 and shows lodash changed from lockfile pin 4.17.20 to installed 4.18.1 while the lockfile hash stayed unchanged, confirming nondeterministic release dependencies.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/packages.yml
Line: 126
Comment:
**Unlocks Release Dependencies**
This install disables the workspace lockfile while building the release wrapper, so dependencies other than the local WASM tarball resolve from manifest ranges instead of the checked-in pins. A newly published dependency version can therefore change or break a release built from unchanged source, while the unchanged lockfile no longer describes what was built. This must be fixed before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Fixes #1048
The React wrapper package step used
npm versioninside the npm workspace. That re-resolved the checked-in lockfile and attempted to download@elsa-workflows/elsa-studio-wasm@3.4.0from Feedz, even though the same package workflow had already built the current WASM tarball.The step now sets the wrapper and its WASM dependency to the workflow's
$VERSION, installs from the same-run tarball with the workspace lock disabled, then builds and packs the wrapper. The install runs from the workspace root so its postinstall copies assets from the hoisted package that came from that tarball.Validation:
npm version.package.json; wrapper version and WASM dependency matched exactly.git diff --checkpassed.The
Packagesworkflow only runs on pushes tomainor release events, so this PR does not execute that packaging job before merge.