Addon-Vitest: Fix postinstall a11y installation#33888
Conversation
|
View your CI Pipeline Execution ↗ for commit 086dbce
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 086dbce ☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughBoth Yarn proxy implementations now support an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
✨ Finishing Touches
Comment |
There was a problem hiding this comment.
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 | 🟠 MajorForward ExecuteCommandOptions in the
npxpath.Line 67-71 drops
cwd,env,stdio,signal, andignoreErrorwhenuseRemotePkgis true. That changes runtime behavior vs. theyarn execpath 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.
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| 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 |
…a11y-setup-during-init Addon-Vitest: Fix postinstall a11y installation (cherry picked from commit f7649ed)
Closes #33844
What I did
Fixed an issue where packages were executed via
yarn exec, although the package contained a version. for this case, eithernpx(yarn 1) oryarn dlx(yarn berry) should be used.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated 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
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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam 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