Repository navigation
fix(cli): report failed installs, approve swc builds for pnpm 11 and default to Node.js + Vite - #629
Merged
Merged
Conversation
When a command run through CliExeca (e.g. `pnpm install`) failed after its stream ended, streamToObservable left a rejected promise without handler. Node then crashed the process before CliStats could send the failed init report to the stats API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
pnpm 11 fails the install with ERR_PNPM_IGNORED_BUILDS when a dependency has unapproved build scripts. @tsed/cli depends on @swc/core, so every `tsed init` using pnpm 11 failed while adding the dependencies. PNpmManager.init now approves @swc/core in pnpm-workspace.yaml: `allowBuilds` for pnpm >= 11, `onlyBuiltDependencies` for pnpm 10. The existing settings of the file are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 7.9.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cli-core):streamToObservable(used byCliExeca.run) calledawaited.then(resolve)without a rejection handler. It's nowawaited.then(resolve, reject).cli-core):PNpmManager.initnow approves@swc/coreinpnpm-workspace.yaml. It writesallowBuildsfor pnpm >= 11 andonlyBuiltDependenciesfor pnpm 10, keeps the file's existing settings, and does nothing for pnpm < 10.cli):tsed initnow proposes Node.js + Vite by default instead of Node.js + SWC. This covers both the schema default and the checked choice of the interactive prompt.Why
tsed initfailed duringpnpm install, Node crashed on the unhandled rejection whileCliStats.$onFinishwas still sending the failed init report. The stats API never received these failures. The API side was checked: the payload passesCliStatPayloadvalidation and thecli_install_statscolumns accept it.ERR_PNPM_IGNORED_BUILDSwhen a dependency has unapproved build scripts.@tsed/clidepends on@swc/core(tsed runuses@swc-node/register), so any pnpm 11 init failed while adding the dependencies, whatever the runtime.Notes for reviewers
RuntimesModule.get()still falls back tonodewhen a project has no runtime preference. I left it as-is so existing projects keep their behavior.pnpm --versionin the project folder. If that fails, the CLI writesallowBuilds(the current pnpm format).Tests
streamToObservable.spec.ts: fails without fix 1 (unhandled rejection), passes with it.PNpmManager.spec.ts: pnpm 11, pnpm 10, pnpm 9, unreadable version, and merging with an existingpnpm-workspace.yaml.getFeaturesPrompt.spec.tssnapshot updated for the new default.cli-corepackage managers: 36/36.cliinit commands: 23/23.🤖 Generated with Claude Code