Skip to content

Conversation

@valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Nov 21, 2025

Closes #

What I did

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make 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-33116-sha-a16f6136. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-33116-sha-a16f6136
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/fix-custom-storybook-script-in-addon-vitest
Commit a16f6136
Datetime Fri Nov 21 13:03:25 UTC 2025 (1763730205)
Workflow run 19571349485

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=33116

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced cross-platform compatibility for Storybook startup in the vitest addon environment.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

📝 Walkthrough

Walkthrough

Modified the Storybook process spawn call in the Vitest plugin's global setup to enable shell interpretation rather than spawning with an empty argv array. Added documentation explaining cross-platform command handling. Preserved existing stdio and working directory configurations.

Changes

Cohort / File(s) Summary
Process spawn configuration
code/addons/vitest/src/vitest-plugin/global-setup.ts
Changed spawn call from using empty argv array to shell-enabled mode; added explanatory comments about cross-platform command interpretation

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus on verifying that shell-mode spawning works consistently across Windows, macOS, and Linux platforms
  • Confirm that the change correctly handles edge cases with command arguments and special characters
  • Validate that existing error handling and process lifecycle management remain unaffected
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1faf97 and a16f613.

📒 Files selected for processing (1)
  • code/addons/vitest/src/vitest-plugin/global-setup.ts (1 hunks)
⏰ 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/addons/vitest/src/vitest-plugin/global-setup.ts (2)

47-48: Good documentation of the rationale.

The comment clearly explains why shell interpretation is needed and provides concrete examples of commands that benefit from this change.


49-53: Code is safe as designed; no fixes needed.

Verification confirms storybookScript is developer-controlled configuration set in the vitest plugin options, not external or untrusted input. The shell: true option is intentional and documented in the code comment to handle platform-agnostic commands like yarn storybook --no-open. Since the source is the developer's own configuration file, command injection risks are not applicable in this context.


Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Nov 21, 2025

View your CI Pipeline Execution ↗ for commit a16f613

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 45s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-21 13:23:50 UTC

@valentinpalkovic valentinpalkovic merged commit 10563b0 into next Nov 21, 2025
73 of 76 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-custom-storybook-script-in-addon-vitest branch November 21, 2025 13:47
@github-actions github-actions bot mentioned this pull request Nov 23, 2025
10 tasks
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.

3 participants