Skip to content

Commit 1e1d19e

Browse files
Merge branch 'next' into valentin/use-latest-version-of-chromatic-com-storybook
2 parents 97a909a + 4af25ad commit 1e1d19e

File tree

537 files changed

+10708
-7424
lines changed

Some content is hidden

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

537 files changed

+10708
-7424
lines changed

.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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
## 9.0.10
2+
3+
- CLI: Add RN/RNW "both" init option - [#31778](https://github.com/storybookjs/storybook/pull/31778), thanks @shilman!
4+
- Nextjs-Vite: Use tsconfig paths plugin - [#31764](https://github.com/storybookjs/storybook/pull/31764), thanks @kasperpeulen!
5+
6+
## 9.0.9
7+
8+
- Angular: Update MiniCssExtractPlugin configuration for cache busting - [#31752](https://github.com/storybookjs/storybook/pull/31752), thanks @valentinpalkovic!
9+
- CSF: Story ComponentAnnotations['subcomponents'] to correctly use its own type for subcomponents rather than attempt to inherit from the component - [#31723](https://github.com/storybookjs/storybook/pull/31723), thanks @mihkeleidast!
10+
- Core: Delete shim addon packages - [#31728](https://github.com/storybookjs/storybook/pull/31728), thanks @ndelangen!
11+
- Core: Disable interactions debugger on composed stories to avoid cross-origin error - [#31685](https://github.com/storybookjs/storybook/pull/31685), thanks @ghengeveld!
12+
- Core: Fix cyclical dependency in core addons - [#31750](https://github.com/storybookjs/storybook/pull/31750), thanks @JReinhold!
13+
- Core: Restore original clipboard after invoking `userEvent.setup()` - [#31730](https://github.com/storybookjs/storybook/pull/31730), thanks @ghengeveld!
14+
- Next.js: Add webpack alias to resolve Next.js package conflicts - [#31755](https://github.com/storybookjs/storybook/pull/31755), thanks @valentinpalkovic!
15+
- Next.js: Enhance Vite configuration with styled-jsx aliasing - [#31757](https://github.com/storybookjs/storybook/pull/31757), thanks @valentinpalkovic!
16+
17+
## 9.0.8
18+
19+
- Addon Docs: Fix SyntaxHighlighter "Copy" button by avoiding potentially mocked clipboard - [#31682](https://github.com/storybookjs/storybook/pull/31682), thanks @ghengeveld!
20+
- Addon Themes: Define missing React dependencies - [#31688](https://github.com/storybookjs/storybook/pull/31688), thanks @ghengeveld!
21+
- Addon-vitest: Fix adding with `--skip-install` failing missing packageJson invariant - [#31720](https://github.com/storybookjs/storybook/pull/31720), thanks @JReinhold!
22+
- AddonDocs: Remove export of blocks - [#31724](https://github.com/storybookjs/storybook/pull/31724), thanks @ndelangen!
23+
- Automigration: Enhance removeEssentials to convert options - [#31658](https://github.com/storybookjs/storybook/pull/31658), thanks @ndelangen!
24+
- CLI: Don't install addon-onboarding during minimal installs - [#31616](https://github.com/storybookjs/storybook/pull/31616), thanks @ghengeveld!
25+
26+
> [!NOTE]
27+
> Version 9.0.7 was skipped because of a bad release of `eslint-plugin-storybook`.
28+
29+
## 9.0.6
30+
31+
- Addon Docs: Fix reference to global JSX namespace - [#31671](https://github.com/storybookjs/storybook/pull/31671), thanks @mrginglymus!
32+
- Angular: Improve Vite compatibility - [#31686](https://github.com/storybookjs/storybook/pull/31686), thanks @ndelangen!
33+
- Preview: Fix type issues - [#31537](https://github.com/storybookjs/storybook/pull/31537), thanks @mrginglymus!
34+
- Telemetry: Improve error handling - [#31656](https://github.com/storybookjs/storybook/pull/31656), thanks @ndelangen!
35+
36+
## 9.0.5
37+
38+
- Addon A11y: Briefly disable highlights while Axe is running - [#31621](https://github.com/storybookjs/storybook/pull/31621), thanks @ghengeveld!
39+
- CLI: Consider Storybook React Native packages in upgrade command - [#31645](https://github.com/storybookjs/storybook/pull/31645), thanks @yannbf!
40+
- Next.js: Fix module transpilation - [#31501](https://github.com/storybookjs/storybook/pull/31501), thanks @valentinpalkovic!
41+
- Svelte: Fix source view always using `<wrapper ...>` - [#31639](https://github.com/storybookjs/storybook/pull/31639), thanks @JReinhold!
42+
- Testing: Fix `toSatisfy`-matcher implementation - [#31664](https://github.com/storybookjs/storybook/pull/31664), thanks @ndelangen!
43+
144
## 9.0.4
245

346
- Addon Vitest: Fix path comparison on Windows - [#31630](https://github.com/storybookjs/storybook/pull/31630), thanks @valentinpalkovic!

CHANGELOG.prerelease.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
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+
137
## 9.1.0-alpha.2
238

339
- Addon-Vitest: Properly merge configs - [#31629](https://github.com/storybookjs/storybook/pull/31629), thanks @valentinpalkovic!

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.1.0-alpha.2",
3+
"version": "9.1.0-alpha.6",
44
"description": "Test component compliance with web accessibility standards",
55
"keywords": [
66
"a11y",

code/addons/a11y/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { definePreview } from 'storybook/preview-api';
1+
import { definePreviewAddon } from 'storybook/internal/csf';
22

33
import * as addonAnnotations from './preview';
4+
import type { A11yTypes } from './types';
45

56
export { PARAM_KEY } from './constants';
67
export * from './params';
7-
export type { A11yParameters } from './types';
8+
export type { A11yTypes } from './types';
89

9-
export default () => definePreview(addonAnnotations);
10+
export default () => definePreviewAddon<A11yTypes>(addonAnnotations);

code/addons/a11y/src/postinstall.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const $ = execa({
1111
});
1212

1313
export default async function postinstall(options: PostinstallOptions) {
14-
const command = ['storybook', 'automigrate', 'addonA11yAddonTest'];
14+
const command = ['storybook', 'automigrate', 'addon-a11y-addon-test'];
15+
16+
command.push('--loglevel', 'silent');
17+
command.push('--skip-doctor');
1518

1619
if (options.yes) {
1720
command.push('--yes');

code/addons/a11y/src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface A11yGlobals {
1919
*
2020
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
2121
*/
22-
a11y: {
22+
a11y?: {
2323
/**
2424
* Prevent the addon from executing automated accessibility checks upon visiting a story. You
2525
* can still trigger the checks from the addon panel.
@@ -51,3 +51,8 @@ export type EnhancedResults = Omit<AxeResults, 'incomplete' | 'passes' | 'violat
5151
passes: EnhancedResult[];
5252
violations: EnhancedResult[];
5353
};
54+
55+
export interface A11yTypes {
56+
parameters: A11yParameters;
57+
globals: A11yGlobals;
58+
}

0 commit comments

Comments
 (0)