fix(rstack): support latest Rstest CLI entry - #460
Conversation
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. |
Deploying rstack-cli with
|
| Latest commit: |
267ca09
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://20b4d9c4.rstack-cli.pages.dev |
| Branch Preview URL: | https://fix-rstest-run-cli-compat.rstack-cli.pages.dev |
There was a problem hiding this comment.
🟡 Changes recommended
The new @rstest/core/api runCLI expects argv after rstest, but the current implementation always passes a full process.argv-shaped array, which can break parsing on newer Rstest versions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates rstack’s rs test command to remain compatible with both Rstest 0.11.x (where runCLI is exported from @rstest/core) and newer Rstest versions where runCLI moved to @rstest/core/api, without changing CLI arguments for rs test users.
Changes:
- Adds a runtime fallback to import
runCLIfrom@rstest/core/apiwhen it’s missing from@rstest/core. - Introduces local typing/casting to support both entrypoints while keeping the CLI call site stable.
File summaries
| File | Description |
|---|---|
| packages/rstack/src/cli/commands.ts | Adds a fallback import path for Rstest’s runCLI to support the new CLI entrypoint. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
runCLIexport with Rstest 0.11.x@rstest/core/apiafter the programmatic API rewrite moved the exportrs testconsumers without changing command argumentsValidation
pnpm --filter rstack buildnode packages/rstack/dist/index.js test --versionpnpm checkreached and passed lint/type checking, then stopped because the local native binding was unavailableEcosystem CI
This addresses the shared
runCLI is not a functionfailure in Rstest ecosystem CI for Rsbuild and Rsdoctor, plus the declaration error in rstack-cli after web-infra-dev/rstest#1729.