Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7f42596
fix(controls/Number)add range validation in handleChange of NumberCon…
ia319 Sep 23, 2025
f75cc10
Merge branch 'next' into bug/32454
ia319 Sep 24, 2025
3e30af9
Merge branch 'next' into bug/32454
ia319 Sep 25, 2025
1619014
Merge branch 'next' into bug/32454
ia319 Sep 29, 2025
e7f5dd2
style: fix lint errors
ia319 Sep 29, 2025
45b1d09
revert: revert unnecessary changes in no-stories-of.md and tsconfig.json
ia319 Sep 29, 2025
395624b
Merge branch 'next' into bug/32454
ia319 Oct 26, 2025
92b1d6d
Merge branch 'next' into bug/32454
ia319 Oct 29, 2025
f57d119
fix: export interface declaration for NextPreview
icopp Oct 31, 2025
80e50d1
fix: export interface declaration for ReactMeta
icopp Oct 31, 2025
7785262
Vitest Addon: Add support for Preact
yannbf Nov 4, 2025
b59e2ee
React: Adjust logging in react componentManifest and improve reactDoc…
kasperpeulen Nov 5, 2025
fa39aa1
React: Improve node_modules docgen error message
kasperpeulen Nov 5, 2025
f557f7f
update parallelism
yannbf Nov 5, 2025
4642640
Merge pull request #32954 from storybookjs/kasper/manifest-auto-compo…
kasperpeulen Nov 5, 2025
6ea9d06
Update CHANGELOG.md for v10.0.5 [skip ci]
storybook-bot Nov 5, 2025
4673652
Merge branch 'next-release' into next
storybook-bot Nov 5, 2025
0676eef
Merge branch 'next' into bug/32454
yannbf Nov 6, 2025
0484989
Merge pull request #32539 from ia319/bug/32454
yannbf Nov 6, 2025
7918c3f
Merge pull request #32914 from icopp/patch-1
yannbf Nov 6, 2025
4721fee
Merge pull request #32915 from icopp/patch-2
yannbf Nov 6, 2025
dce35e0
update snippets
ehoodgoren Nov 7, 2025
b9695ea
Merge pull request #32976 from ehoodgoren/chore/ehoodgoren/vitest-pro…
valentinpalkovic Nov 7, 2025
957bb1c
Merge pull request #32948 from storybookjs/yann/preact-testing-support
yannbf Nov 7, 2025
3ab3764
Write changelog for 10.1.0-alpha.7 [skip ci]
storybook-bot Nov 7, 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ workflows:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 11
parallelism: 13
requires:
- create-sandboxes
- test-portable-stories:
Expand Down Expand Up @@ -1106,7 +1106,7 @@ workflows:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 6
parallelism: 7
requires:
- create-sandboxes
- test-portable-stories:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 11
parallelism: 13
requires:
- create-sandboxes
- test-portable-stories:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/workflows/merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 6
parallelism: 7
requires:
- create-sandboxes
- test-portable-stories:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 10.0.5

- Core: Add reentry guard to focus patch - [#32655](https://github.com/storybookjs/storybook/pull/32655), thanks @ia319!
- Nextjs Vite: Update internal plugin to support `svgr` use cases - [#32957](https://github.com/storybookjs/storybook/pull/32957), thanks @yannbf!

## 10.0.4

- CLI: Fix issue with running Storybook after being initialized - [#32929](https://github.com/storybookjs/storybook/pull/32929), thanks @yannbf!
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 10.1.0-alpha.7

- CSF: Fix export interface declaration for NextPreview - [#32914](https://github.com/storybookjs/storybook/pull/32914), thanks @icopp!
- Controls: Add range validation in Number Control - [#32539](https://github.com/storybookjs/storybook/pull/32539), thanks @ia319!
- Fix: Export interface declaration for ReactMeta - [#32915](https://github.com/storybookjs/storybook/pull/32915), thanks @icopp!
- React: Improve error messages in component manifest - [#32954](https://github.com/storybookjs/storybook/pull/32954), thanks @kasperpeulen!
- Vitest Addon: Add support for Preact - [#32948](https://github.com/storybookjs/storybook/pull/32948), thanks @yannbf!

## 10.1.0-alpha.6

- Core: Add reentry guard to focus patch - [#32655](https://github.com/storybookjs/storybook/pull/32655), thanks @ia319!
Expand Down
24 changes: 22 additions & 2 deletions code/addons/docs/src/blocks/controls/Number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,31 @@ export const NumberControl: FC<NumberProps> = ({
if (Number.isNaN(result)) {
setParseError(new Error(`'${event.target.value}' is not a number`));
} else {
onChange(result);
// Initialize the final value as the user's input
let finalValue = result;

// Clamp to minimum: if finalValue is less than min, use min
if (typeof min === 'number' && finalValue < min) {
finalValue = min;
}

// Clamp to maximum: if finalValue is greater than max, use max
if (typeof max === 'number' && finalValue > max) {
finalValue = max;
}

// Pass the clamped final value to the onChange callback
onChange(finalValue);
// Clear any previous parse errors
setParseError(null);

// If the value was clamped, update the input display to the final value
if (finalValue !== result) {
setInputValue(String(finalValue));
}
}
},
[onChange, setParseError]
[onChange, setParseError, min, max]
);

const onForceVisible = useCallback(() => {
Expand Down
1 change: 1 addition & 0 deletions code/addons/vitest/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const SUPPORTED_FRAMEWORKS = [
'@storybook/nextjs',
'@storybook/nextjs-vite',
'@storybook/react-vite',
'@storybook/preact-vite',
'@storybook/svelte-vite',
'@storybook/vue3-vite',
'@storybook/html-vite',
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export function definePreview<Addons extends PreviewAddon<never>[]>(
});
}

interface NextPreview<T extends AddonTypes> extends ReactPreview<NextJsTypes & T> {}
export interface NextPreview<T extends AddonTypes> extends ReactPreview<NextJsTypes & T> {}
4 changes: 2 additions & 2 deletions code/lib/cli-storybook/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export const baseTemplates = {
modifications: {
extraDependencies: ['preact-render-to-string'],
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
skipTasks: ['e2e-tests', 'bench'],
},
'preact-vite/default-ts': {
name: 'Preact Latest (Vite | TypeScript)',
Expand All @@ -628,7 +628,7 @@ export const baseTemplates = {
modifications: {
extraDependencies: ['preact-render-to-string'],
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
skipTasks: ['e2e-tests', 'bench'],
},
'qwik-vite/default-ts': {
name: 'Qwik CLI Latest (Vite | TypeScript)',
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,5 +283,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "10.1.0-alpha.7"
}
25 changes: 17 additions & 8 deletions code/renderers/react/src/componentManifest/generateCodeSnippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,26 @@ export function getCodeSnippet(
? metaPath.get('properties').filter((p) => p.isObjectProperty())
: [];

const getRenderPath = (object: NodePath<t.ObjectProperty>[]) =>
object
.filter((p) => keyOf(p.node) === 'render')
.map((p) => p.get('value'))
.find(
(v): v is NodePath<t.ArrowFunctionExpression | t.FunctionExpression> =>
v.isArrowFunctionExpression() || v.isFunctionExpression()
const getRenderPath = (object: NodePath<t.ObjectProperty>[]) => {
const renderPath = object.find((p) => keyOf(p.node) === 'render')?.get('value');

if (renderPath?.isIdentifier()) {
componentName = renderPath.node.name;
}
if (
renderPath &&
!(renderPath.isArrowFunctionExpression() || renderPath.isFunctionExpression())
) {
throw renderPath.buildCodeFrameError(
'Expected render to be an arrow function or function expression'
);
}

return renderPath;
};

const renderPath = getRenderPath(storyProps);
const metaRenderPath = getRenderPath(metaProps);
const renderPath = getRenderPath(storyProps);

storyFn ??= renderPath ?? metaRenderPath;

Expand Down
12 changes: 7 additions & 5 deletions code/renderers/react/src/componentManifest/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,23 @@ export const componentManifestGenerator: PresetPropertyFn<
} satisfies Partial<ComponentManifest>;

if (!component?.reactDocgen) {
const error = !component
const error = !csf._meta?.component
? {
name: 'No meta.component specified',
message: 'Specify meta.component for the component to be included in the manifest.',
name: 'No component found',
message:
'We could not detect the component from your story file. Specify meta.component.',
}
: {
name: 'No component import found',
message: `No component file found for the "${component.componentName}" component.`,
message: `No component file found for the "${csf.meta.component}" component.`,
};
return {
...base,
error: {
name: error.name,
message:
csf._metaStatementPath?.buildCodeFrameError(error.message).message ?? error.message,
(csf._metaStatementPath?.buildCodeFrameError(error.message).message ??
error.message) + `\n\n${entry.importPath}:\n${storyFile}`,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const getComponents = ({
});
}
} catch (e) {
logger.error(e);
logger.debug(e);
}
if (path) {
const reactDocgen = getReactDocgen(path, component);
Expand Down
Loading