Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
0dc8429
Build: Add automatic parallelism fixing in CircleCI workflows
yannbf Oct 9, 2025
1c793c7
Apply suggestion from @valentinpalkovic
yannbf Oct 13, 2025
e78edc0
Merge branch 'next' into yann/autofix-parallelism-command
yannbf Oct 13, 2025
fa3d7c6
cleanup: unnecessary wording of error message
achesin Oct 30, 2025
2943418
docs: fix grammar in readme.md
WuMingDao Nov 11, 2025
76274f5
Update cli-options.mdx
nnt1054 Nov 12, 2025
e062f38
CLI: In csf-factories codemod only remove types which are unused
yannbf Nov 12, 2025
3f45de5
Use fixed stack trace in errors in stories
yannbf Nov 12, 2025
9cff188
try to get less flake
yannbf Nov 12, 2025
63fdf93
Merge branch 'next' into yann/do-not-remove-used-types-csf-factories
yannbf Nov 12, 2025
de2ef2b
Merge branch 'next' into yann/reduce-flake-stories
yannbf Nov 13, 2025
b134cf3
Merge branch 'next' into yann/do-not-remove-used-types-csf-factories
yannbf Nov 13, 2025
82deb7a
extract and rework type removal logic
yannbf Nov 13, 2025
9bb3222
Merge branch 'next' into yann/reduce-flake-stories
yannbf Nov 13, 2025
af2326b
use diff in test
yannbf Nov 13, 2025
709bbf1
fix flake
yannbf Nov 13, 2025
15cd7cb
Merge branch 'yann/reduce-flake-stories' of github.com:storybookjs/st…
yannbf Nov 13, 2025
6935742
try to fix flake
yannbf Nov 13, 2025
ff0e4b6
fix windows failure
yannbf Nov 13, 2025
a7bedcd
Use Norbert's AI solution
yannbf Nov 14, 2025
61612bd
Merge branch 'yann/do-not-remove-used-types-csf-factories' of github.…
yannbf Nov 14, 2025
bc61ca4
update tests
yannbf Nov 14, 2025
28fb7ec
perf(ci): remove local Danger Docker build and use ghcr.io runtime
yoshi-taka Nov 15, 2025
8ece7fd
Merge branch 'next' into yann/do-not-remove-used-types-csf-factories
yannbf Nov 15, 2025
5cf9a78
Merge branch 'next' into yann/reduce-flake-stories
yannbf Nov 15, 2025
79665ee
Revert "fix flake"
yannbf Nov 15, 2025
e36c039
debug
yannbf Nov 15, 2025
aef4ddf
Revert "debug"
yannbf Nov 15, 2025
e3df3ad
CLI: Cleanup comments in Vue templates
jonniebigodes Nov 15, 2025
66f72e6
Merge pull request #33033 from storybookjs/yann/reduce-flake-stories
yannbf Nov 17, 2025
4f5d905
Update nx to 22
kasperpeulen Nov 17, 2025
7f6b5c7
Fix
kasperpeulen Nov 17, 2025
9eeb760
Update CHANGELOG.md for v10.0.8 [skip ci]
storybook-bot Nov 17, 2025
29f69d6
Merge pull request #32685 from storybookjs/yann/autofix-parallelism-c…
valentinpalkovic Nov 17, 2025
fae07b4
Merge branch 'next-release' into next
storybook-bot Nov 17, 2025
5befe59
Merge branch 'next' into fix_cli_templates
jonniebigodes Nov 17, 2025
115540c
Merge branch 'next' into patch-1
jonniebigodes Nov 17, 2025
84f7439
Merge pull request #33008 from WuMingDao/patch-1
jonniebigodes Nov 17, 2025
20d9031
Merge branch 'next' into somehowRemoval
jonniebigodes Nov 17, 2025
0611f9b
Merge pull request #32945 from achesin/somehowRemoval
jonniebigodes Nov 17, 2025
e99696e
Merge branch 'next' into fix_cli_templates
jonniebigodes Nov 17, 2025
5329d93
Merge pull request #33054 from storybookjs/fix_cli_templates
jonniebigodes Nov 17, 2025
45454a5
Docs: Fix broken links in Jest portable stories
jonniebigodes Nov 17, 2025
8f6ab08
Merge pull request #33066 from storybookjs/docs_fix_links_portable_st…
jonniebigodes Nov 17, 2025
8039635
Merge branch 'next' into patch-1
jonniebigodes Nov 17, 2025
0085130
Merge branch 'next' into dangerfile
ndelangen Nov 18, 2025
1005643
Merge pull request #33051 from yoshi-taka/dangerfile
ndelangen Nov 18, 2025
9734833
remove unused
ndelangen Nov 18, 2025
6222a0d
Merge pull request #33020 from storybookjs/yann/do-not-remove-used-ty…
yannbf Nov 18, 2025
2468581
Merge branch 'next' into patch-1
jonniebigodes Nov 18, 2025
485debc
Update docs/api/cli-options.mdx
jonniebigodes Nov 18, 2025
6f65dbc
React: Improve import rewriting when tsconfig paths are used
kasperpeulen Nov 18, 2025
5103e0e
Refactor Dangerfile: Consolidate label checks and improve readability
ndelangen Nov 18, 2025
6a32c54
Update code/renderers/react/src/componentManifest/valid-package-name.ts
kasperpeulen Nov 18, 2025
665e623
Refactor Dangerfile: Replace async file read with synchronous read an…
ndelangen Nov 18, 2025
84e6b2d
Update code/renderers/react/src/componentManifest/valid-package-name.ts
kasperpeulen Nov 18, 2025
7459e35
Update Dangerfile configuration: Change dangerfile path to use .cts e…
ndelangen Nov 18, 2025
124543b
Update Dangerfile configuration: Change dangerfile path to use .cjs e…
ndelangen Nov 18, 2025
61ea592
Initial plan
Copilot Nov 18, 2025
53c5f08
Refactor Dangerfile: Update import statements and simplify package.js…
ndelangen Nov 18, 2025
0706514
disable type checking on explicit files
ndelangen Nov 18, 2025
a9c37f6
Update Dangerfile configuration: Change dangerfile path to use .js ex…
ndelangen Nov 18, 2025
bea320c
Add test for unscoped package subpath (valid bare specifier)
Copilot Nov 18, 2025
bb4be98
Merge pull request #33075 from storybookjs/copilot/sub-pr-33072
kasperpeulen Nov 18, 2025
a8643bd
Fix regex
kasperpeulen Nov 18, 2025
3280e08
Merge pull request #33073 from storybookjs/norbert/danger-fix
ndelangen Nov 18, 2025
bf50ed9
Merge remote-tracking branch 'origin/kasper/imports' into kasper/imports
kasperpeulen Nov 18, 2025
ee9b699
Merge remote-tracking branch 'origin/next' into kasper/nx-up
kasperpeulen Nov 18, 2025
abdc858
Merge branch 'next' into kasper/imports
kasperpeulen Nov 18, 2025
da3a563
Merge pull request #33072 from storybookjs/kasper/imports
kasperpeulen Nov 18, 2025
25748ce
Merge branch 'next' into patch-1
jonniebigodes Nov 18, 2025
9aa32ff
Merge remote-tracking branch 'origin/next' into kasper/nx-up
kasperpeulen Nov 18, 2025
285c3d7
Merge pull request #33059 from storybookjs/kasper/nx-up
kasperpeulen Nov 18, 2025
0c0280a
Merge branch 'next' into patch-1
jonniebigodes Nov 18, 2025
e79c9b2
Merge pull request #33013 from nnt1054/patch-1
jonniebigodes Nov 18, 2025
c82dc68
Docs: Fix SolidJs reactivity link
jonniebigodes Nov 18, 2025
6658d21
Merge pull request #33083 from storybookjs/docs_fix_solid_reference_link
jonniebigodes Nov 19, 2025
2a5948b
Update dependencies in yarn.lock and clean up comments in scripts
ndelangen Nov 19, 2025
ed1de60
Merge pull request #33089 from storybookjs/norbert/fixing-linting-on-…
yannbf Nov 19, 2025
824ad81
Write changelog for 10.1.0-alpha.12 [skip ci]
storybook-bot Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/danger-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Danger JS
uses: danger/danger-js@11.2.6
uses: docker://ghcr.io/danger/danger-js:13.0.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --dangerfile scripts/dangerfile.ts
args: --dangerfile scripts/dangerfile.js
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 10.0.8

- React Native Web: Fix react native resuables and nativewind - [#33056](https://github.com/storybookjs/storybook/pull/33056), thanks @dannyhw!
- React Native Web: Update vite-plugin-rnw for overall improvements - [#32991](https://github.com/storybookjs/storybook/pull/32991), thanks @dannyhw!
- WebComponents: Fix `custom-elements.json` not being loaded - [#33045](https://github.com/storybookjs/storybook/pull/33045), thanks @ndelangen!

## 10.0.7

- ESLint: Only apply csf-strict rules on stories files - [#31963](https://github.com/storybookjs/storybook/pull/31963), thanks @cylewaitforit!
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 10.1.0-alpha.12

- Build: Update dependencies in yarn.lock and clean up comments - [#33089](https://github.com/storybookjs/storybook/pull/33089), thanks @ndelangen!
- CLI: In csf-factories codemod only remove types which are unused - [#33020](https://github.com/storybookjs/storybook/pull/33020), thanks @yannbf!
- React: Improve import rewriting when tsconfig paths are used - [#33072](https://github.com/storybookjs/storybook/pull/33072), thanks @kasperpeulen!

## 10.1.0-alpha.11

- Maintenance: Enable syntax minification for dead code elimination - [#33001](https://github.com/storybookjs/storybook/pull/33001), thanks @mrginglymus!
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Contributions to Storybook are always welcome!
Looking for a first issue to tackle?

- We tag issues with [![Good First Issue](https://img.shields.io/github/issues/storybookjs/storybook/good%20first%20issue.svg)](https://github.com/storybookjs/storybook/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) when we think they are well suited for people who are new to the codebase or OSS in general.
- [Talk to us](https://discord.gg/storybook), we'll find something that suits your skills and learning interest.
- [Talk to us](https://discord.gg/storybook), we'll find something that suits your skills and learning interests.

### Development scripts

Expand Down
3 changes: 3 additions & 0 deletions code/addons/docs/src/blocks/blocks/Stories.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const meta = {
parameters: {
layout: 'fullscreen',
docsStyles: true,
chromatic: {
delay: 2000,
},
},
} satisfies Meta<typeof Stories>;

Expand Down
12 changes: 11 additions & 1 deletion code/addons/docs/template/stories/docspage/error.stories.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable local-rules/no-uncategorized-errors */
export default {
component: globalThis.__TEMPLATE_COMPONENTS__.Button,
tags: ['autodocs', '!test', '!vitest'],
Expand All @@ -9,7 +10,16 @@ export default {
export const ErrorStory = {
decorators: [
() => {
throw new Error('Story did something wrong');
const err = new Error('Story did something wrong');
err.stack = `
at errorStory (/sb-preview/file.js:000:0001)
at hookified (/sb-preview/file.js:000:0001)
at defaultDecorateStory (/sb-preview/file.js:000:0001)
at jsxDecorator (/assets/file.js:000:0001)
at hookified (/sb-preview/file.js:000:0001)
at decorateStory (/sb-preview/file.js:000:0001)
`;
throw err;
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('remove-mdx-stories', () => {
await expect(() => removeMDXEntries(Object.keys(list), { configDir })).rejects
.toThrowErrorMatchingInlineSnapshot(`
[SB_CORE-COMMON_0004 (InvalidStoriesEntryError): Storybook could not index your stories.
Your main configuration somehow does not contain a 'stories' field, or it resolved to an empty array.
Your main configuration does not contain a 'stories' field, or it resolved to an empty array.

Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.

Expand Down
33 changes: 23 additions & 10 deletions code/core/src/manager/components/sidebar/Refs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint-disable local-rules/no-uncategorized-errors */
import React from 'react';

import type { StoryAnnotations } from 'storybook/internal/csf';
import type { Meta, StoryObj } from '@storybook/react-vite';

import { ManagerContext } from 'storybook/manager-api';
import { fn, userEvent, within } from 'storybook/test';
import { dedent } from 'ts-dedent';

import { standardData as standardHeaderData } from './Heading.stories';
import { IconSymbols } from './IconSymbols';
Expand All @@ -22,22 +24,24 @@ const managerContext = {
},
} as any;

export default {
const meta = {
component: Ref,
title: 'Sidebar/Refs',
excludeStories: /.*Data$/,
parameters: { layout: 'fullscreen' },
globals: { sb_theme: 'side-by-side' },
decorators: [
(storyFn: any) => (
(storyFn) => (
<ManagerContext.Provider value={managerContext}>
<IconSymbols />
{storyFn()}
</ManagerContext.Provider>
),
(storyFn: any) => <div style={{ padding: '0 20px', maxWidth: '230px' }}>{storyFn()}</div>,
(storyFn) => <div style={{ padding: '0 20px', maxWidth: '230px' }}>{storyFn()}</div>,
],
};
} satisfies Meta<typeof Ref>;

export default meta;

const { menu } = standardHeaderData;
const filteredIndex = mockDataset.withRoot;
Expand All @@ -49,7 +53,16 @@ export const loadingData = { menu, filteredIndex: {} };
// @ts-expect-error (non strict)
const indexError: Error = (() => {
try {
throw new Error('There was a severe problem');
const err = new Error('There was a severe problem');
err.stack = dedent`
at errorStory (/sb-preview/file.js:000:0001)
at hookified (/sb-preview/file.js:000:0001)
at defaultDecorateStory (/sb-preview/file.js:000:0001)
at jsxDecorator (/assets/file.js:000:0001)
at hookified (/sb-preview/file.js:000:0001)
at decorateStory (/sb-preview/file.js:000:0001)
`;
throw err;
} catch (e) {
return e;
}
Expand Down Expand Up @@ -282,15 +295,15 @@ export const ErroredMobile = () => (
/>
);
ErroredMobile.globals = { sb_theme: 'stacked', viewport: { value: 'mobile1' } };
export const ErroredWithErrorOpen: StoryAnnotations = {
export const ErroredWithErrorOpen: StoryObj = {
render: () => Errored(),
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const button = await canvas.findByText('View error');
await userEvent.click(button);
},
};
export const ErroredMobileWithErrorOpen: StoryAnnotations = {
export const ErroredMobileWithErrorOpen: StoryObj = {
render: () => ErroredMobile(),
globals: { sb_theme: 'stacked', viewport: { value: 'mobile1' } },
play: async ({ canvasElement }) => {
Expand All @@ -299,15 +312,15 @@ export const ErroredMobileWithErrorOpen: StoryAnnotations = {
await userEvent.click(button);
},
};
export const ErroredWithIndicatorOpen: StoryAnnotations = {
export const ErroredWithIndicatorOpen: StoryObj = {
render: () => Errored(),
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const button = await canvas.findByRole('button', { name: 'Extra actions' });
await userEvent.click(button);
},
};
export const ErroredMobileWithIndicatorOpen: StoryAnnotations = {
export const ErroredMobileWithIndicatorOpen: StoryObj = {
render: () => ErroredMobile(),
globals: { sb_theme: 'stacked', viewport: { value: 'mobile1' } },
play: async ({ canvasElement }) => {
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/server-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class InvalidStoriesEntryError extends StorybookError {
'https://storybook.js.org/docs/faq#can-i-have-a-storybook-with-no-local-stories',
message: dedent`
Storybook could not index your stories.
Your main configuration somehow does not contain a 'stories' field, or it resolved to an empty array.
Your main configuration does not contain a 'stories' field, or it resolved to an empty array.

Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.`,
});
Expand Down
6 changes: 1 addition & 5 deletions code/frameworks/vue3-vite/template/cli/ts/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ const meta = {

export default meta;
type Story = StoryObj<typeof meta>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/

export const Primary: Story = {
args: {
primary: true,
Expand Down
126 changes: 126 additions & 0 deletions code/lib/cli-storybook/src/codemod/helpers/remove-unused-types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { describe, expect, it } from 'vitest';

import { loadCsf, printCsf } from 'storybook/internal/csf-tools';

import { dedent } from 'ts-dedent';

import { getDiff } from '../../../../../core/src/core-server/utils/save-story/getDiff';
import { removeUnusedTypes } from './remove-unused-types';

expect.addSnapshotSerializer({
serialize: (val: any) => (typeof val === 'string' ? val : val.toString()),
test: () => true,
});

const unescape = (str: string) => str.replace(/\r\n/g, '\n');

describe('removeUnusedTypes', () => {
const getTransformed = (source: string) => {
const csf = loadCsf(source, { makeTitle: () => 'FIXME' }).parse();
removeUnusedTypes(csf._ast.program, csf._ast);
return printCsf(csf).code;
};

it('should remove unused Storybook types', async () => {
const source = dedent`
import { Button } from './Button';
import { StoryFn, StoryObj } from '@storybook/react';
import type { Meta, MetaObj } from '@storybook/react';
import { type ComponentStory, type ComponentMeta } from '@storybook/react';

// unused types that should be removed
type UnusedAlias = Meta<typeof Button>;
type UnusedAlias2 = StoryObj<typeof Button>;
type UnusedAlias3 = ComponentStory<typeof Button>;
type UnusedAlias4 = ComponentMeta<typeof Button>;
type UnusedDeepType = {
foo: {
bar: {
story: StoryObj<typeof Button>;
}
}
};
interface UnusedInterface extends Meta {}
interface UnusedDeepInterface {
baz: {
qux: {
meta: Meta<typeof Button>;
}
}
};

export default { component: Button };
`;

const transformed = getTransformed(source);
expect(getDiff(unescape(source), unescape(transformed))).toMatchInlineSnapshot(`
import { Button } from './Button';

- import { StoryFn, StoryObj } from '@storybook/react';
- import type { Meta, MetaObj } from '@storybook/react';
- import { type ComponentStory, type ComponentMeta } from '@storybook/react';
-


- // unused types that should be removed
- type UnusedAlias = Meta<typeof Button>;
- type UnusedAlias2 = StoryObj<typeof Button>;
- type UnusedAlias3 = ComponentStory<typeof Button>;
- type UnusedAlias4 = ComponentMeta<typeof Button>;
- type UnusedDeepType = {
- foo: {
- bar: {
- story: StoryObj<typeof Button>;
- }
- }
- };
- interface UnusedInterface extends Meta {}
- interface UnusedDeepInterface {
- baz: {
- qux: {
- meta: Meta<typeof Button>;
- }
- }
- };
-
-
export default { component: Button };
`);
});

it('should not remove used Storybook types', async () => {
const source = dedent`
// Nothing in this file should be removed or modified
import { StoryFn, StoryObj, ComponentStory, Meta, MetaObj, ComponentMeta } from '@storybook/react';
import { Button } from './Button';

type Alias = StoryFn<typeof Button>;
type Alias2 = Alias & { b: string };
type Story = StoryObj & { a: string };
type DeepType = {
foo: {
bar: {
story: ComponentStory<typeof Button>;
}
}
};
interface Interface extends Meta {}
interface DeepInterface {
baz: {
qux: {
meta: MetaObj<typeof Button>;
}
}
};
const X: ComponentMeta = {}

function foo(a: Story, c: DeepType, d: Interface, e: DeepInterface){}

export default {};
`;

const transformed = getTransformed(source);

expect(unescape(transformed)).toEqual(unescape(source));
});
});
Loading