Skip to content

Commit e8d62a2

Browse files
authored
Merge branch 'next' into norbert/fix-modal-in-popover
2 parents 56827bb + c289fde commit e8d62a2

File tree

19 files changed

+68
-314
lines changed

19 files changed

+68
-314
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 10.2.4
2+
3+
- CSF-Factories: Fix codemod for preview files without exports - [#33673](https://github.com/storybookjs/storybook/pull/33673), thanks @kasperpeulen!
4+
- CSF: Fix false positive detection of Zod v4 .meta() as CSF Factory - [#33666](https://github.com/storybookjs/storybook/pull/33666), thanks @kasperpeulen!
5+
- CSFFactories: Add non-interactive mode and --glob flag - [#33648](https://github.com/storybookjs/storybook/pull/33648), thanks @kasperpeulen!
6+
- CSFFactories: Preserve leading comments when adding imports - [#33645](https://github.com/storybookjs/storybook/pull/33645), thanks @kasperpeulen!
7+
- Codemod: Fix csf-2-to-3 failing due to quoted filenames - [#33646](https://github.com/storybookjs/storybook/pull/33646), thanks @kasperpeulen!
8+
- Codemod: Fix glob pattern handling on Windows - [#33714](https://github.com/storybookjs/storybook/pull/33714), thanks @kasperpeulen!
9+
- Manager: Remove deprecated `active` prop warning in ZoomButton - [#33697](https://github.com/storybookjs/storybook/pull/33697), thanks @yatishgoel!
10+
- Next.js: Alias AppRouterContext to shared runtime to fix Link navigation - [#33419](https://github.com/storybookjs/storybook/pull/33419), thanks @pallaprolus!
11+
112
## 10.2.3
213

314
- Addon-Vitest: Normalize Windows paths in addon-vitest automigration - [#33340](https://github.com/storybookjs/storybook/pull/33340), thanks @tanujbhaud!

code/builders/builder-vite/src/build.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@ export async function build(options: Options) {
4040

4141
const finalConfig = (await presets.apply('viteFinal', config, options)) as InlineConfig;
4242

43+
// Add a plugin to enforce Storybook's outDir after all other plugins.
44+
// This prevents frameworks like Nitro from redirecting
45+
// build output to their own directories (e.g., .output/public/).
46+
// The 'enforce: post' ensures this runs after all other config hooks.
47+
finalConfig.plugins?.push({
48+
name: 'storybook:enforce-output-dir',
49+
enforce: 'post',
50+
config: (config) => ({
51+
...config,
52+
build: {
53+
outDir: options.outputDir,
54+
},
55+
}),
56+
// configEnvironment is a new method in Vite 6
57+
// It is used to configure configs based on the environment
58+
// E.g. Nitro uses this method to set the output directory to .output/public/
59+
configEnvironment: () => ({
60+
build: {
61+
outDir: options.outputDir,
62+
},
63+
}),
64+
});
65+
4366
if (options.features?.developmentModeForBuild) {
4467
finalConfig.plugins?.push({
4568
name: 'storybook:define-env',

code/core/src/core-server/dev-server.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,26 @@ export async function storybookDevServer(options: Options) {
4646
const storyIndexGeneratorPromise =
4747
options.presets.apply<StoryIndexGenerator>('storyIndexGenerator');
4848

49-
registerIndexJsonRoute({
50-
app,
51-
storyIndexGeneratorPromise,
52-
normalizedStories,
53-
serverChannel,
54-
workingDir,
55-
configDir,
56-
});
57-
5849
app.use(compression({ level: 1 }));
5950

6051
if (typeof options.extendServer === 'function') {
6152
options.extendServer(server);
6253
}
6354

55+
// CORS middleware must be registered BEFORE route handlers to ensure all routes
56+
// (including /index.json) receive proper CORS headers for Storybook Composition
6457
app.use(getAccessControlMiddleware(core?.crossOriginIsolated ?? false));
6558
app.use(getCachingMiddleware());
6659

60+
registerIndexJsonRoute({
61+
app,
62+
storyIndexGeneratorPromise,
63+
normalizedStories,
64+
serverChannel,
65+
workingDir,
66+
configDir,
67+
});
68+
6769
(await getMiddleware(options.configDir))(app);
6870

6971
// Apply experimental_devServer preset to allow addons/frameworks to extend the dev server with middlewares, etc.

code/core/src/core-server/server-channel/file-search-channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function initFileSearchChannel(
105105
if (!coreOptions.disableTelemetry) {
106106
telemetry('create-new-story-file-search', {
107107
success: false,
108-
error: `An error occured while searching for components: ${e}`,
108+
error: `An error occurred while searching for components: ${e}`,
109109
});
110110
}
111111
}

code/core/src/manager-api/tests/globals.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('globals API', () => {
7171
});
7272
});
7373

74-
it('emits UPDATE_GLOBALS if retains a globals value different to what recieves on SET_GLOBALS', () => {
74+
it('emits UPDATE_GLOBALS if retains a globals value different to what receives on SET_GLOBALS', () => {
7575
const channel = new EventEmitter();
7676
const listener = vi.fn();
7777
channel.on(UPDATE_GLOBALS, listener);

code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const WithSearchResultsAndError: Story = {
116116
fileSearchQuery: 'src',
117117
fileSearchQueryDeferred: 'src',
118118
isLoading: false,
119-
error: { error: 'Some error occured', selectedItemId: 'src/module-multiple-exports.js' },
119+
error: { error: 'Some error occurred', selectedItemId: 'src/module-multiple-exports.js' },
120120
searchResults: WithResults.args.searchResults,
121121
},
122122
};
@@ -130,7 +130,7 @@ export const WithSearchResultsAndMultiLineError: Story = {
130130
fileSearchQueryDeferred: 'src',
131131
isLoading: false,
132132
error: {
133-
error: 'A very long error occured. A very long error occured. A very long error occured.',
133+
error: 'A very long error occurred. A very long error occurred. A very long error occurred.',
134134
selectedItemId: 'src/module-multiple-exports.js',
135135
},
136136
searchResults: WithResults.args.searchResults,

code/e2e-tests/framework-vue3.spec.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

code/frameworks/angular/build-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"loglevel": {
3333
"type": "string",
34-
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
34+
"description": "Controls level of logging during build. Can be one of: [trace, debug, info (default), warn, error, silent].",
3535
"pattern": "(trace|debug|info|warn|error|silent)"
3636
},
3737
"logfile": {

code/frameworks/angular/start-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
},
148148
"loglevel": {
149149
"type": "string",
150-
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
150+
"description": "Controls level of logging during build. Can be one of: [trace, debug, info (default), warn, error, silent].",
151151
"pattern": "(trace|debug|info|warn|error|silent)"
152152
},
153153
"logfile": {

code/lib/create-storybook/src/initiate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ async function runStorybookDev(result: {
178178

179179
const parts = storybookCommand.split(' ');
180180

181-
if (packageManager.type === 'npm') {
181+
// Angular CLI throws "Unknown argument: silent"
182+
if (packageManager.type === 'npm' && projectType !== ProjectType.ANGULAR) {
182183
parts.push('--silent');
183184
}
184185

0 commit comments

Comments
 (0)