Skip to content
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

Addon A11y: Promote @storybook/global to full dependency #30723

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Feb 28, 2025

It appears as an import in the compiled code, so must be declared as a dependency

What I did

As ever, yarn pnp nagged me about this when using addon-test + addon-a11y + csf factories.

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 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 canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 79.9 MB 79.9 MB 0 B 0.54 0%
initSize 79.9 MB 79.9 MB 0 B 0.54 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.57 MB 7.57 MB 0 B 1.73 0%
buildSbAddonsSize 1.98 MB 1.98 MB 0 B 1.73 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.65 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.06 MB 4.06 MB 0 B 1.73 0%
buildPreviewSize 3.51 MB 3.51 MB 0 B 1.73 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 22.2s 26.3s 4s 1.1 15.5%
generateTime 18.8s 18s -837ms -0.8 -4.6%
initTime 4.4s 4.2s -147ms -0.72 -3.4%
buildTime 9s 8.3s -692ms -0.82 -8.3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.8s 4.3s -1s -513ms -1.08 -34.8%
devManagerResponsive 5.6s 4.1s -1s -412ms -1.07 -33.7%
devManagerHeaderVisible 975ms 635ms -340ms -1.21 -53.5%
devManagerIndexVisible 1s 710ms -354ms -0.94 -49.9%
devStoryVisibleUncached 2.6s 2.2s -372ms -0.86 -16.7%
devStoryVisible 1.5s 1s -475ms -0.85 -44.4%
devAutodocsVisible 1.2s 1s -258ms -0.6 -25%
devMDXVisible 1.3s 1.1s -225ms -0.45 -20.3%
buildManagerHeaderVisible 1s 914ms -127ms 0.4 -13.9%
buildManagerIndexVisible 1s 925ms -145ms 0.35 -15.7%
buildStoryVisible 1s 906ms -125ms 0.43 -13.8%
buildAutodocsVisible 1s 683ms -357ms -0.88 -52.3%
buildMDXVisible 911ms 670ms -241ms -0.79 -36%

Greptile Summary

This PR moves @storybook/global from devDependencies to dependencies in the addon-a11y package, ensuring proper runtime dependency resolution.

  • Changed @storybook/global from a development dependency to a runtime dependency in code/addons/a11y/package.json
  • The change is necessary because @storybook/global is imported in the compiled code (as seen in the stories files)
  • This prevents potential runtime errors when users install addon-a11y
  • Particularly important for yarn PnP environments which strictly enforce dependency boundaries

It appears as an import in the compiled code, so must be declared as a
dependency
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Feb 28, 2025

View your CI Pipeline Execution ↗ for commit 41c3764.

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

☁️ Nx Cloud last updated this comment at 2025-03-06 07:02:12 UTC

@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 6, 2025
@valentinpalkovic valentinpalkovic changed the title Promote @storybook/global to full dependency in addon-a11y Addon A11y: Promote @storybook/global to full dependency Mar 6, 2025
@valentinpalkovic valentinpalkovic merged commit 401902f into storybookjs:next Mar 6, 2025
53 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: a11y bug ci:normal patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants