Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a93ac51
Add RSBuild-based sandboxes
valentinpalkovic Nov 13, 2025
ca8270b
undo this commit soon
yannbf Nov 13, 2025
62009ba
Revert "undo this commit soon"
yannbf Nov 13, 2025
f280b95
Introduce rsbuild sandboxes to CI tests
yannbf Nov 13, 2025
222d89a
Merge branch 'valentin/cli-init-rework' into valentin/add-rsbuild-san…
valentinpalkovic Nov 13, 2025
a779f78
Merge branch 'valentin/cli-init-rework' into valentin/add-rsbuild-san…
valentinpalkovic Nov 16, 2025
f7a9007
Merge branch 'valentin/cli-init-rework' into valentin/add-rsbuild-san…
valentinpalkovic Nov 19, 2025
4fe74b8
Merge remote-tracking branch 'origin/valentin/cli-init-rework' into v…
valentinpalkovic Nov 19, 2025
ca8093d
Add rsbuild dependencies to base templates and update resolutions for…
valentinpalkovic Nov 19, 2025
d59aba7
Merge branch 'next' into valentin/add-rsbuild-sandboxes
valentinpalkovic Nov 19, 2025
b5e86cd
Filter out 'docs' addon stories for specific RSBUILD frameworks in sa…
valentinpalkovic Nov 19, 2025
05c1652
Refactor getFrameworkInfo to include configDir parameter and update f…
valentinpalkovic Nov 19, 2025
1e02a9e
Make framework name optional in StorybookMetadata type
valentinpalkovic Nov 19, 2025
edd2e2f
Fix tests
valentinpalkovic Nov 19, 2025
e7e59a1
Merge branch 'next' into valentin/add-rsbuild-sandboxes
valentinpalkovic Nov 20, 2025
585d93f
Enhance framework info retrieval by sanitizing package paths and upda…
valentinpalkovic Nov 20, 2025
80bd74b
Fix types
valentinpalkovic Nov 20, 2025
bac0e91
Don't use csf factories for rsbuild
valentinpalkovic Nov 20, 2025
6713380
Update template names to use 'RsBuild' and add experimental test synt…
valentinpalkovic Nov 20, 2025
0dd8595
Add module mocking stories and update e2e test navigation path
valentinpalkovic Nov 20, 2025
60daa33
Merge remote-tracking branch 'origin/next' into valentin/add-rsbuild-…
valentinpalkovic Nov 20, 2025
df5b95f
Remove csf-factories from non-react rsbuild-based sandboxes
valentinpalkovic Nov 20, 2025
b366e4b
Exclude e2e-dev job for rsbuild sandboxes
valentinpalkovic Nov 20, 2025
cc42c4c
Remove console.log
valentinpalkovic Nov 20, 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
26 changes: 13 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ jobs:
shell: bash.exe
test-init-features:
executor:
class: medium+
class: small
name: sb_node_22_browsers
steps:
- git-shallow-clone/checkout_advanced:
Expand Down Expand Up @@ -1172,27 +1172,27 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 34
parallelism: 38
requires:
- build
- check-sandboxes:
parallelism: 1
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 31
parallelism: 35
requires:
- create-sandboxes
- e2e-production:
parallelism: 7
requires:
- create-sandboxes
- e2e-dev:
parallelism: 28
parallelism: 32
requires:
- create-sandboxes
- test-runner-production:
parallelism: 29
parallelism: 33
requires:
- create-sandboxes
- vitest-integration:
Expand Down Expand Up @@ -1286,23 +1286,23 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 19
parallelism: 21
requires:
- build
- chromatic-sandboxes:
parallelism: 16
parallelism: 18
requires:
- create-sandboxes
- e2e-production:
parallelism: 6
requires:
- create-sandboxes
- e2e-dev:
parallelism: 14
parallelism: 16
requires:
- create-sandboxes
- test-runner-production:
parallelism: 14
parallelism: 16
requires:
- create-sandboxes
- vitest-integration:
Expand Down Expand Up @@ -1381,23 +1381,23 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 13
parallelism: 14
requires:
- build
- chromatic-sandboxes:
parallelism: 10
parallelism: 11
requires:
- create-sandboxes
- e2e-production:
parallelism: 6
requires:
- create-sandboxes
- e2e-dev:
parallelism: 8
parallelism: 9
requires:
- create-sandboxes
- test-runner-production:
parallelism: 8
parallelism: 9
requires:
- create-sandboxes
- vitest-integration:
Expand Down
8 changes: 4 additions & 4 deletions .circleci/src/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
requires:
- build
- create-sandboxes:
parallelism: 34
parallelism: 38
requires:
- build
- check-sandboxes:
Expand All @@ -42,19 +42,19 @@ jobs:
# requires:
# - create-sandboxes
- chromatic-sandboxes:
parallelism: 31
parallelism: 35
requires:
- create-sandboxes
- e2e-production:
parallelism: 7
requires:
- create-sandboxes
- e2e-dev:
parallelism: 28
parallelism: 32
requires:
- create-sandboxes
- test-runner-production:
parallelism: 29
parallelism: 33
requires:
- create-sandboxes
- vitest-integration:
Expand Down
8 changes: 4 additions & 4 deletions .circleci/src/workflows/merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ jobs:
requires:
- unit-tests
- create-sandboxes:
parallelism: 19
parallelism: 21
requires:
- build
- chromatic-sandboxes:
parallelism: 16
parallelism: 18
requires:
- create-sandboxes
- e2e-production:
parallelism: 6
requires:
- create-sandboxes
- e2e-dev:
parallelism: 14
parallelism: 16
requires:
- create-sandboxes
- test-runner-production:
parallelism: 14
parallelism: 16
requires:
- create-sandboxes
- vitest-integration:
Expand Down
8 changes: 4 additions & 4 deletions .circleci/src/workflows/normal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ jobs:
requires:
- unit-tests
- create-sandboxes:
parallelism: 13
parallelism: 14
requires:
- build
- chromatic-sandboxes:
parallelism: 10
parallelism: 11
requires:
- create-sandboxes
- e2e-production:
parallelism: 6
requires:
- create-sandboxes
- e2e-dev:
parallelism: 8
parallelism: 9
requires:
- create-sandboxes
- test-runner-production:
parallelism: 8
parallelism: 9
requires:
- create-sandboxes
- vitest-integration:
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/csf-tools/ConfigFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ export const isCsfFactoryPreview = (previewConfig: ConfigFile) => {
return !!program.body.find((node) => {
return (
t.isImportDeclaration(node) &&
node.source.value.includes('@storybook') &&
node.source.value.includes('storybook') &&
node.specifiers.some((specifier) => {
return (
t.isImportSpecifier(specifier) &&
Expand Down
69 changes: 68 additions & 1 deletion code/lib/cli-storybook/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export type Template = {
*/
modifications?: {
skipTemplateStories?: boolean;
skipMocking?: boolean;
mainConfig?: LoosenedStorybookConfig | ((config: ConfigFile) => LoosenedStorybookConfig);
testBuild?: boolean;
disableDocs?: boolean;
Expand All @@ -105,7 +106,7 @@ export type Template = {
};

type BaseTemplates = Template & {
name: `${string} ${`v${number}` | 'Latest' | 'Prerelease'} (${'Webpack' | 'Vite'} | ${
name: `${string} ${`v${number}` | 'Latest' | 'Prerelease'} (${'Webpack' | 'Vite' | 'RSBuild'} | ${
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way, it's Rsbuild not RSBuild 😆

| 'JavaScript'
| 'TypeScript'})`;
};
Expand Down Expand Up @@ -481,6 +482,21 @@ export const baseTemplates = {
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
},
'react-rsbuild/default-ts': {
name: 'React Latest (RSBuild | TypeScript)',
script: 'yarn create rsbuild -d {{beforeDir}} -t react-ts --tools eslint',
expected: {
framework: 'storybook-react-rsbuild',
renderer: '@storybook/react',
builder: 'storybook-builder-rsbuild',
},
modifications: {
useCsfFactory: true,
extraDependencies: ['prop-types'],
skipMocking: true,
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
},
'solid-vite/default-js': {
name: 'SolidJS Latest (Vite | JavaScript)',
script: 'npx degit solidjs/templates/js {{beforeDir}}',
Expand Down Expand Up @@ -521,6 +537,20 @@ export const baseTemplates = {
},
skipTasks: ['bench'],
},
'vue3-rsbuild/default-ts': {
name: 'Vue Latest (RSBuild | TypeScript)',
script: 'yarn create rsbuild -d {{beforeDir}} -t vue-ts --tools eslint',
expected: {
framework: 'storybook-vue3-rsbuild',
renderer: '@storybook/vue3',
builder: 'storybook-builder-rsbuild',
},
modifications: {
useCsfFactory: true,
skipMocking: true,
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
},
// 'nuxt-vite/default-ts': {
// name: 'Nuxt v3 (Vite | TypeScript)',
// script: 'npx nuxi init --packageManager yarn --gitInit false -M @nuxt/ui {{beforeDir}}',
Expand Down Expand Up @@ -559,6 +589,20 @@ export const baseTemplates = {
type: ProjectType.HTML,
},
},
'html-rsbuild/default-ts': {
name: 'HTML Latest (RSBuild | TypeScript)',
script: 'yarn create rsbuild -d {{beforeDir}} -t vanilla-ts --tools eslint',
expected: {
framework: 'storybook-html-rsbuild',
renderer: '@storybook/html',
builder: 'storybook-builder-rsbuild',
},
modifications: {
useCsfFactory: true,
skipMocking: true,
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
},
'svelte-vite/default-js': {
name: 'Svelte Latest (Vite | JavaScript)',
script: 'npm create vite --yes {{beforeDir}} -- --template svelte',
Expand Down Expand Up @@ -637,6 +681,20 @@ export const baseTemplates = {
// Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
skipTasks: ['smoke-test', 'e2e-tests', 'bench', 'vitest-integration'],
},
'lit-rsbuild/default-ts': {
name: 'Web Components Latest (RSBuild | TypeScript)',
script: 'yarn create rsbuild -d {{beforeDir}} -t lit-ts --tools eslint',
expected: {
framework: 'storybook-web-components-rsbuild',
renderer: '@storybook/web-components',
builder: 'storybook-builder-rsbuild',
},
modifications: {
useCsfFactory: true,
skipMocking: true,
},
skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
},
'preact-vite/default-js': {
name: 'Preact Latest (Vite | JavaScript)',
script: 'npm create vite --yes {{beforeDir}} -- --template preact',
Expand Down Expand Up @@ -824,6 +882,7 @@ const benchTemplates = {
isInternal: true,
modifications: {
skipTemplateStories: true,
skipMocking: true,
},
skipTasks: [
'e2e-tests',
Expand All @@ -841,6 +900,7 @@ const benchTemplates = {
isInternal: true,
modifications: {
skipTemplateStories: true,
skipMocking: true,
},
skipTasks: [
'e2e-tests',
Expand All @@ -858,6 +918,7 @@ const benchTemplates = {
modifications: {
skipTemplateStories: true,
disableDocs: true,
skipMocking: true,
},
skipTasks: [
'e2e-tests',
Expand All @@ -876,6 +937,7 @@ const benchTemplates = {
modifications: {
skipTemplateStories: true,
testBuild: true,
skipMocking: true,
},
skipTasks: [
'e2e-tests',
Expand All @@ -893,6 +955,7 @@ const benchTemplates = {
modifications: {
skipTemplateStories: true,
testBuild: true,
skipMocking: true,
},
skipTasks: [
'e2e-tests',
Expand Down Expand Up @@ -928,6 +991,7 @@ export const normal: TemplateKey[] = [
'bench/react-vite-default-ts-test-build',
'bench/react-webpack-18-ts-test-build',
'ember/default-js',
'react-rsbuild/default-ts',
];

export const merged: TemplateKey[] = [
Expand All @@ -938,6 +1002,7 @@ export const merged: TemplateKey[] = [
'nextjs-vite/15-ts',
'preact-vite/default-ts',
'html-vite/default-ts',
'vue3-rsbuild/default-ts',
];

export const daily: TemplateKey[] = [
Expand All @@ -960,6 +1025,8 @@ export const daily: TemplateKey[] = [
'internal/react16-webpack',
'internal/react18-webpack-babel',
'react-native-web-vite/expo-ts',
'lit-rsbuild/default-ts',
'html-rsbuild/default-ts',
// 'react-native-web-vite/rn-cli-ts',
];

Expand Down
2 changes: 1 addition & 1 deletion scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ export const extendPreview: Task['run'] = async ({ template, sandboxDir }) => {
previewConfig.setFieldValue(['tags'], ['vitest']);
}

if (template.name.includes('Bench')) {
if (template.modifications?.skipMocking) {
await writeConfig(previewConfig);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/tasks/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const sandbox: Task = {
}

// not if sandbox is bench
if (!details.template.name.includes('Bench')) {
if (!details.template.modifications?.skipMocking) {
await addGlobalMocks(details, options);
}

Expand Down
6 changes: 5 additions & 1 deletion scripts/utils/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ export const configureYarn2ForVerdaccio = async ({
// React prereleases will have INCOMPATIBLE_PEER_DEPENDENCY errors because of transitive dependencies not allowing v19 betas
key.includes('nextjs') ||
key.includes('react-vite/prerelease') ||
key.includes('react-webpack/prerelease')
key.includes('react-webpack/prerelease') ||
key.includes('react-rsbuild/default-ts') ||
key.includes('vue-rsbuild/default-ts') ||
key.includes('html-rsbuild/default-ts') ||
key.includes('web-components-rsbuild/default-ts')
) {
// Don't error with INCOMPATIBLE_PEER_DEPENDENCY for SvelteKit sandboxes, it is expected to happen with @sveltejs/vite-plugin-svelte
command.push(
Expand Down
Loading