-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
CLI: Update clack #33151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: Update clack #33151
Conversation
|
View your CI Pipeline Execution ↗ for commit 8e7a331
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughThis PR updates the Changes
Sequence DiagramsequenceDiagram
actor User
participant Task
participant Spinner
participant Logger
rect rgb(220, 240, 220)
Note over Task,Logger: New: Error Handling Path
User->>Task: error state
Task->>Spinner: error(message)
Spinner->>Logger: log error via spinnerInstance.error
Spinner->>Spinner: reset activeSpinner
Spinner->>Spinner: restore console patch
end
rect rgb(220, 240, 220)
Note over Task,Logger: New: Cancellation Path
User->>Task: abort signal
Task->>Spinner: cancel(message)
Spinner->>Logger: log cancel via spinnerInstance.cancel
Spinner->>Spinner: reset activeSpinner
Spinner->>Spinner: restore console patch
end
rect rgb(240, 240, 220)
Note over Task,Logger: Existing: Success Path (unchanged)
User->>Task: complete
Task->>Spinner: stop()
Spinner->>Spinner: cleanup
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
✨ Finishing touches
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx,js,jsx,mjs}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx,json,html,mjs}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
code/**/!(*.test).{ts,tsx,js,mjs}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Comment |
32e2bea to
0e5f1c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
code/yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
code/core/package.json(1 hunks)code/core/src/node-logger/prompts/prompt-functions.ts(2 hunks)code/core/src/node-logger/prompts/prompt-provider-base.ts(1 hunks)code/core/src/node-logger/prompts/prompt-provider-clack.ts(1 hunks)code/core/src/node-logger/tasks.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- code/core/src/node-logger/tasks.ts
- code/core/package.json
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use camelCase for variable and function names
Files:
code/core/src/node-logger/prompts/prompt-provider-base.tscode/core/src/node-logger/prompts/prompt-functions.tscode/core/src/node-logger/prompts/prompt-provider-clack.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes
Files:
code/core/src/node-logger/prompts/prompt-provider-base.tscode/core/src/node-logger/prompts/prompt-functions.tscode/core/src/node-logger/prompts/prompt-provider-clack.ts
**/*.{ts,tsx,js,jsx,json,html,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes
Files:
code/core/src/node-logger/prompts/prompt-provider-base.tscode/core/src/node-logger/prompts/prompt-functions.tscode/core/src/node-logger/prompts/prompt-provider-clack.ts
code/**/!(*.test).{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
code/**/!(*.test).{ts,tsx,js,mjs}: Use 'logger' from 'storybook/internal/node-logger' for server-side (Node.js) logging, not console.log/console.warn/console.error
Use 'logger' from 'storybook/internal/client-logger' for client-side (browser) logging, not console.log/console.warn/console.error
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size
Files:
code/core/src/node-logger/prompts/prompt-provider-base.tscode/core/src/node-logger/prompts/prompt-functions.tscode/core/src/node-logger/prompts/prompt-provider-clack.ts
🧬 Code graph analysis (2)
code/core/src/node-logger/prompts/prompt-functions.ts (2)
code/core/src/node-logger/logger/logger.ts (1)
shouldLog(67-69)code/core/src/node-logger/index.ts (1)
logger(49-74)
code/core/src/node-logger/prompts/prompt-provider-clack.ts (1)
code/core/src/node-logger/index.ts (1)
logTracker(8-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (2)
code/core/src/node-logger/prompts/prompt-provider-base.ts (1)
48-49: LGTM! Clean API evolution.The replacement of
stopwithcanceland the addition of a dedicatederrormethod provides clearer semantics for different termination scenarios. The type signatures are consistent with the existing interface pattern.code/core/src/node-logger/prompts/prompt-functions.ts (1)
125-138: LGTM! Proper state management and error handling.Both
cancelanderrormethods correctly:
- Reset the
activeSpinnerstate before restoring the console- Apply appropriate log level guards (
infofor cancel,errorfor error)- Delegate to the underlying spinner instance
…sage to cancel in project scaffolding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
code/lib/create-storybook/src/scaffold-new-project.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use camelCase for variable and function names
Files:
code/lib/create-storybook/src/scaffold-new-project.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes
Files:
code/lib/create-storybook/src/scaffold-new-project.ts
**/*.{ts,tsx,js,jsx,json,html,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes
Files:
code/lib/create-storybook/src/scaffold-new-project.ts
code/**/!(*.test).{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
code/**/!(*.test).{ts,tsx,js,mjs}: Use 'logger' from 'storybook/internal/node-logger' for server-side (Node.js) logging, not console.log/console.warn/console.error
Use 'logger' from 'storybook/internal/client-logger' for client-side (browser) logging, not console.log/console.warn/console.error
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size
Files:
code/lib/create-storybook/src/scaffold-new-project.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/lib/create-storybook/src/scaffold-new-project.ts (1)
182-184: LGTM! Appropriate use of error() for failure cases.Using
spinner.error()for the failure path is semantically correct and provides better clarity than the previousstop()method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/tasks/sandbox-parts.ts (1)
198-205: Unconditionalloglevel: 'debug'may ignore thedebugflagHere
loglevelis always set to'debug', so the init step will run in debug mode even when the caller doesn't pass--debug(unless a template overridesloglevelviainitOptions). Consider tying this to thedebugflag or letting the CLI default handle it.For example:
await executeCLIStep(steps.init, { cwd, optionValues: { - loglevel: 'debug', + loglevel: debug ? 'debug' : 'info', yes: true, ...extra, ...(template.initOptions || {}), },Please double‑check this against the current Storybook CLI loglevel/debug semantics to ensure we're not changing behavior unintentionally.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/tasks/sandbox-parts.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use camelCase for variable and function names
Files:
scripts/tasks/sandbox-parts.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes
Files:
scripts/tasks/sandbox-parts.ts
**/*.{ts,tsx,js,jsx,json,html,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes
Files:
scripts/tasks/sandbox-parts.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
AGENTS.md (1)
1-47: Comprehensive and well-structured contributor guidelines—approved for merge.The AGENTS.md file provides clear, actionable guidance covering project structure, build/test commands, coding conventions, testing workflows, and commit/PR practices. The Wallaby.js subsection (lines 23–35) is particularly valuable for developer ergonomics and troubleshooting.
Minor observations:
- The testing section is strong, but consider cross-linking or referencing the recent updates to the spinner/task API (stop → cancel/error, see related changes in this PR) if those changes significantly impact test patterns or CLI scaffolding workflows. This would help contributors avoid surprises when they touch spinner-related code.
- The commands shown (e.g.,
yarn --cwd code test) are correct; ensure they remain synchronized with any tooling changes.Based on learnings, updating relevant documentation for significant changes is valued in this repository. If the spinner/task API changes represent significant API surface changes, consider whether a migration guide or changelog entry complements this file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
AGENTS.md(1 hunks)code/lib/create-storybook/src/scaffold-new-project.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- code/lib/create-storybook/src/scaffold-new-project.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to README.md : Update relevant README files for significant changes
Applied to files:
AGENTS.md
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: The Storybook repository is a TypeScript/React monorepo with main codebase in 'code/' directory and tooling in 'scripts/' directory
Applied to files:
AGENTS.md
📚 Learning: 2025-10-02T09:22:13.215Z
Learnt from: JReinhold
Repo: storybookjs/storybook PR: 32607
File: code/package.json:243-243
Timestamp: 2025-10-02T09:22:13.215Z
Learning: The Storybook repository uses Yarn v^4 (any 4.x version) as the package manager, configured via .yarnrc.yml and package.json packageManager field. Specific patch versions within v4 can be upgraded as needed.
Applied to files:
AGENTS.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
1dd3092 to
1e80e8d
Compare
…n and successful project creation
Closes #
What I did
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This pull request has been released as version
0.0.0-pr-33151-sha-8e7a3312. Try it out in a new sandbox by runningnpx [email protected] sandboxor in an existing project withnpx [email protected] upgrade.More information
0.0.0-pr-33151-sha-8e7a3312valentin/update-clack8e7a33121764076471)To request a new release of this pull request, mention the
@storybookjs/coreteam.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=33151Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.