Skip to content

Commit 3ef9c74

Browse files
Merge branch 'next' into fix/storybook-nextjs-array-params
2 parents 680de70 + 4af25ad commit 3ef9c74

File tree

1,108 files changed

+16737
-14262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,108 files changed

+16737
-14262
lines changed

.circleci/config.yml

Lines changed: 76 additions & 57 deletions
Large diffs are not rendered by default.

.cursor/environment.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"snapshot": "snapshot-20250521-0222c8bd-0a11-48ab-a2a8-380203843e05",
33
"install": "cd /workspace/scripts && yarn && cd ../code && yarn && yarn task --task=compile --start-from=compile",
4-
"start": "cd /workspace/code yarn test",
4+
"start": "cd /workspace/code && yarn test",
55
"terminals": []
6-
}
6+
}

.cursor/mcp.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"mcpServers": {
3+
"wallaby": {
4+
"command": "node",
5+
"args": [
6+
"~/.wallaby/mcp/"
7+
]
8+
}
9+
}
10+
}

.cursorrules

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Test Configuration
2+
3+
This Storybook repository uses Vitest as the test runner. Here are the key commands and configuration:
4+
5+
### Test Scripts
6+
7+
- `yarn test` - Run all tests (from root directory, delegates to `cd code; yarn test`)
8+
- `yarn test <test-name>` - Run focused tests matching the pattern
9+
- `yarn test:watch` - Run tests in watch mode
10+
- `yarn test:watch <test-name>` - Run focused tests in watch mode
11+
12+
### Test Directory Structure
13+
14+
- Tests are located in the `code/` directory
15+
- Vitest configuration is in `code/vitest.workspace.ts`
16+
- Test files typically follow the pattern `*.test.ts`, `*.test.tsx`, `*.spec.ts`, or `*.spec.tsx`
17+
18+
### Running Tests in Cursor
19+
20+
1. Use Cmd+Shift+P (or Ctrl+Shift+P) and search for "Tasks: Run Task"
21+
2. Select from the available test tasks:
22+
- "Run All Tests" - Runs all tests
23+
- "Run Test (Watch Mode)" - Runs tests in watch mode
24+
- "Run Focused Test" - Prompts for test name/pattern to run specific tests
25+
- "Run Focused Test (Watch Mode)" - Runs specific tests in watch mode
26+
27+
### Vitest Configuration
28+
29+
- Workspace configuration: `./code/vitest.workspace.ts`
30+
- Command line: `yarn --cwd code test`
31+
- Root directory for tests: `./code/`
32+
33+
### Test Execution Context
34+
35+
- Tests run from the `code/` directory
36+
- Use `NODE_OPTIONS=--max_old_space_size=4096` for memory optimization
37+
- Supports both watch mode and single-run execution
38+
39+
### Focused Test Patterns
40+
41+
When running focused tests, you can use:
42+
43+
- File names: `Button.test.ts`
44+
- Test descriptions: `"should render correctly"`
45+
- Directory patterns: `components/`
46+
- Vitest patterns: `-t "pattern"` for test name matching
47+
48+
### Test Mocking Rules
49+
50+
Follow the spy mocking rules defined in `.cursor/rules/spy-mocking.mdc` for consistent mocking patterns with Vitest.

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@
5050
"typescript.preferences.quoteStyle": "single",
5151
"typescript.preferGoToSourceDefinition": true,
5252
"typescript.tsdk": "./code/node_modules/typescript/lib",
53-
"vitest.workspaceConfig": "./code/vitest.workspace.ts"
53+
"vitest.workspaceConfig": "./code/vitest.workspace.ts",
54+
"vitest.rootConfig": "./code/vitest.workspace.ts",
5455
}

CHANGELOG.md

Lines changed: 332 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.prerelease.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
1+
## 9.1.0-alpha.6
2+
3+
- CLI: Fix package manager instantiation in empty directories - [#31743](https://github.com/storybookjs/storybook/pull/31743), thanks @yannbf!
4+
- CLI: Improve support for upgrading Storybook in monorepos - [#31557](https://github.com/storybookjs/storybook/pull/31557), thanks @yannbf!
5+
- CSF: Improve docs parameter types - [#31736](https://github.com/storybookjs/storybook/pull/31736), thanks @kasperpeulen!
6+
- Core: Delete shim addon packages - [#31728](https://github.com/storybookjs/storybook/pull/31728), thanks @ndelangen!
7+
8+
## 9.1.0-alpha.5
9+
10+
- Addon Themes: Define missing React dependencies - [#31688](https://github.com/storybookjs/storybook/pull/31688), thanks @ghengeveld!
11+
- Addon-vitest: Fix adding with `--skip-install` failing missing packageJson invariant - [#31720](https://github.com/storybookjs/storybook/pull/31720), thanks @JReinhold!
12+
- AddonDocs: Remove export of blocks - [#31724](https://github.com/storybookjs/storybook/pull/31724), thanks @ndelangen!
13+
- CSF: Only add preview annotations to definePreview in csf-factories automigration - [#31727](https://github.com/storybookjs/storybook/pull/31727), thanks @kasperpeulen!
14+
15+
## 9.1.0-alpha.4
16+
17+
- CSF Factories: Add parameters/globals types, `extend` API, portable stories - [#30601](https://github.com/storybookjs/storybook/pull/30601), thanks @kasperpeulen!
18+
19+
## 9.1.0-alpha.3
20+
21+
- Addon A11y: Briefly disable highlights while Axe is running - [#31621](https://github.com/storybookjs/storybook/pull/31621), thanks @ghengeveld!
22+
- Addon Docs: Fix SyntaxHighlighter "Copy" button by avoiding potentially mocked clipboard - [#31682](https://github.com/storybookjs/storybook/pull/31682), thanks @ghengeveld!
23+
- Addon Docs: Fix reference to global JSX namespace - [#31671](https://github.com/storybookjs/storybook/pull/31671), thanks @mrginglymus!
24+
- Addon Vitest: Fix path comparison on Windows - [#31630](https://github.com/storybookjs/storybook/pull/31630), thanks @valentinpalkovic!
25+
- Addon Vitest: Fix path comparison on Windows - [#31634](https://github.com/storybookjs/storybook/pull/31634), thanks @valentinpalkovic!
26+
- Angular: Improve Vite compatibility - [#31686](https://github.com/storybookjs/storybook/pull/31686), thanks @ndelangen!
27+
- Automigration: Enhance removeEssentials to convert options - [#31658](https://github.com/storybookjs/storybook/pull/31658), thanks @ndelangen!
28+
- CLI: Consider Storybook React Native packages in upgrade command - [#31645](https://github.com/storybookjs/storybook/pull/31645), thanks @yannbf!
29+
- CLI: Don't install addon-onboarding during minimal installs - [#31616](https://github.com/storybookjs/storybook/pull/31616), thanks @ghengeveld!
30+
- Next.js: Fix module transpilation - [#31501](https://github.com/storybookjs/storybook/pull/31501), thanks @valentinpalkovic!
31+
- Preview: Fix type issues - [#31537](https://github.com/storybookjs/storybook/pull/31537), thanks @mrginglymus!
32+
- Svelte: Fix source view always using `<wrapper ...>` - [#31639](https://github.com/storybookjs/storybook/pull/31639), thanks @JReinhold!
33+
- Telemetry: Fix `project.json` for getAbsolutePath - [#31510](https://github.com/storybookjs/storybook/pull/31510), thanks @ndelangen!
34+
- Telemetry: Improve error handling - [#31656](https://github.com/storybookjs/storybook/pull/31656), thanks @ndelangen!
35+
- Testing: Fix `toSatisfy`-matcher implementation - [#31664](https://github.com/storybookjs/storybook/pull/31664), thanks @ndelangen!
36+
37+
## 9.1.0-alpha.2
38+
39+
- Addon-Vitest: Properly merge configs - [#31629](https://github.com/storybookjs/storybook/pull/31629), thanks @valentinpalkovic!
40+
- Angular: Support v20 - [#31611](https://github.com/storybookjs/storybook/pull/31611), thanks @valentinpalkovic!
41+
- CLI: Respect --skip-install in postinstall scripts - [#31605](https://github.com/storybookjs/storybook/pull/31605), thanks @yannbf!
42+
- CLI: Update VTA version range for storybook init - [#31612](https://github.com/storybookjs/storybook/pull/31612), thanks @ghengeveld!
43+
- React Native Web: Include expo in babel transforms - [#31607](https://github.com/storybookjs/storybook/pull/31607), thanks @dannyhw!
44+
45+
## 9.1.0-alpha.1
46+
47+
- Angular: Include 20.x in version range - [#31602](https://github.com/storybookjs/storybook/pull/31602), thanks @shilman!
48+
- CLI: Update React Native init generator for v9 - [#31600](https://github.com/storybookjs/storybook/pull/31600), thanks @dannyhw!
49+
- Telemetry: Fix storybook version and add test run events - [#31473](https://github.com/storybookjs/storybook/pull/31473), thanks @tmeasday!
50+
51+
## 9.1.0-alpha.0
52+
53+
54+
## 9.0.0-rc.5
55+
56+
- Addon A11y: Improve selector automigration detection - [#31392](https://github.com/storybookjs/storybook/pull/31392), thanks @yannbf!
57+
- Addon Vitest: Support `vitest.projects.ts` file as workspace file during postinstall - [#31565](https://github.com/storybookjs/storybook/pull/31565), thanks @ghengeveld!
58+
- Addon-Vitest: Always clean coverage before (re)running - [#31540](https://github.com/storybookjs/storybook/pull/31540), thanks @JReinhold!
59+
- Automigration: Fix wrap require wrapper - [#31569](https://github.com/storybookjs/storybook/pull/31569), thanks @valentinpalkovic!
60+
- Controls: Remove empty state video link - [#31539](https://github.com/storybookjs/storybook/pull/31539), thanks @kylegach!
61+
- Presets: Use `.js` files when `.cjs` files are passed for entries that should be ESM - [#31556](https://github.com/storybookjs/storybook/pull/31556), thanks @JReinhold!
62+
- Pseudo States: Ignore escaped pseudo-class names - [#31515](https://github.com/storybookjs/storybook/pull/31515), thanks @sentience!
63+
164
## 9.0.0-rc.4
265

366
- Addon Vitest: Improve handling multiple browser mode projects - [#31508](https://github.com/storybookjs/storybook/pull/31508), thanks @yannbf!

MIGRATION.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [Vitest Addon (former @storybook/experimental-addon-test): Vitest 2.0 support is dropped](#vitest-addon-former-storybookexperimental-addon-test-vitest-20-support-is-dropped)
1818
- [Viewport/Backgrounds Addon synchronized configuration and `globals` usage](#viewportbackgrounds-addon-synchronized-configuration-and-globals-usage)
1919
- [Storysource Addon removed](#storysource-addon-removed)
20+
- [Mdx-gfm Addon removed](#mdx-gfm-addon-removed)
2021
- [API and Component Changes](#api-and-component-changes)
2122
- [Button Component API Changes](#button-component-api-changes)
2223
- [Icon System Updates](#icon-system-updates)
@@ -726,6 +727,10 @@ See here for the ways you have to configure addon viewports & backgrounds:
726727

727728
The `@storybook/addon-storysource` addon and the `@storybook/source-loader` package are removed in Storybook 9.0. Instead, Storybook now provides a Code Panel via `@storybook/addon-docs` that offers similar functionality with improved integration and performance.
728729

730+
#### Mdx-gfm Addon removed
731+
732+
The `@storybook/addon-mdx-gfm` addon is removed in Storybook 9.0 since it is no longer needed.
733+
729734
**Migration Steps:**
730735

731736
1. Remove the old addon
@@ -760,7 +765,6 @@ export const MyStory = {
760765
};
761766
```
762767

763-
764768
### API and Component Changes
765769

766770
#### Button Component API Changes
@@ -908,6 +912,15 @@ The package `@storybook/blocks` is no longer published as of Storybook 9.
908912

909913
All exports can now be found in the export `@storybook/addon-docs/blocks`.
910914

915+
Previously, you were able to import all blocks from `@storybook/addon-docs`, this is no longer the case.
916+
917+
This is the only correct import path:
918+
919+
```diff
920+
- import { Meta } from "@storybook/addon-docs";
921+
+ import { Meta } from "@storybook/addon-docs/blocks";
922+
```
923+
911924
### Configuration and Type Changes
912925

913926
#### Manager builder removed alias for `util`, `assert` and `process`
@@ -920,7 +933,6 @@ Adding these aliases meant storybook core, had to depend on these packages, whic
920933

921934
If you addon fails to load after this change, we recommend looking at implementing the alias at compile time of your addon, or alternatively look at other bundling config to ensure the correct entries/packages/dependencies are used.
922935

923-
924936
#### Type System Updates
925937

926938
The following types have been removed:
@@ -943,7 +955,6 @@ Deprecated getters have been removed from the CsfFile class:
943955
- `_fileName`
944956
- `_makeTitle`
945957

946-
947958
#### React-Native config dir renamed
948959

949960
In Storybook 9, React Native (RN) projects use the `.rnstorybook` config directory instead of `.storybook`.
@@ -1105,7 +1116,7 @@ To enable it, just set the feature flag in your `.storybook/main.<js|ts> file.
11051116
```tsx
11061117
export default {
11071118
features: {
1108-
angularFilterNonInputControls: true
1119+
angularFilterNonInputControls: true,
11091120
},
11101121
// ... other configurations
11111122
};

code/addons/a11y/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-a11y",
3-
"version": "9.0.0-rc.4",
3+
"version": "9.1.0-alpha.6",
44
"description": "Test component compliance with web accessibility standards",
55
"keywords": [
66
"a11y",

code/addons/a11y/src/a11yRunner.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const run = async (input: A11yParameters = DEFAULT_PARAMETERS, storyId: s
5656

5757
const context: ContextSpec = {
5858
include: document?.body,
59-
exclude: ['.sb-wrapper', '#storybook-docs'], // Internal Storybook elements that are always in the document
59+
exclude: ['.sb-wrapper', '#storybook-docs', '#storybook-highlights-root'], // Internal Storybook elements that are always in the document
6060
};
6161

6262
if (input.context) {
@@ -93,6 +93,11 @@ export const run = async (input: A11yParameters = DEFAULT_PARAMETERS, storyId: s
9393
axe.configure(configWithDefault);
9494

9595
return new Promise<AxeResults>((resolve, reject) => {
96+
const highlightsRoot = document?.getElementById('storybook-highlights-root');
97+
if (highlightsRoot) {
98+
highlightsRoot.style.display = 'none';
99+
}
100+
96101
const task = async () => {
97102
try {
98103
const result = await axe.run(context, options);
@@ -108,6 +113,10 @@ export const run = async (input: A11yParameters = DEFAULT_PARAMETERS, storyId: s
108113
if (!isRunning) {
109114
runNext();
110115
}
116+
117+
if (highlightsRoot) {
118+
highlightsRoot.style.display = '';
119+
}
111120
});
112121
};
113122

0 commit comments

Comments
 (0)