Skip to content

Conversation

@adamziel
Copy link
Collaborator

Improves Playground CLI error reporting in two ways:

  • Stop printing the stack trace if the --debug flag isn't set. The typical errors are similar to "unknown option --blueprin" and displaying the stack trace makes the user experience worse.
  • Rejects unrecognized options. Before this PR, a typo in one of the flags will go undetected until the user realizes the CLI doesn't do what they want it to. With this PR, the typo is immediately apparent as the process will short-circuit and report a failure. We still support both kebab-cased and camelCased CLI flags

Testing instructions

Confirm this command prints a short error message:

node --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts server --php=8.4 --blueprin=./file.json

Add --debug and confirm you can see the entire stacktrace

Improves Playground CLI error reporting in two ways:

* Stop printing the stack trace if the `--debug` flag isn't set. The
  typical errors are similar to "unknown option --blueprin" and
  displaying the stack trace makes the user experience worse.
* Rejects unrecognized options. Before this PR, a typo in one of the
  flags will go undetected until the user realizes the CLI doesn't do
  what they want it to. With this PR, the typo is immediately apparent
  as the process will short-circuit and report a failure. We still
  support both kebab-cased and camelCased CLI flags

 ## Testing instructions

Confirm this command prints a short error message:

```
node --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts server --php=8.4 --blueprin=./file.json
```

Add `--debug` and confirm you can see the entire stacktrace
@adamziel adamziel merged commit 0f789d0 into trunk Jul 22, 2025
24 of 25 checks passed
@adamziel adamziel deleted the improve-cli-error-reporting branch July 22, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants