diff --git a/.circleci/config.yml b/.circleci/config.yml index ce4d73ea750..2ce4f8c0219 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -316,7 +316,7 @@ jobs: executor: class: xlarge name: sb_playwright - parallelism: 1 + parallelism: 2 steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" diff --git a/CHANGELOG.md b/CHANGELOG.md index 2269f569454..395899c22b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.5.5 + +- Builder-Vite: Fix Turbosnap - [#30522](https://github.com/storybookjs/storybook/pull/30522), thanks @valentinpalkovic! + ## 8.5.4 - Addon A11y: Make Vitest Axe optional - [#30442](https://github.com/storybookjs/storybook/pull/30442), thanks @valentinpalkovic! diff --git a/code/frameworks/react-native-web-vite/src/index.ts b/code/frameworks/react-native-web-vite/src/index.ts index 1855ad61a70..661d88981a0 100644 --- a/code/frameworks/react-native-web-vite/src/index.ts +++ b/code/frameworks/react-native-web-vite/src/index.ts @@ -1 +1,3 @@ export type { FrameworkOptions, StorybookConfig } from './types'; + +export { definePreview } from '@storybook/react'; diff --git a/code/lib/cli-storybook/src/codemod/csf-factories.ts b/code/lib/cli-storybook/src/codemod/csf-factories.ts index eeae5bdab99..3d1b45fbcd9 100644 --- a/code/lib/cli-storybook/src/codemod/csf-factories.ts +++ b/code/lib/cli-storybook/src/codemod/csf-factories.ts @@ -21,7 +21,7 @@ async function runStoriesCodemod(options: { }) { const { dryRun, packageManager, ...codemodOptions } = options; try { - let globString = 'src/**/*.stories.*'; + let globString = '{stories,src}/**/*.stories.*'; if (!process.env.IN_STORYBOOK_SANDBOX) { logger.log('Please enter the glob for your stories to migrate'); globString = ( @@ -30,7 +30,7 @@ async function runStoriesCodemod(options: { type: 'text', name: 'glob', message: 'glob', - initial: globString, + initial: 'src/**/*.stories.*', }, { onCancel: () => process.exit(0), diff --git a/code/lib/cli-storybook/src/sandbox-templates.ts b/code/lib/cli-storybook/src/sandbox-templates.ts index 17f3e2982da..f3ca63ac62b 100644 --- a/code/lib/cli-storybook/src/sandbox-templates.ts +++ b/code/lib/cli-storybook/src/sandbox-templates.ts @@ -145,7 +145,14 @@ export const baseTemplates = { 'nextjs/13-ts': { name: 'Next.js v13.5 (Webpack | TypeScript)', script: - 'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^13.5.6" && yarn && git add . && git commit --amend --no-edit && cd ..', + 'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world ' + + '&& cd {{beforeDir}} ' + + 'jq \'.compilerOptions.moduleResolution = "bundler"\' tsconfig.json > tmp.json && mv tmp.json tsconfig.json ' + + '&& npm pkg set "dependencies.next"="^13.5.6" ' + + '&& yarn ' + + '&& git add . ' + + '&& git commit --amend --no-edit ' + + '&& cd ..', expected: { framework: '@storybook/nextjs', renderer: '@storybook/react', @@ -689,6 +696,9 @@ export const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-vite', }, + modifications: { + useCsfFactory: true, + }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, 'react-native-web-vite/rn-cli-ts': { @@ -727,6 +737,7 @@ const internalTemplates = { builder: '@storybook/builder-webpack5', }, modifications: { + useCsfFactory: true, extraDependencies: ['@storybook/addon-webpack5-compiler-babel', 'prop-types'], editAddons: (addons) => [...addons, '@storybook/addon-webpack5-compiler-babel'].filter( @@ -746,6 +757,7 @@ const internalTemplates = { builder: '@storybook/builder-webpack5', }, modifications: { + useCsfFactory: true, extraDependencies: ['prop-types'], }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 07f9835406e..1d0fdbe6d59 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -901,7 +901,10 @@ export const extendPreview: Task['run'] = async ({ template, sandboxDir }) => { const previewConfig = await readConfig({ cwd: sandboxDir, fileName: 'preview' }); if (template.modifications?.useCsfFactory) { - previewConfig.setImport(null, '../src/stories/components'); + const storiesDir = (await pathExists(join(sandboxDir, 'src/stories'))) + ? '../src/stories/components' + : '../stories/components'; + previewConfig.setImport(null, storiesDir); previewConfig.setImport({ namespace: 'coreAnnotations' }, '../template-stories/core/preview'); previewConfig.setImport( { namespace: 'toolbarAnnotations' },