Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
592f78a
Initial plan
Copilot Mar 11, 2026
a649502
fix: handle additional vitest config patterns in postinstall setup
Copilot Mar 11, 2026
7346a4c
fix: address code review - improve type safety and readability
Copilot Mar 11, 2026
20e48e6
fix: resolve eslint/prettier issues in updateVitestFile.ts
Copilot Mar 11, 2026
653e55f
fix: implement expression resolver for TypeScript type annotations
valentinpalkovic Mar 11, 2026
d5acaa6
Split tests into multiple files and fine-tune workspace vs projects d…
valentinpalkovic Mar 11, 2026
d8b7f7c
Extend top_level_test_properties
valentinpalkovic Mar 11, 2026
00a0296
Resolve code rabbit comments
valentinpalkovic Mar 12, 2026
bc75a64
Support proper project/workspace inlining for default exports
valentinpalkovic Mar 12, 2026
3b1fd51
Enhance config handling with support for mergeConfig and aliased defi…
valentinpalkovic Mar 12, 2026
d83eb16
Vite: Add mock entries to optimizeDeps.entries
valentinpalkovic Mar 16, 2026
f894b4d
Merge branch 'next' into copilot/fix-vitest-postinstall-error
yannbf Mar 17, 2026
9a263d4
Update test runner configuration to use a single worker for builds
ndelangen Mar 17, 2026
21e7cb3
Write changelog for 10.3.0-beta.2 [skip ci]
storybook-bot Mar 17, 2026
1a7b008
Merge branch 'next' into norbert/test-runner-ci-flake
yannbf Mar 17, 2026
5f9f516
Merge pull request #34184 from storybookjs/version-non-patch-from-10.…
yannbf Mar 17, 2026
af5b7de
Bump version from "10.3.0-beta.1" to "10.3.0-beta.2" [skip ci]
storybook-bot Mar 17, 2026
08fc2ea
Merge pull request #34167 from storybookjs/valentin/support-optimize-…
valentinpalkovic Mar 17, 2026
2f5025f
Merge pull request #34179 from storybookjs/norbert/test-runner-ci-flake
yannbf Mar 17, 2026
271bd1e
Merge pull request #34106 from storybookjs/copilot/fix-vitest-postins…
yannbf Mar 17, 2026
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
8 changes: 8 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 10.3.0-beta.2

- UI: Hide addon panel Drag on pages without a panel - [#34162](https://github.com/storybookjs/storybook/pull/34162), thanks @Sidnioulz!
- UI: Hide manifest tag for now - [#34165](https://github.com/storybookjs/storybook/pull/34165), thanks @Sidnioulz!
- UI: Make disabled Buttons keyboard-focusable - [#34166](https://github.com/storybookjs/storybook/pull/34166), thanks @Sidnioulz!
- UI: Use correct selector for addon panel focus check - [#34164](https://github.com/storybookjs/storybook/pull/34164), thanks @Sidnioulz!
- Vue: Make globals reactive in decorators - [#34116](https://github.com/storybookjs/storybook/pull/34116), thanks @Sidnioulz!

## 10.3.0-beta.1

- Addon-Docs: Add React as optimizeDeps entry - [#34176](https://github.com/storybookjs/storybook/pull/34176), thanks @valentinpalkovic!
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Addon A11y: Test UI component compliance with WCAG web accessibility standards",
"keywords": [
"a11y",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Docs: Document UI components automatically with stories and MDX",
"keywords": [
"docs",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Links: Link stories together to build demos and prototypes with your UI components",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Onboarding: Help new users learn how to write stories",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/pseudo-states/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storybook-addon-pseudo-states",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Pseudo-states addon: Manipulate CSS pseudo states",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Themes addon: Switch between themes from the toolbar",
"keywords": [
"css",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/vitest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-vitest",
"version": "10.3.0-beta.1",
"version": "10.3.0-beta.2",
"description": "Storybook Vitest addon: Blazing fast component testing using stories",
"keywords": [
"storybook",
Expand Down
49 changes: 47 additions & 2 deletions code/addons/vitest/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,16 @@ export default async function postInstall(options: PostinstallOptions) {
);
}

const getTemplateName = () => {
const getTemplateName = (configContent?: string) => {
if (isVitest4OrNewer) {
return 'vitest.config.4.template';
} else if (isVitest3_2To4) {
// In Vitest 3.2, `workspace` was deprecated in favor of `projects` but still works.
// If the user's existing config already uses `workspace`, use the old template that
// also uses `workspace` so that the merge doesn't introduce both keys.
if (configContent && configUsesWorkspace(configContent)) {
return 'vitest.config.template';
}
return 'vitest.config.3.2.template';
}
return 'vitest.config.template';
Expand Down Expand Up @@ -264,7 +270,7 @@ export default async function postInstall(options: PostinstallOptions) {
/\/\/\/\s*<reference\s+types=["']vitest\/config["']\s*\/>/
);

const templateName = getTemplateName();
const templateName = getTemplateName(configFile);

const alreadyConfigured = isConfigAlreadySetup(rootConfig, configFile);

Expand Down Expand Up @@ -446,3 +452,42 @@ export function isConfigAlreadySetup(_configPath: string, configContent: string)

return pluginReferenced;
}

/**
* Checks whether an existing config file uses `test.workspace` (Vitest 3.0-3.1 style) rather than
* `test.projects` (Vitest 3.2+ style).
*/
function configUsesWorkspace(configContent: string): boolean {
let ast: ReturnType<typeof babelParse>;
try {
ast = babelParse(configContent);
} catch {
return false;
}

let found = false;

traverse(ast, {
ObjectProperty(path) {
if (found) {
path.stop();
return;
}
const key = path.node.key;
if (key.type === 'Identifier' && key.name === 'workspace') {
// Check that this is inside a `test` property to avoid false positives
const parent = path.parentPath?.parentPath;
if (
parent?.isObjectProperty() &&
parent.node.key.type === 'Identifier' &&
parent.node.key.name === 'test'
) {
found = true;
path.stop();
}
}
},
});

return found;
}
Loading
Loading