Repository navigation
fix(cli): restore published bin path broken by the nx 24 upgrade - #293
ChristopherPHolder wants to merge 1 commit into
Conversation
`package.json` declares `bin: { "user-flow": "src/cli.mjs" }`, but the
build was emitting it to `dist/packages/cli/packages/cli/src/cli.mjs`, so
the published package pointed at a file that does not exist.
Nx 24 changed how `@nx/js:tsc` resolves string assets: the full path is
now preserved rather than being relativised to the project root. Every
string entry here was affected, not just the binary. `nx-plugin` already
used the object form and was unaffected.
Converted to the object form so the output path is explicit.
Verified by packing `dist/packages/cli` and diffing the file list against
the published 0.21.4 tarball: 312 files, identical in both directions.
❗❗❗ report generated by this PR ❗❗❗☕ Order Coffee ☕Date/Time: 2026-10-23 20:39
|
|
Closing — the premise was wrong, and I got this one backwards. I concluded the build emitted A clean build with Correct path, no stray Two independent confirmations I should have weighed before opening this:
The "312 files, identical in both directions" check in the description was real, but it only proved the rewritten config was equivalent to the published package — not that the existing config was broken. It was equivalence, not a fix. The two CI failures here were also unrelated to the change. Both trace to |
The problem
packages/cli/package.jsondeclares:On current
mainthe build emits that file todist/packages/cli/packages/cli/src/cli.mjs. There is nodist/packages/cli/src/cli.mjs, so the next publish would ship a package whoseuser-flowbinary points at a missing file —npx @push-based/user-flowwould fail for every consumer.This is a regression, not long-standing. The published
0.21.4tarball has it correctly atpackage/src/cli.mjs.Cause
Nx 24 changed how
@nx/js:tscresolves string assets — the full path is now preserved rather than relativised to the project root. All four string entries were affected, not just the binary:packages/nx-pluginwas unaffected because it already uses the object form ({input, glob, output}), which is why only the CLI broke.Surfaced while adding the plugin e2e suite in #292 — the published tarball contents are visible in the local-registry publish output.
The fix
Converted the string assets to the object form so output paths are explicit.
Verification
Packed
dist/packages/cliand diffed the file list against the published0.21.4tarball:Identical in both directions. Also confirmed
node dist/packages/cli/src/cli.mjs --versionruns, and that thestatic/assets andCHANGELOG.md/README.mdland where they did before.Note:
packages/cli/*.schema.jsonmatches nothing in the source tree today — it was a no-op before this change and still is. Left in place rather than widening the scope of the fix.