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

Test: Move @storybook/test into storybook/test #30742

Merged
merged 24 commits into from
Mar 7, 2025

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Mar 3, 2025

Closes #

What I did

  • moved @storybook/test into storybook/test
  • adjusted the build pipeline of core to support noExternals like tsup does: 470119c
  • adjusted the build pipeline of core to output public packages (not namespaced with internal: f3b89cd
  • adjusted docs

Automigrations will follow in a separate PR

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-30742-sha-cd7cb3d8. 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-30742-sha-cd7cb3d8
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/move-lib-test-into-core
Commit cd7cb3d8
Datetime Wed Mar 5 14:18:08 UTC 2025 (1741184288)
Workflow run 13678057677

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 79.9 MB 79.9 MB -2 B 0.4 0%
initSize 79.9 MB 79.9 MB -2 B 0.4 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.57 MB 7.47 MB -93.1 kB -0.56 -1.2%
buildSbAddonsSize 1.98 MB 1.98 MB -3 B 1 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.23 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.06 MB 4.06 MB -3 B 1 0%
buildPreviewSize 3.51 MB 3.42 MB -93.1 kB -3.9 -2.7%
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 10.1s 20.8s 10.6s 0.53 51.1%
generateTime 20.5s 18s -2s -512ms -1.06 -13.9%
initTime 5.2s 4s -1s -153ms -1.64 🔰-28.2%
buildTime 10.2s 8s -2s -222ms -1.6 🔰-27.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.1s 5s -73ms -0.22 -1.5%
devManagerResponsive 4.8s 4.8s -90ms -0.21 -1.9%
devManagerHeaderVisible 780ms 837ms 57ms 0.12 6.8%
devManagerIndexVisible 792ms 904ms 112ms 0.3 12.4%
devStoryVisibleUncached 2.5s 2.8s 297ms 0.68 10.6%
devStoryVisible 1.1s 1.3s 197ms 0.45 14.3%
devAutodocsVisible 1.1s 1.2s 20ms 0.35 1.7%
devMDXVisible 1.1s 1.2s 98ms 0.15 8%
buildManagerHeaderVisible 797ms 768ms -29ms -0.84 -3.8%
buildManagerIndexVisible 811ms 775ms -36ms -0.88 -4.6%
buildStoryVisible 787ms 762ms -25ms -0.8 -3.3%
buildAutodocsVisible 718ms 760ms 42ms -0.32 5.5%
buildMDXVisible 762ms 748ms -14ms -0.18 -1.9%

Greptile Summary

This PR moves the @storybook/test package into the core Storybook repository, consolidating testing utilities and updating import paths across the codebase.

  • Moves all test package code from /code/lib/test to /code/core/src/test, including core testing utilities like expect, spy, and testing-library integrations
  • Updates import paths from '@storybook/test' to 'storybook/test' across all stories, tests and documentation
  • Removes @storybook/test from package dependencies since it's now part of core
  • Adds new test module exports and dependencies in core/package.json
  • Removes test package migration codemod and automigration scripts since they're no longer needed

Copy link

nx-cloud bot commented Mar 3, 2025

View your CI Pipeline Execution ↗ for commit 69bf931.

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

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

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.

300 file(s) reviewed, 35 comment(s)
Edit PR Review Bot Settings | Greptile

@valentinpalkovic valentinpalkovic force-pushed the valentin/move-lib-test-into-core branch from a58b712 to 75d043b Compare March 4, 2025 15:49
Base automatically changed from valentin/move-instrumenter-into-core to next March 5, 2025 07:18
@valentinpalkovic valentinpalkovic force-pushed the valentin/move-lib-test-into-core branch from 75d043b to 239ed1a Compare March 5, 2025 07:35
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Fails
🚫 PR is marked with "BREAKING CHANGE" label.

Generated by 🚫 dangerJS against 69bf931

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Mar 5, 2025

Package Benchmarks

Commit: 69bf931, ran on 7 March 2025 at 12:41:00 UTC

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

@storybook/addon-a11y

Before After Difference
Dependency count 51 3 🎉 -48 🎉
Self size 445 KB 445 KB 🎉 -44 B 🎉
Dependency size 12.05 MB 2.81 MB 🎉 -9.24 MB 🎉
Bundle Size Analyzer Link Link

@storybook/addon-interactions

Before After Difference
Dependency count 51 5 🎉 -46 🎉
Self size 129 KB 129 KB 🎉 -62 B 🎉
Dependency size 12.07 MB 3.11 MB 🎉 -8.96 MB 🎉
Bundle Size Analyzer Link Link

@storybook/addon-test

Before After Difference
Dependency count 55 9 🎉 -46 🎉
Self size 844 KB 844 KB 🎉 -44 B 🎉
Dependency size 13.52 MB 4.56 MB 🎉 -8.96 MB 🎉
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 51 98 🚨 +47 🚨
Self size 19.64 MB 21.54 MB 🚨 +1.90 MB 🚨
Dependency size 14.26 MB 21.69 MB 🚨 +7.43 MB 🚨
Bundle Size Analyzer Link Link

@storybook/experimental-nextjs-vite

Before After Difference
Dependency count 167 141 🎉 -26 🎉
Self size 215 KB 215 KB 🎉 -77 B 🎉
Dependency size 31.38 MB 39.37 MB 🚨 +7.98 MB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs

Before After Difference
Dependency count 572 540 🎉 -32 🎉
Self size 218 KB 218 KB 🎉 -57 B 🎉
Dependency size 66.13 MB 58.82 MB 🎉 -7.31 MB 🎉
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 124 122 🎉 -2 🎉
Self size 15 KB 15 KB 🎉 -127 B 🎉
Dependency size 20.48 MB 20.46 MB 🎉 -12 KB 🎉
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 52 99 🚨 +47 🚨
Self size 1 KB 1 KB 0 B
Dependency size 33.90 MB 43.24 MB 🚨 +9.34 MB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 356 388 🚨 +32 🚨
Self size 284 KB 282 KB 🎉 -2 KB 🎉
Dependency size 84.40 MB 93.24 MB 🚨 +8.83 MB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 274 309 🚨 +35 🚨
Self size 617 KB 614 KB 🎉 -3 KB 🎉
Dependency size 65.99 MB 74.84 MB 🚨 +8.85 MB 🚨
Bundle Size Analyzer Link Link

@valentinpalkovic valentinpalkovic force-pushed the valentin/move-lib-test-into-core branch from 3ad3509 to cd7cb3d Compare March 5, 2025 14:00
@valentinpalkovic valentinpalkovic force-pushed the valentin/move-lib-test-into-core branch from e513aa3 to e1a816c Compare March 5, 2025 14:35
Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

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

Docs changes are good! Thank you!!

@ndelangen ndelangen changed the title Test: Move @storybook/test into storybook Test: Move @storybook/test into storybook/test Mar 7, 2025
@valentinpalkovic valentinpalkovic merged commit 782d60c into next Mar 7, 2025
52 of 57 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/move-lib-test-into-core branch March 7, 2025 13:12
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