Skip to content

Addon-Vitest: Fix postinstall a11y installation#33888

Merged
valentinpalkovic merged 1 commit into
nextfrom
valentin/fix-addon-vitest-a11y-setup-during-init
Feb 23, 2026
Merged

Addon-Vitest: Fix postinstall a11y installation#33888
valentinpalkovic merged 1 commit into
nextfrom
valentin/fix-addon-vitest-a11y-setup-during-init

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented Feb 20, 2026

Closes #33844

What I did

Fixed an issue where packages were executed via yarn exec, although the package contained a version. for this case, either npx (yarn 1) or yarn dlx (yarn berry) should be used.

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

Caution

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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

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

Summary by CodeRabbit

  • New Features
    • Added optional parameter to support alternative remote package execution methods in Yarn package managers, enabling users to choose between standard and direct execution modes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2026

Fails
🚫 The "#### Manual testing" section must be filled in. Please describe how to test the changes you've made, step by step, so that reviewers can confirm your PR works as intended.

Generated by 🚫 dangerJS against 086dbce

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Feb 20, 2026

View your CI Pipeline Execution ↗ for commit 086dbce

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ❌ Failed 13m 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-23 14:16:36 UTC

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Feb 20, 2026

View your CI Pipeline Execution ↗ for commit 086dbce


☁️ Nx Cloud last updated this comment at 2026-02-20 13:07:14 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

Both Yarn proxy implementations now support an optional useRemotePkg flag in their runPackageCommand method. When enabled, commands execute via npx (Yarn1) or dlx (Yarn2) directly instead of through yarn's exec subcommand, bypassing the package manager wrapper.

Changes

Cohort / File(s) Summary
Package Manager Proxy Updates
code/core/src/common/js-package-manager/Yarn1Proxy.ts, code/core/src/common/js-package-manager/Yarn2Proxy.ts
Added optional useRemotePkg?: boolean parameter to runPackageCommand method. When true, executes command via npx/dlx directly; defaults to false preserving existing yarn exec behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • storybookjs/storybook#33718: Directly related PR that modifies the js-package-manager API to add the same useRemotePkg flag for selecting dlx/npx execution behavior.
✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
code/core/src/common/js-package-manager/Yarn1Proxy.ts (1)

58-77: ⚠️ Potential issue | 🟠 Major

Forward ExecuteCommandOptions in the npx path.

Line 67-71 drops cwd, env, stdio, signal, and ignoreError when useRemotePkg is true. That changes runtime behavior vs. the yarn exec path and can break callers that rely on those options.

🛠️ Proposed fix
     if (useRemotePkg) {
       return executeCommand({
         command: 'npx',
         args,
+        ...options,
       });
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code/core/src/common/js-package-manager/Yarn1Proxy.ts` around lines 58 - 77,
The npx branch in Yarn1Proxy.runPackageCommand is not forwarding
ExecuteCommandOptions (cwd, env, stdio, signal, ignoreError) causing different
runtime behavior; modify the useRemotePkg path so it calls executeCommand with
command: 'npx', args: args, and spreads the remaining options (i.e., include
...options) so the same ExecuteCommandOptions passed into runPackageCommand
reach executeCommand; keep destructuring of args/useRemotePkg as-is and ensure
no duplicate/conflicting fields are created when merging options.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@code/core/src/common/js-package-manager/Yarn1Proxy.ts`:
- Around line 58-77: The npx branch in Yarn1Proxy.runPackageCommand is not
forwarding ExecuteCommandOptions (cwd, env, stdio, signal, ignoreError) causing
different runtime behavior; modify the useRemotePkg path so it calls
executeCommand with command: 'npx', args: args, and spreads the remaining
options (i.e., include ...options) so the same ExecuteCommandOptions passed into
runPackageCommand reach executeCommand; keep destructuring of args/useRemotePkg
as-is and ensure no duplicate/conflicting fields are created when merging
options.

@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Feb 23, 2026
@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 086dbce, ran on 23 February 2026 at 14:16:52 UTC

The following packages have significant changes to their size or dependencies:

@storybook/nextjs

Before After Difference
Dependency count 535 535 0
Self size 648 KB 648 KB 🎉 -240 B 🎉
Dependency size 59.87 MB 59.91 MB 🚨 +37 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs-vite

Before After Difference
Dependency count 92 92 0
Self size 1.12 MB 1.12 MB 0 B
Dependency size 22.39 MB 22.43 MB 🚨 +37 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 124 124 0
Self size 30 KB 30 KB 0 B
Dependency size 23.68 MB 23.72 MB 🚨 +37 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 82 82 0
Self size 35 KB 35 KB 0 B
Dependency size 20.18 MB 20.21 MB 🚨 +37 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-webpack5

Before After Difference
Dependency count 274 274 0
Self size 24 KB 24 KB 🚨 +12 B 🚨
Dependency size 44.54 MB 44.57 MB 🚨 +37 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react

Before After Difference
Dependency count 58 57 🎉 -1 🎉
Self size 1.19 MB 1.23 MB 🚨 +37 KB 🚨
Dependency size 13.20 MB 12.94 MB 🎉 -264 KB 🎉
Bundle Size Analyzer Link Link

@valentinpalkovic valentinpalkovic merged commit f7649ed into next Feb 23, 2026
128 of 145 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-addon-vitest-a11y-setup-during-init branch February 23, 2026 16:01
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Core Team Projects Feb 23, 2026
valentinpalkovic added a commit that referenced this pull request Feb 23, 2026
…a11y-setup-during-init

Addon-Vitest: Fix postinstall a11y installation
(cherry picked from commit f7649ed)
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon: vitest bug ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Storybook React Native Web - Issue with Testing addons installation

2 participants