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

Release: Prerelease 9.0.0-alpha.3 #30760

Merged
merged 142 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
1cf046b
Next.js: Use latest version when init in empty directory
valentinpalkovic Feb 25, 2025
5288f14
Upgrade image-size to 2.0
netroy Feb 25, 2025
5ee5ec4
Replace 'min' instead of 'm' in printDuration
wlewis-formative Feb 25, 2025
3ceb20b
ignore virtual modules
rChaoz Feb 25, 2025
738e528
ignore readFileSync error
rChaoz Feb 25, 2025
a937bc9
Promote @storybook/global to full dependency in addon-a11y
mrginglymus Feb 28, 2025
bd87cc5
Merge branch 'next' into valentin/fix-sandbox-generation-for-nextjs
valentinpalkovic Mar 2, 2025
29421c9
Refactor consolidated-imports fix with improved error handling and Ba…
ndelangen Mar 3, 2025
a849713
Update yarn.lock
valentinpalkovic Mar 3, 2025
6ce080e
Merge branch 'next' into valentin/update-image-size-for-nextjs
valentinpalkovic Mar 3, 2025
abd68a3
Merge branch 'next' into patch-1
JReinhold Mar 5, 2025
557c3f0
improve automigration
ndelangen Mar 5, 2025
efd8fad
Merge branch 'next' into norbert/automigrate-cpc-complaince
ndelangen Mar 5, 2025
9bcd854
Fix: Dynamically import p-limit in consolidated imports
ndelangen Mar 5, 2025
ded0706
Fix: Correct p-limit import syntax in consolidated imports
ndelangen Mar 5, 2025
ab2c87a
Refactor: Extract consolidated packages into a separate helper module
ndelangen Mar 5, 2025
ecb0ad8
Feature: Add consolidated package.json automigration fix
ndelangen Mar 5, 2025
b34c50a
Refactor: Remove unused import in consolidated package.json automigra…
ndelangen Mar 5, 2025
0064b85
Automigrate: Add consolidated package.json fix to allFixes array
ndelangen Mar 5, 2025
495a98a
Merge branch 'next' into norbert/automigrate-cpc-complaince
ndelangen Mar 5, 2025
6483b39
Core: Move @storybook/test into storybook
valentinpalkovic Mar 3, 2025
7ae3d68
Remove @storybook/test from package.jsons
valentinpalkovic Mar 3, 2025
d308781
Rename @storybook/test to storybook/test
valentinpalkovic Mar 3, 2025
11a91f4
Rename @storybook/test to storybook/test
valentinpalkovic Mar 3, 2025
25a7180
Leftover changes for storybook/test
valentinpalkovic Mar 3, 2025
c090abb
Support noExternal in core
valentinpalkovic Mar 4, 2025
5efa1de
Rearrange dependencies
valentinpalkovic Mar 4, 2025
b5626c9
Apply linting
valentinpalkovic Mar 4, 2025
72c984d
Use latest eslint canary
valentinpalkovic Mar 4, 2025
16dcbb7
Apply linting
valentinpalkovic Mar 4, 2025
e4762e2
Use stable version of eslint-plugin-storybook
valentinpalkovic Mar 5, 2025
5661278
Support public core APIs
valentinpalkovic Mar 5, 2025
6a74b92
Fix typos in docs
valentinpalkovic Mar 5, 2025
3abe8a7
Fix typo in auto blocker
valentinpalkovic Mar 5, 2025
4405dc9
Fix some left-over references
valentinpalkovic Mar 5, 2025
cf1677e
Update vite-plugin-storybook-nextjs
valentinpalkovic Mar 5, 2025
bf3d0b8
Fix unit tests
valentinpalkovic Mar 5, 2025
6bd5335
Sync package versions
valentinpalkovic Mar 5, 2025
e038b21
Fix portable stories
valentinpalkovic Mar 5, 2025
e1a816c
Fix E2E tests
valentinpalkovic Mar 5, 2025
4e5046a
Update CHANGELOG.md for v8.6.4 [skip ci]
storybook-bot Mar 5, 2025
4bc862f
Update vite-plugin-storybook-nextjs
valentinpalkovic Mar 6, 2025
47be500
Merge pull request #30659 from storybookjs/valentin/fix-sandbox-gener…
valentinpalkovic Mar 6, 2025
d442866
Merge branch 'next' into fix-print-duration
valentinpalkovic Mar 6, 2025
41c3764
Merge branch 'next' into a11y-dep-fix
valentinpalkovic Mar 6, 2025
6003bb8
Merge pull request #26838 from rChaoz/patch-1
JReinhold Mar 6, 2025
d91d89b
Merge branch 'next' into valentin/update-image-size-for-nextjs
valentinpalkovic Mar 6, 2025
82b2951
Merge pull request #30668 from wlewis-formative/fix-print-duration
valentinpalkovic Mar 6, 2025
586d659
Update yarn.lock
valentinpalkovic Mar 6, 2025
ea3aeb0
Refactor: Consolidate import and package.json migration fixes
ndelangen Mar 6, 2025
13bfc76
Merge branch 'next' into norbert/automigrate-cpc-complaince
ndelangen Mar 6, 2025
2eee9fd
Remove consolidated package.json migration fix
ndelangen Mar 6, 2025
34fc807
Automigrate: Add gitignore support to file globbing
ndelangen Mar 6, 2025
aac6929
Automigrate: Remove Storybook version addition to devDependencies
ndelangen Mar 6, 2025
9ab6361
Merge remote-tracking branch 'origin/next' into valentin/move-lib-tes…
valentinpalkovic Mar 6, 2025
6af03c2
Refactor: Simplify consolidated imports transformation
ndelangen Mar 6, 2025
1047465
Automigrate: Add custom glob pattern support for consolidated imports
ndelangen Mar 6, 2025
5e91a64
Automigrate: Add dependency installation for consolidated imports
ndelangen Mar 6, 2025
42f8105
Automigrate: Add '@storybook/test' to consolidated packages
ndelangen Mar 6, 2025
0bedebf
Automigrate: Add documentation for consolidated packages mapping
ndelangen Mar 6, 2025
c3bc0d2
Automigrate: Dynamically import p-limit for consolidated imports
ndelangen Mar 6, 2025
feeeab6
Automigrate: Remove dependencies field from BaseFix type
ndelangen Mar 6, 2025
a8450d7
Update code/lib/cli-storybook/src/automigrate/fixes/consolidated-impo…
ndelangen Mar 6, 2025
724be33
Merge pull request #30741 from storybookjs/valentin/update-image-size…
valentinpalkovic Mar 6, 2025
f0c282f
Migration: Document dropped support for legacy Storybook packages in …
ndelangen Mar 6, 2025
2c1c317
Addon Test: Improve unhandled errors message
yannbf Mar 5, 2025
3442715
update to vitest 3.0.8
yannbf Mar 6, 2025
401902f
Merge pull request #30723 from mrginglymus/a11y-dep-fix
valentinpalkovic Mar 6, 2025
e76640c
Merge branch 'next' into yann/vitest-unhandled-errors
yannbf Mar 7, 2025
2f968d5
Discard changes to test-storybooks/portable-stories-kitchen-sink/reac…
ndelangen Mar 7, 2025
d7a667f
Update MIGRATION.md
ndelangen Mar 7, 2025
3c2e105
Automigrate: Update missing Storybook dependencies check for 9.0
ndelangen Mar 7, 2025
965786d
Merge branch 'norbert/manual-cpc-migration' into norbert/fix-missingS…
ndelangen Mar 7, 2025
e8b9e59
Export Storybook React package in index.ts
ndelangen Mar 7, 2025
d46e15c
Update Storybook imports to use react-vite package
ndelangen Mar 7, 2025
89feffa
Update Storybook preview and bench stories to use react-vite types
ndelangen Mar 7, 2025
217dc11
Update story files to use '@storybook/react-vite' type imports
ndelangen Mar 7, 2025
9d3a70d
Update blocks package stories to use '@storybook/react-vite' imports
ndelangen Mar 7, 2025
4d4a83a
update vitest in addon test package
yannbf Mar 7, 2025
12c3351
Merge remote-tracking branch 'origin/next' into valentin/move-lib-tes…
valentinpalkovic Mar 7, 2025
9171647
Update Storybook manager stories to use '@storybook/react-vite' imports
ndelangen Mar 7, 2025
69bf931
Re-add lock file
valentinpalkovic Mar 7, 2025
ddeea7e
Refactor template file copying to use `templateLocation` parameter
ndelangen Mar 7, 2025
782d60c
Merge pull request #30742 from storybookjs/valentin/move-lib-test-int…
valentinpalkovic Mar 7, 2025
7d25490
Merge branch 'next' into norbert/automigrate-cpc-complaince
valentinpalkovic Mar 7, 2025
2213e7f
Update @storybook/test package mapping
valentinpalkovic Mar 7, 2025
c16f3df
Update Next.js Vite template stories to use '@storybook/experimental-…
ndelangen Mar 7, 2025
b4e0b3d
Update Next.js template stories to use '@storybook/nextjs' imports
ndelangen Mar 7, 2025
9fa6320
Update React Native Web Vite template stories to use '@storybook/reac…
ndelangen Mar 7, 2025
13c5234
Add Storybook template components for React Vite CLI
ndelangen Mar 7, 2025
920f8c2
Add HTML Vite template exports from Storybook HTML package
ndelangen Mar 7, 2025
5592d63
Export HTML Webpack 5 template core functionality from Storybook
ndelangen Mar 7, 2025
41860ed
Add additional exports to Next.js Storybook template index file
ndelangen Mar 7, 2025
4870635
Add Preact Vite template exports from Storybook Preact package
ndelangen Mar 7, 2025
bfedb85
Export Preact Webpack 5 template core functionality from Storybook
ndelangen Mar 7, 2025
660fd78
Export React core functionality in React Native Web Vite template
ndelangen Mar 7, 2025
0519e60
Support dot folders and adjust regex to support sub-paths
valentinpalkovic Mar 7, 2025
6e54389
Update framework template index files to export core Storybook packag…
ndelangen Mar 7, 2025
9aa6637
fix glob
yannbf Mar 7, 2025
ec7c826
Improve type safety and compatibility in Next.js Vite Storybook frame…
ndelangen Mar 7, 2025
e26712b
Add Storybook template components for Svelte Vite CLI
ndelangen Mar 7, 2025
97d6440
Add Storybook template components for Svelte Vite CLI with multiple v…
ndelangen Mar 7, 2025
7418c0e
Add Storybook template components for Vue3 Vite CLI with multiple var…
ndelangen Mar 7, 2025
543fbba
Add Vue3 Webpack5 Storybook template components for JavaScript and Ty…
ndelangen Mar 7, 2025
92237e7
Add Web Components Storybook template components for Vite and Webpack5
ndelangen Mar 7, 2025
46e4387
Merge branch 'norbert/automigrate-cpc-complaince' into norbert/manual…
ndelangen Mar 7, 2025
8c83d39
Merge branch 'norbert/manual-cpc-migration' into norbert/fix-missingS…
ndelangen Mar 7, 2025
ebf0df0
Merge branch 'norbert/fix-missingStorybookDependencies' into norbert/…
ndelangen Mar 7, 2025
338b629
Update package.json files to include template directory in published …
ndelangen Mar 7, 2025
3c3e423
Disable benchmark scripts
kasperpeulen Mar 7, 2025
4634b16
Merge branch 'next' into kasper/disable-benchmarks
kasperpeulen Mar 8, 2025
db97f68
Merge pull request #30775 from storybookjs/kasper/disable-benchmarks
kasperpeulen Mar 8, 2025
773405d
Update MIGRATION.md
valentinpalkovic Mar 9, 2025
c657af9
Merge pull request #30766 from storybookjs/norbert/manual-cpc-migration
valentinpalkovic Mar 10, 2025
24207c2
Merge pull request #30753 from storybookjs/norbert/automigrate-cpc-co…
valentinpalkovic Mar 10, 2025
e1add62
Merge branch 'next' into norbert/fix-missingStorybookDependencies
valentinpalkovic Mar 10, 2025
d522c0b
Merge branch 'norbert/fix-missingStorybookDependencies' into norbert/…
valentinpalkovic Mar 10, 2025
27012fe
don't use crypto.randomUUID in UniversalStore
JReinhold Mar 10, 2025
2d73181
Remove missingStorybookDependencies automigrate fix
ndelangen Mar 10, 2025
1428150
Merge branch 'norbert/fix-missingStorybookDependencies' into norbert/…
ndelangen Mar 10, 2025
f2fe3bd
Merge branch 'next' into yann/vitest-unhandled-errors
JReinhold Mar 10, 2025
60a6e5c
Merge pull request #30769 from storybookjs/norbert/fix-missingStorybo…
ndelangen Mar 10, 2025
ffbc5d8
Merge branch 'next' into norbert/re-export-renderers-from-frameworks
ndelangen Mar 10, 2025
be8df60
Merge pull request #30781 from storybookjs/jeppe/dont-use-crypto
JReinhold Mar 10, 2025
0d738c9
Merge pull request #30771 from storybookjs/norbert/re-export-renderer…
ndelangen Mar 10, 2025
09837b3
Pin svelte2tsx
kasperpeulen Mar 10, 2025
790b5d8
Merge pull request #30783 from storybookjs/kasper/pin-svelte2tsx
kasperpeulen Mar 10, 2025
c0b816b
use internalHelpers from svelte2tsx to get name of render function
JReinhold Mar 10, 2025
ab4aa24
Merge pull request #30755 from storybookjs/yann/vitest-unhandled-errors
JReinhold Mar 10, 2025
a50ff74
CLI: Fix test install in RNW projects
shilman Mar 10, 2025
bb2ad1a
Merge branch 'next' into shilman/fix-rnw-test-install
shilman Mar 10, 2025
81285e4
Merge branch 'next' into jeppe/fix-svelte2tsx
JReinhold Mar 11, 2025
2b407ae
Merge pull request #30786 from storybookjs/shilman/fix-rnw-test-install
shilman Mar 11, 2025
c4179a7
Add @angular-devkit/build-angular to default installed pacakages in a…
kasperpeulen Mar 11, 2025
b698036
Force @angular-devkit/build-angular @ next in prerelease sandbox
kasperpeulen Mar 11, 2025
cba56e9
Remove nxCloudAccessToken from nx.json
kasperpeulen Mar 11, 2025
8022616
Revert "Remove nxCloudAccessToken from nx.json"
kasperpeulen Mar 11, 2025
9c882d8
Handle non-storybook packages with a specific versions
kasperpeulen Mar 11, 2025
ba3e904
Merge pull request #30784 from storybookjs/jeppe/fix-svelte2tsx
JReinhold Mar 11, 2025
8a6b6ec
Adjust test
kasperpeulen Mar 11, 2025
dd24af9
Merge pull request #30790 from storybookjs/kasper/fix-prerelease
kasperpeulen Mar 11, 2025
fa13b91
Write changelog for 9.0.0-alpha.3 [skip ci]
storybook-bot Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 15 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,11 @@ workflows:
parallelism: 4
requires:
- create-sandboxes
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes
- test-ui-testing-module:
requires:
- build
Expand Down Expand Up @@ -965,10 +966,11 @@ workflows:
- test-init-features:
requires:
- build
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# parallelism: 4
Expand Down Expand Up @@ -1059,10 +1061,11 @@ workflows:
# --smoke-test is not supported for the angular builder right now
# - "angular-cli"
- "lit-vite-ts"
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes

# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 8.6.4

- Manager: Add Content-Type to fix Cloud IDEs - [#30606](https://github.com/storybookjs/storybook/pull/30606), thanks @GCHQDeveloper548!
- Vite: Include `node_modules` in stats file - [#30711](https://github.com/storybookjs/storybook/pull/30711), thanks @JReinhold!

## 8.6.3

- CSF Factories: Align addon-essentials import with other addons - [#30716](https://github.com/storybookjs/storybook/pull/30716), thanks @kasperpeulen!
Expand Down Expand Up @@ -37,7 +42,6 @@ Here’s what’s new:
- Addon-Test: Add telemetry data for Focused Tests - [#30568](https://github.com/storybookjs/storybook/pull/30568), thanks @JReinhold!
- Addon-Test: Fix config and watch mode inconsistencies - [#30491](https://github.com/storybookjs/storybook/pull/30491), thanks @JReinhold!
- Addon-Test: Fix console error in build mode - [#30625](https://github.com/storybookjs/storybook/pull/30625), thanks @JReinhold!
- Addon Test: Fix printing Date object in MethodCall for test/interactions log - [#30507](https://github.com/storybookjs/storybook/pull/30507), thanks @ghengeveld!
- Addon-Test: Make sure that only one global portable story config is ever loaded - [#30582](https://github.com/storybookjs/storybook/pull/30582), thanks @kasperpeulen!
- Angular: Fix accent character issue - [#30276](https://github.com/storybookjs/storybook/pull/30276), thanks @valentinpalkovic!
- Angular: Support experimental zoneless mode - [#28657](https://github.com/storybookjs/storybook/pull/28657), thanks @anedomansky!
Expand All @@ -46,7 +50,6 @@ Here’s what’s new:
- Builder-Vite: Fix runtime and iframe 404 on first load - [#30567](https://github.com/storybookjs/storybook/pull/30567), thanks @valentinpalkovic!
- Bun: Add support for text lock file - [#30160](https://github.com/storybookjs/storybook/pull/30160), thanks @Arctomachine!
- Cleanup: Remove unused constants in viewport addon - [#30479](https://github.com/storybookjs/storybook/pull/30479), thanks @Guria!
- CLI: Add "features" question & auto-install test addon & improve test-addon compatibility - [#30202](https://github.com/storybookjs/storybook/pull/30202), thanks @ndelangen!
- CLI: Don't initially select Documentation and Testing features - [#30599](https://github.com/storybookjs/storybook/pull/30599), thanks @ghengeveld!
- CLI: Fix peer dep issues for npm users during upgrade - [#30616](https://github.com/storybookjs/storybook/pull/30616), thanks @valentinpalkovic!
- CLI: Fix printing of selected features - [#30605](https://github.com/storybookjs/storybook/pull/30605), thanks @ghengeveld!
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 9.0.0-alpha.3

- Addon A11y: Promote @storybook/global to full dependency - [#30723](https://github.com/storybookjs/storybook/pull/30723), thanks @mrginglymus!
- Addon Test: Improve unhandled error messages - [#30755](https://github.com/storybookjs/storybook/pull/30755), thanks @yannbf!
- Angular: Add @angular-devkit/build-angular to default installed pacakages in angular - [#30790](https://github.com/storybookjs/storybook/pull/30790), thanks @kasperpeulen!
- Automigrate: Disable `missingStorybookDependencies` for 9.0 - [#30769](https://github.com/storybookjs/storybook/pull/30769), thanks @ndelangen!
- CLI: Fix test install in RNW projects - [#30786](https://github.com/storybookjs/storybook/pull/30786), thanks @shilman!
- Core: Re-Export renderers from frameworks - [#30771](https://github.com/storybookjs/storybook/pull/30771), thanks @ndelangen!
- Core: Replace 'min' instead of 'm' in printDuration - [#30668](https://github.com/storybookjs/storybook/pull/30668), thanks @wlewis-formative!
- Migration: Add auto-automigration for merged packages - [#30753](https://github.com/storybookjs/storybook/pull/30753), thanks @ndelangen!
- Next.js: Upgrade image-size to 2.0 - [#30741](https://github.com/storybookjs/storybook/pull/30741), thanks @valentinpalkovic!
- Next.js: Use latest version when init in empty directory - [#30659](https://github.com/storybookjs/storybook/pull/30659), thanks @valentinpalkovic!
- Svelte: Fix Vite crashing on virtual module imports - [#26838](https://github.com/storybookjs/storybook/pull/26838), thanks @rChaoz!
- Svelte: Fix automatic argTypes inference coming up empty with `[email protected]` - [#30784](https://github.com/storybookjs/storybook/pull/30784), thanks @JReinhold!
- Svelte: Pin svelte2tsx to solve argType regression - [#30783](https://github.com/storybookjs/storybook/pull/30783), thanks @kasperpeulen!
- Test: Move `@storybook/test` into `storybook/test` - [#30742](https://github.com/storybookjs/storybook/pull/30742), thanks @valentinpalkovic!
- Universal Store: Don't use `crypto.randomUUID` - [#30781](https://github.com/storybookjs/storybook/pull/30781), thanks @JReinhold!

## 9.0.0-alpha.2

- AutoBlocker: Add major version upgrade blocker - [#30714](https://github.com/storybookjs/storybook/pull/30714), thanks @ndelangen!
Expand Down
40 changes: 40 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h1>Migration</h1>

- [From version 8.x to 9.0.0](#from-version-8x-to-900)
- [Dropped support for legacy packages](#dropped-support-for-legacy-packages)
- [Dropped support for TypeScript \< 4.9](#dropped-support-for-typescript--49)
- [Test addon renamed from experimental to stable](#test-addon-renamed-from-experimental-to-stable)
- [From version 8.5.x to 8.6.x](#from-version-85x-to-86x)
Expand Down Expand Up @@ -436,6 +437,45 @@

## From version 8.x to 9.0.0

### Dropped support for legacy packages

The following packages are no longer published as part of `9.0.0`:
The following packages have been consolidated into the main `storybook` package:

| Old Package | New Path |
| ---------------------- | ------------------------------ |
| @storybook/manager-api | storybook/manager-api |
| @storybook/preview-api | storybook/preview-api |
| @storybook/theming | storybook/theming |
| @storybook/test | storybook/test |

Please un-install these packages, and ensure you have the `storybook` package installed.

Replace any imports with the path listed in the second column.

Additionally the following packages were also consolidated and placed under a `/internal` sub-path, to indicate they are for internal usage only.
If you're depending on these packages, they will continue to work for `9.0`, but they will likely be removed in `10.0`.

| Old Package | New Path |
| -------------------------- | ---------------------------------- |
| @storybook/channels | storybook/internal/channels |
| @storybook/client-logger | storybook/internal/client-logger |
| @storybook/core-common | storybook/internal/common |
| @storybook/core-events | storybook/internal/core-events |
| @storybook/csf-tools | storybook/internal/csf-tools |
| @storybook/docs-tools | storybook/internal/docs-tools |
| @storybook/node-logger | storybook/internal/node-logger |
| @storybook/router | storybook/internal/router |
| @storybook/telemetry | storybook/internal/telemetry |
| @storybook/types | storybook/internal/types |
| @storybook/manager | storybook/internal/manager |
| @storybook/preview | storybook/internal/preview |
| @storybook/core-server | storybook/internal/core-server |
| @storybook/builder-manager | storybook/internal/builder-manager |
| @storybook/components | storybook/internal/components |

Addon authors may continue to use the internal packages, there is currently not yet any replacement.

### Dropped support for TypeScript < 4.9

Storybook now requires TypeScript 4.9 or later. If you're using an older version of TypeScript, you'll need to upgrade to continue using Storybook.
Expand Down
2 changes: 1 addition & 1 deletion code/.storybook/bench.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import type { Meta } from '@storybook/react';
import type { Meta } from '@storybook/react-vite';

// @ts-expect-error - TS doesn't know about import.meta.glob from Vite
const allMetafiles = import.meta.glob([
Expand Down
2 changes: 1 addition & 1 deletion code/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {

import { DocsContext } from '@storybook/blocks';
import { global } from '@storybook/global';
import type { Decorator, Loader, ReactRenderer } from '@storybook/react';

import type { Decorator, Loader, ReactRenderer } from '@storybook/react-vite';
// TODO add empty preview
// import * as storysource from '@storybook/addon-storysource';
// import * as designs from '@storybook/addon-designs/preview';
Expand Down
3 changes: 2 additions & 1 deletion code/.storybook/storybook.setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { beforeAll, vi, expect as vitestExpect } from 'vitest';

import { setProjectAnnotations } from '@storybook/react';
import { userEvent as storybookEvent, expect as storybookExpect } from '@storybook/test';

import { userEvent as storybookEvent, expect as storybookExpect } from 'storybook/test';

import preview from './preview';

Expand Down
18 changes: 9 additions & 9 deletions code/.storybook/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defaultExclude, defineProject, mergeConfig } from 'vitest/config';

import { storybookTest } from '@storybook/addon-test/vitest-plugin';

import Inspect from 'vite-plugin-inspect';

import { vitestCommonConfig } from '../vitest.workspace';
Expand All @@ -22,14 +24,12 @@ export default mergeConfig(
// @ts-expect-error added this because of testNamePattern below
defineProject({
plugins: [
import('@storybook/addon-test/vitest-plugin').then(({ storybookTest }) =>
storybookTest({
configDir: __dirname,
tags: {
include: ['vitest'],
},
})
),
storybookTest({
configDir: __dirname,
tags: {
include: ['vitest'],
},
}),
...extraPlugins,
],
test: {
Expand All @@ -40,7 +40,7 @@ export default mergeConfig(
'**/__mockdata__/**',
'../**/__mockdata__/**',
'**/Zoom.stories.tsx', // expected to fail in Vitest because of fetching /iframe.html to cause ECONNREFUSED
'**/lib/blocks/src/**', // won't work because of https://github.com/storybookjs/storybook/issues/29783
'../lib/blocks/src/**', // won't work because of https://github.com/storybookjs/storybook/issues/29783
],
// TODO: bring this back once portable stories support storybook/internal/preview-api hooks
// @ts-expect-error this type does not exist but the property does!
Expand Down
3 changes: 1 addition & 2 deletions code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@
},
"dependencies": {
"@storybook/addon-highlight": "workspace:*",
"@storybook/test": "workspace:*",
"@storybook/global": "^5.0.0",
"axe-core": "^4.2.0"
},
"devDependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.12",
"@testing-library/react": "^14.0.0",
"execa": "^9.5.2",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/A11YPanel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React from 'react';
import { ManagerContext } from 'storybook/internal/manager-api';
import { ThemeProvider, convert, themes } from 'storybook/internal/theming';

import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/react-vite';

import type axe from 'axe-core';
import { fn } from 'storybook/test';

import { A11YPanel } from './A11YPanel';
import { A11yContext } from './A11yContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';

import { ManagerContext } from 'storybook/internal/manager-api';

import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/react-vite';

import { fn } from 'storybook/test';

import { TestDiscrepancyMessage } from './TestDiscrepancyMessage';

Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AfterEach } from 'storybook/internal/types';

import { expect } from '@storybook/test';
import { expect } from 'storybook/test';

import { run } from './a11yRunner';
import type { A11yParameters } from './params';
Expand Down Expand Up @@ -64,7 +64,7 @@ export const experimental_afterEach: AfterEach<any> = async ({
vitestMatchersExtended = true;
}

// @ts-expect-error - todo - fix type extension of expect from @storybook/test
// @ts-expect-error - todo - fix type extension of expect from storybook/test
expect(result).toHaveNoViolations();
}
}
Expand Down
1 change: 0 additions & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@storybook/test": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-inspector": "^6.0.0",
Expand Down
3 changes: 2 additions & 1 deletion code/addons/actions/src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import type { LoaderFunction } from 'storybook/internal/types';

import { global } from '@storybook/global';
import type { onMockCall as onMockCallType } from '@storybook/test';

import type { onMockCall as onMockCallType } from 'storybook/test';

import { action } from './runtime';

Expand Down
3 changes: 2 additions & 1 deletion code/addons/actions/template/stories/spies.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { global as globalThis } from '@storybook/global';
import { spyOn } from '@storybook/test';

import { spyOn } from 'storybook/test';

const meta = {
component: globalThis.Components.Button,
Expand Down
5 changes: 3 additions & 2 deletions code/addons/controls/src/SaveStory.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';

import type { Meta, StoryObj } from '@storybook/react';
import { expect, fireEvent, fn, userEvent, within } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/react-vite';

import { action } from '@storybook/addon-actions';

import { expect, fireEvent, fn, userEvent, within } from 'storybook/test';

import { SaveStory } from './SaveStory';

const meta = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as ReactExport from 'react';
import * as ReactDom from 'react-dom';
import * as ReactDomServer from 'react-dom/server';

import { expect, within } from '@storybook/test';
import { expect, within } from 'storybook/test';

/**
* This component is used to display the resolved version of React and its related packages. As long
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, within } from '@storybook/test';
import { expect, within } from 'storybook/test';

export default {
component: globalThis.Components.Pre,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fn } from '@storybook/test';
import { fn } from 'storybook/test';

export default {
component: globalThis.Components.Button,
Expand Down
6 changes: 3 additions & 3 deletions code/addons/interactions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Storybook Addon Interactions enables visual debugging of interactions and tests
Install this addon by adding the `@storybook/addon-interactions` dependency:

```sh
yarn add -D @storybook/addon-interactions @storybook/test
yarn add -D @storybook/addon-interactions
```

within `.storybook/main.js`:
Expand All @@ -24,10 +24,10 @@ Note that `@storybook/addon-interactions` must be listed **after** `@storybook/a

## Usage

Interactions relies on "instrumented" versions of Vitest and Testing Library, that you import from `@storybook/test` instead of their original package. You can then use these libraries in your `play` function.
Interactions relies on "instrumented" versions of Vitest and Testing Library, that you import from `storybook/test` instead of their original package. You can then use these libraries in your `play` function.

```js
import { expect, fn, userEvent, within } from '@storybook/test';
import { expect, fn, userEvent, within } from 'storybook/test';
import { Button } from './Button';

export default {
Expand Down
1 change: 0 additions & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/test": "workspace:*",
"polished": "^4.2.2",
"ts-dedent": "^2.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { CallStates } from 'storybook/internal/instrumenter';

import type { Meta, StoryObj } from '@storybook/react';
import { expect, userEvent, within } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/react-vite';

import { expect, userEvent, within } from 'storybook/test';

import { getCalls } from '../mocks';
import { Interaction } from './Interaction';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React from 'react';
import { CallStates } from 'storybook/internal/instrumenter';
import { styled } from 'storybook/internal/theming';

import type { Meta, StoryObj } from '@storybook/react';
import { expect, userEvent, waitFor, within } from '@storybook/test';
import type { Meta, StoryObj } from '@storybook/react-vite';

import { expect, userEvent, waitFor, within } from 'storybook/test';

import { isChromatic } from '../../../../.storybook/isChromatic';
import { getCalls, getInteractions } from '../mocks';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { PlayFunction, StepLabel, StepRunner, StoryContext } from 'storyboo

// This makes sure that storybook test loaders are always loaded when addon-interactions is used
// For 9.0 we want to merge storybook/test and addon-interactions into one addon.
import '@storybook/test';
import 'storybook/test';

import type { InteractionsParameters } from './types';

Expand Down
Loading