Skip to content

fix(stellar-scaffold-cli): pass pnpm reporter flag before run - #653

Merged
zachfedor merged 1 commit into
stellar-scaffold:mainfrom
ElliotFriend:fix/pnpm-build-args
Nov 3, 2026
Merged

zachfedor merged 1 commit into
stellar-scaffold:mainfrom
ElliotFriend:fix/pnpm-build-args

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

What

Contract client generation fails for every contract in pnpm projects. On my machine, it was throwing something like this:

$ tsc --reporter=silent
error TS5023: Unknown compiler option '--reporter=silent'.

PackageManager::build runs pnpm run build --reporter=silent. pnpm forwards anything after the script name (e.g., build) to the script, so the flag gets sent along to the tsc command.

To reproduce: stellar scaffold init -p pnpm, then stellar scaffold build. Also, the error is seen when using pnpm dev or the watch command that re-compiles and re-generates clients when changes are detected.

Fix

  • Split build_command() out of build(), so the build arguments can be tested without actually running the commands
  • Put flags before run for pnpm (the fix) and npm (for consistency; npm accepts either order. happy to reverse this, though, if you want)
  • Add a test that the build script name is the last argument for every package manager

The install calls are unaffected, since pnpm reads flags after install itself.

pnpm forwards arguments after the script name to the script, so
`pnpm run build --reporter=silent` handed the flag to tsc and client
generation failed. Move package-manager flags ahead of `run` and add a
test that the script name is the last build argument.
@zachfedor

Copy link
Copy Markdown
Contributor

Thanks Elliot! I reproduced this locally, the npm reorder is totally fine and the new tests are helpful against this coming back. I appreciate it! This also helped surface a new bug: tsc was only writing errors to stdout so I was missing build errors trying to capture them from stderr. I'll add a fast-follow and merge this in now.

@zachfedor
zachfedor merged commit 9edb742 into stellar-scaffold:main Nov 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants