Repository navigation
ref(cli): Drop the getters from the wizard's clack wrapper - #2658
Merged
Merged
Conversation
Build `clack` by spreading `@clack/prompts` instead of a getter per member. A spread copies only the exports a test's mock defines, so the ported tests that mock clack partially still load the module. The question prompts look up their clack function by name when called, so `withRequiredInput` still wraps them and tests that spy on them still see the calls. `cocoapod.test.ts` now spies on the wizard's `clack.spinner`, which the spread copies at load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
approved these changes
Dec 1, 2026
This branch was successfully deployed
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.
Summary
Follow-up to #2652, from this review thread.
The wizard's
clackobject (utils/clack/prompts.ts) had a getter per member, so that the tests ported from sentry-wizard, which mock@clack/promptswith only the functions they use, still load the module: Vitest throws when code reads an export the mock doesn't define. Making the members plain properties breaks 58 of the 123 wizard test files at load.Key Changes
clackspreads the@clack/promptsnamespace instead. A spread copies only the exports a mock defines, so those tests still load. The import needs asentry-cli/no-namespace-importexception, with its reason on the line.withRequiredInputtakes the prompt's name (confirm,multiselect,select,text) and looks up clack's function when called. Tests that spy onselectafter the module loads (configure-sentry-cli,fastfile) still see the calls.cocoapod.test.tsspied on@clack/prompts'spinnerafter load, which the spread had already copied. It now spies on the wizard'sclack.spinner, and drops its own namespace import and that import's lint exception.Verification
main(wizard.test.tsargument parsing,xcode-manager.test.ts). CLI typecheck andpnpm run lintpass.sentry wizard android < /dev/nullstill stops with exit code 1 and the message from fix(cli): Stop the wizard with exit code 1 when it has no terminal #2652, and one piped answer followed by the end of input is accepted.🤖 Generated with Claude Code