diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 7b7e15e5fb6a..89ecd63012ae 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,15 @@ +## 8.3.0-beta.4 + +- Test: Rename vitest plugin entrypoint - [#29067](https://github.com/storybookjs/storybook/pull/29067), thanks @yannbf! +- UI: Fix sidebar not wrapping - [#29055](https://github.com/storybookjs/storybook/pull/29055), thanks @JReinhold! + +## 8.3.0-beta.3 + +- Addon Test: Improve messages and post install script handling - [#29036](https://github.com/storybookjs/storybook/pull/29036), thanks @yannbf! +- Next.js-Vite: Fix vite plugin exports - [#29046](https://github.com/storybookjs/storybook/pull/29046), thanks @valentinpalkovic! +- Next.js: Update dependencies - [#29052](https://github.com/storybookjs/storybook/pull/29052), thanks @valentinpalkovic! +- UI: Fix conditional hooks usage in sidebar - [#28979](https://github.com/storybookjs/storybook/pull/28979), thanks @JReinhold! + ## 8.3.0-beta.2 - Addon Vitest: Fix indentation of 'vitePluginNext' in generated Vitest config file - [#29011](https://github.com/storybookjs/storybook/pull/29011), thanks @ghengeveld! diff --git a/code/.storybook/vitest.config.ts b/code/.storybook/vitest.config.ts index a6120deed897..25a83b4396ea 100644 --- a/code/.storybook/vitest.config.ts +++ b/code/.storybook/vitest.config.ts @@ -21,7 +21,7 @@ export default mergeConfig( vitestCommonConfig, defineProject({ plugins: [ - import('@storybook/experimental-addon-test/vite-plugin').then(({ storybookTest }) => + import('@storybook/experimental-addon-test/vitest-plugin').then(({ storybookTest }) => storybookTest({ configDir: process.cwd(), }) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 60ba058410ad..a7b331a1e602 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index a05611d72728..7c32e2532f50 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 7c17f586fc12..bb75135aae4c 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 1816d8a01f06..c81747a6c571 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 988fc2f46ffa..83cab07858e4 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 0f81ea09a078..f89814a7d4e1 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 4ed57e74d8ea..9e3a6ea89fdb 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 9efbaf79cace..e543d1ffe32b 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 7c34de8fcede..214d183f0a70 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 12f07c40afe7..73e977da3e4d 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 2f18775b3239..7f339327da93 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 9a644ad74ddd..59d95f5fcfb0 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 7b71519ec599..70ff24eb52a4 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 4fdc7d4a7123..21593b46384d 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 970c8fe207bd..20ac10370da3 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/test/package.json b/code/addons/test/package.json index 2b16dc1b0bfe..ca52df1494d3 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", @@ -29,24 +29,24 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, - "./vite-plugin": { - "types": "./dist/plugin/index.d.ts", - "import": "./dist/plugin/index.js", - "require": "./dist/plugin/index.cjs" + "./vitest-plugin": { + "types": "./dist/vitest-plugin/index.d.ts", + "import": "./dist/vitest-plugin/index.js", + "require": "./dist/vitest-plugin/index.cjs" }, "./internal/global-setup": { - "types": "./dist/plugin/global-setup.d.ts", - "import": "./dist/plugin/global-setup.js", - "require": "./dist/plugin/global-setup.cjs" + "types": "./dist/vitest-plugin/global-setup.d.ts", + "import": "./dist/vitest-plugin/global-setup.js", + "require": "./dist/vitest-plugin/global-setup.cjs" }, "./internal/setup-file": { - "types": "./dist/plugin/setup-file.d.ts", - "import": "./dist/plugin/setup-file.js" + "types": "./dist/vitest-plugin/setup-file.d.ts", + "import": "./dist/vitest-plugin/setup-file.js" }, "./internal/test-utils": { - "types": "./dist/plugin/test-utils.d.ts", - "import": "./dist/plugin/test-utils.js", - "require": "./dist/plugin/test-utils.cjs" + "types": "./dist/vitest-plugin/test-utils.d.ts", + "import": "./dist/vitest-plugin/test-utils.js", + "require": "./dist/vitest-plugin/test-utils.cjs" }, "./manager": "./dist/manager.js", "./preset": "./dist/preset.cjs", @@ -73,8 +73,11 @@ "@storybook/csf": "^0.1.11" }, "devDependencies": { + "@types/semver": "^7", "@vitest/browser": "^2.0.0", + "boxen": "^8.0.1", "find-up": "^7.0.0", + "semver": "^7.6.3", "tinyrainbow": "^1.2.0", "ts-dedent": "^2.2.0", "vitest": "^2.0.0" @@ -90,16 +93,16 @@ "bundler": { "exportEntries": [ "./src/index.ts", - "./src/plugin/test-utils.ts", - "./src/plugin/setup-file.ts" + "./src/vitest-plugin/test-utils.ts", + "./src/vitest-plugin/setup-file.ts" ], "managerEntries": [ "./src/manager.tsx" ], "nodeEntries": [ "./src/preset.ts", - "./src/plugin/index.ts", - "./src/plugin/global-setup.ts", + "./src/vitest-plugin/index.ts", + "./src/vitest-plugin/global-setup.ts", "./src/postinstall.ts" ] } diff --git a/code/addons/test/project.json b/code/addons/test/project.json index f9278931287c..96314d1efc94 100644 --- a/code/addons/test/project.json +++ b/code/addons/test/project.json @@ -5,4 +5,4 @@ "targets": { "build": {} } -} \ No newline at end of file +} diff --git a/code/addons/test/src/index.ts b/code/addons/test/src/index.ts index 9a3583d228c5..db487be11695 100644 --- a/code/addons/test/src/index.ts +++ b/code/addons/test/src/index.ts @@ -1,9 +1,9 @@ -import type { storybookTest as storybookTestImport } from './plugin'; +import type { storybookTest as storybookTestImport } from './vitest-plugin'; // make it work with --isolatedModules export default {}; // @ts-expect-error - this is a hack to make the module's sub-path augmentable -declare module '@storybook/experimental-addon-test/vite-plugin' { +declare module '@storybook/experimental-addon-test/vitest-plugin' { export const storybookTest: typeof storybookTestImport; } diff --git a/code/addons/test/src/postinstall-logger.ts b/code/addons/test/src/postinstall-logger.ts new file mode 100644 index 000000000000..8bb7df027c0b --- /dev/null +++ b/code/addons/test/src/postinstall-logger.ts @@ -0,0 +1,34 @@ +import { colors, logger } from 'storybook/internal/node-logger'; + +import boxen, { type Options } from 'boxen'; + +const fancy = + process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; + +export const step = colors.gray('›'); +export const info = colors.blue(fancy ? 'ℹ' : 'i'); +export const success = colors.green(fancy ? '✔' : '√'); +export const warning = colors.orange(fancy ? '⚠' : '‼'); +export const error = colors.red(fancy ? '✖' : '×'); + +const baseOptions: Options = { + borderStyle: 'round', + padding: 1, +}; + +export const print = (message: string, options: Options) => { + logger.line(1); + logger.plain(boxen(message, { ...baseOptions, ...options })); +}; + +export const printInfo = (title: string, message: string, options?: Options) => + print(message, { borderColor: 'blue', title, ...options }); + +export const printWarning = (title: string, message: string, options?: Options) => + print(message, { borderColor: 'yellow', title, ...options }); + +export const printError = (title: string, message: string, options?: Options) => + print(message, { borderColor: 'red', title, ...options }); + +export const printSuccess = (title: string, message: string, options?: Options) => + print(message, { borderColor: 'green', title, ...options }); diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index 3ecbff0432da..a868330b94e7 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -1,7 +1,7 @@ import { existsSync } from 'node:fs'; import * as fs from 'node:fs/promises'; import { writeFile } from 'node:fs/promises'; -import { dirname, join, relative, resolve } from 'node:path'; +import { dirname, join, relative } from 'node:path'; import * as path from 'node:path'; import { @@ -11,32 +11,44 @@ import { loadMainConfig, validateFrameworkName, } from 'storybook/internal/common'; -import { logger } from 'storybook/internal/node-logger'; +import { colors, logger } from 'storybook/internal/node-logger'; import { findUp } from 'find-up'; +import { coerce, satisfies } from 'semver'; import c from 'tinyrainbow'; -import dedent from 'ts-dedent'; +import { dedent } from 'ts-dedent'; import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add'; +import { printError, printInfo, printSuccess, step } from './postinstall-logger'; -const extensions = ['.js', '.jsx', '.ts', '.tsx', '.cts', '.mts', '.cjs', '.mjs']; +const ADDON_NAME = '@storybook/experimental-addon-test' as const; +const EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx', '.cts', '.mts', '.cjs', '.mjs'] as const; + +const findFile = async (basename: string) => findUp(EXTENSIONS.map((ext) => basename + ext)); export default async function postInstall(options: PostinstallOptions) { + printSuccess( + '👋 Howdy!', + dedent` + I'm the installation helper for ${colors.pink.bold(ADDON_NAME)} + + Hold on for a moment while I look at your project and get it set up... + ` + ); + const packageManager = JsPackageManagerFactory.getPackageManager({ force: options.packageManager, }); const info = await getFrameworkInfo(options); - - if ( - info.frameworkPackageName !== '@storybook/nextjs' && - info.builderPackageName !== '@storybook/builder-vite' - ) { - logger.info( - 'The Vitest addon can only be used with a Vite-based Storybook framework or Next.js.' - ); - return; - } + const allDeps = await packageManager.getAllDependencies(); + // only install these dependencies if they are not already installed + const dependencies = ['vitest', '@vitest/browser', 'playwright'].filter((p) => !allDeps[p]); + const vitestVersionSpecifier = + allDeps.vitest || (await packageManager.getInstalledVersion('vitest')); + const coercedVitestVersion = vitestVersionSpecifier ? coerce(vitestVersionSpecifier) : null; + // if Vitest is installed, we use the same version to keep consistency across Vitest packages + const vitestVersionToInstall = vitestVersionSpecifier ?? 'latest'; const annotationsImport = [ '@storybook/nextjs', @@ -50,28 +62,100 @@ export default async function postInstall(options: PostinstallOptions) { ) ? info.rendererPackageName : null; + const isRendererSupported = !!annotationsImport; + + const prerequisiteCheck = async () => { + const reasons = []; + + if ( + info.frameworkPackageName !== '@storybook/nextjs' && + info.builderPackageName !== '@storybook/builder-vite' + ) { + reasons.push( + '• The addon can only be used with a Vite-based Storybook framework or Next.js.' + ); + } + + if (!isRendererSupported) { + reasons.push(dedent` + • The addon cannot yet be used with ${colors.pink.bold(info.frameworkPackageName)} + `); + } + + if (coercedVitestVersion && !satisfies(coercedVitestVersion, '>=2.0.0')) { + reasons.push(` + • The addon requires Vitest 2.0.0 or later. You are currently using ${vitestVersionSpecifier}. + Please update your ${colors.pink.bold('vitest')} dependency and try again. + `); + } + + if (info.frameworkPackageName === '@storybook/nextjs') { + const nextVersion = await packageManager.getInstalledVersion('next'); + if (!nextVersion) { + reasons.push(dedent` + • You are using ${colors.pink.bold('@storybook/nextjs')} without having ${colors.pink.bold('next')} installed. + Please install "next" or use a different Storybook framework integration and try again. + `); + } + } + + if (reasons.length > 0) { + reasons.unshift( + `Storybook Test's automated setup failed due to the following package incompatibilities:` + ); + reasons.push( + dedent` + To roll back the installation, remove ${colors.pink.bold(ADDON_NAME)} from the "addons" array + in your main Storybook config file and remove the dependency from your package.json file. + ` + ); - if (!annotationsImport) { - logger.info('The Vitest addon cannot yet be used with: ' + info.frameworkPackageName); + if (!isRendererSupported) { + reasons.push( + dedent` + Please check the documentation for more information about its requirements and installation: + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest`} + ` + ); + } else { + reasons.push( + dedent` + Fear not, however, you can follow the manual installation process instead at: + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`} + ` + ); + } + + return reasons.map((r) => r.trim()).join('\n\n'); + } + + return null; + }; + + const result = await prerequisiteCheck(); + + if (result) { + printError('⛔️ Sorry!', result); + logger.line(1); return; } const vitestInfo = getVitestPluginInfo(info.frameworkPackageName); - const packages = ['vitest@latest', '@vitest/browser@latest', 'playwright@latest']; - if (info.frameworkPackageName === '@storybook/nextjs') { - logger.info( + printInfo( + '🍿 Just so you know...', dedent` - We detected that you're using Next.js. - We will configure the @storybook/experimental-nextjs-vite/vite-plugin to allow you to run tests in Vitest. + It looks like you're using Next.js. + + Adding ${colors.pink.bold(`@storybook/experimental-nextjs-vite/vite-plugin`)} so you can use it with Vitest. + + More info about the plugin at: ${c.cyan`https://github.com/storybookjs/vite-plugin-storybook-nextjs`} ` ); - try { const storybookVersion = await packageManager.getInstalledVersion('storybook'); - - packages.push(`@storybook/experimental-nextjs-vite@^${storybookVersion}`); + dependencies.push(`@storybook/experimental-nextjs-vite@^${storybookVersion}`); } catch (e) { console.error( 'Failed to install @storybook/experimental-nextjs-vite. Please install it manually' @@ -79,103 +163,185 @@ export default async function postInstall(options: PostinstallOptions) { } } - logger.info(c.bold('Installing packages...')); - logger.info(packages.join(', ')); - await packageManager.addDependencies({ installAsDevDependencies: true }, packages); + const versionedDependencies = dependencies.map((p) => { + if (p.includes('vitest')) { + return `${p}@${vitestVersionToInstall ?? 'latest'}`; + } + + return p; + }); + + if (versionedDependencies.length > 0) { + logger.line(1); + logger.plain(`${step} Installing dependencies:`); + logger.plain(colors.gray(' ' + versionedDependencies.join(', '))); + + await packageManager.addDependencies({ installAsDevDependencies: true }, versionedDependencies); + } + + logger.line(1); + logger.plain(`${step} Configuring Playwright with Chromium (this might take some time):`); + logger.plain(colors.gray(' npx playwright install chromium --with-deps')); - logger.info(c.bold('Executing npx playwright install chromium --with-deps ...')); await packageManager.executeCommand({ command: 'npx', args: ['playwright', 'install', 'chromium', '--with-deps'], }); - logger.info(c.bold('Writing .storybook/vitest.setup.ts file...')); + const vitestSetupFile = path.resolve(options.configDir, 'vitest.setup.ts'); + if (existsSync(vitestSetupFile)) { + printError( + '🚨 Oh no!', + dedent` + Found an existing Vitest setup file: + ${colors.gray(vitestSetupFile)} - const previewExists = extensions - .map((ext) => path.resolve(options.configDir, `preview${ext}`)) - .some((config) => existsSync(config)); + Please refer to the documentation to complete the setup manually: + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`} + ` + ); + logger.line(1); + return; + } + + logger.line(1); + logger.plain(`${step} Creating a Vitest setup file for Storybook:`); + logger.plain(colors.gray(` ${vitestSetupFile}`)); + + const previewExists = EXTENSIONS.map((ext) => + path.resolve(options.configDir, `preview${ext}`) + ).some((config) => existsSync(config)); await writeFile( - resolve(options.configDir, 'vitest.setup.ts'), + vitestSetupFile, dedent` - import { beforeAll } from 'vitest' - import { setProjectAnnotations } from '${annotationsImport}' - ${previewExists ? `import * as projectAnnotations from './preview'` : ''} + import { beforeAll } from 'vitest'; + import { setProjectAnnotations } from '${annotationsImport}'; + ${previewExists ? `import * as projectAnnotations from './preview';` : ''} - const project = setProjectAnnotations(${previewExists ? 'projectAnnotations' : '[]'}) + // This is an important step to apply the right configuration when testing your stories. + // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations + const project = setProjectAnnotations(${previewExists ? '[projectAnnotations]' : '[]'}); - beforeAll(project.beforeAll) + beforeAll(project.beforeAll); ` ); - // Check for an existing config file. Can be from Vitest (preferred) or Vite (with `test` option). - const viteConfigFiles = extensions.map((ext) => 'vite.config' + ext); - const viteConfig = await findUp(viteConfigFiles, { cwd: process.cwd() }); - const vitestConfigFiles = extensions.map((ext) => 'vitest.config' + ext); - const rootConfig = (await findUp(vitestConfigFiles, { cwd: process.cwd() })) || viteConfig; + // Check for existing Vitest workspace. We can't extend it so manual setup is required. + const vitestWorkspaceFile = await findFile('vitest.workspace'); + if (vitestWorkspaceFile) { + printError( + '🚨 Oh no!', + dedent` + Found an existing Vitest workspace file: + ${colors.gray(vitestWorkspaceFile)} - if (rootConfig) { - // If there's an existing config, we create a workspace file so we can run Storybook tests alongside. - const extname = path.extname(rootConfig); - const browserWorkspaceFile = resolve(dirname(rootConfig), `vitest.workspace${extname}`); - if (existsSync(browserWorkspaceFile)) { - logger.info( + I was able to configure most of the addon but could not safely extend + your existing workspace file automatically, you must do it yourself. This was the last step. + + Please refer to the documentation to complete the setup manually: + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`} + ` + ); + logger.line(1); + return; + } + + // Check for an existing config file. Can be from Vitest (preferred) or Vite (with `test` option). + const viteConfigFile = await findFile('vite.config'); + if (viteConfigFile) { + const viteConfig = await fs.readFile(viteConfigFile, 'utf8'); + if (viteConfig.match(/\Wtest:\s*{/)) { + printError( + '🚨 Oh no!', dedent` - We can not automatically setup the plugin when you use Vitest with workspaces. + You seem to have an existing test configuration in your Vite config file: + ${colors.gray(vitestWorkspaceFile)} + + I was able to configure most of the addon but could not safely extend + your existing workspace file automatically, you must do it yourself. This was the last step. + Please refer to the documentation to complete the setup manually: - https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#manual`} ` ); - } else { - logger.info(c.bold('Writing vitest.workspace.ts file...')); - await writeFile( - browserWorkspaceFile, - dedent` - import { defineWorkspace } from 'vitest/config'; - import { storybookTest } from '@storybook/experimental-addon-test/vite-plugin'; - ${vitestInfo.frameworkPluginImport ? vitestInfo.frameworkPluginImport + '\n' : ''} - export default defineWorkspace([ - '${relative(dirname(browserWorkspaceFile), rootConfig)}', - { - extends: '${viteConfig ? relative(dirname(browserWorkspaceFile), viteConfig) : ''}', - plugins: [ - storybookTest(),${vitestInfo.frameworkPluginCall ? '\n ' + vitestInfo.frameworkPluginCall : ''} - ], - test: { - browser: { - enabled: true, - headless: true, - name: 'chromium', - provider: 'playwright', - }, - include: ['**/*.stories.?(m)[jt]s?(x)'], - setupFiles: ['./.storybook/vitest.setup.ts'], + logger.line(1); + return; + } + } + + const vitestConfigFile = await findFile('vitest.config'); + const rootConfig = vitestConfigFile || viteConfigFile; + + if (rootConfig) { + // If there's an existing config, we create a workspace file so we can run Storybook tests alongside. + const extname = path.extname(rootConfig); + const browserWorkspaceFile = path.resolve(dirname(rootConfig), `vitest.workspace${extname}`); + + logger.line(1); + logger.plain(`${step} Creating a Vitest project workspace file:`); + logger.plain(colors.gray(` ${browserWorkspaceFile}`)); + + await writeFile( + browserWorkspaceFile, + dedent` + import { defineWorkspace } from 'vitest/config'; + import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport} + + // More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest + export default defineWorkspace([ + '${relative(dirname(browserWorkspaceFile), rootConfig)}', + { + extends: '${viteConfigFile ? relative(dirname(browserWorkspaceFile), viteConfigFile) : ''}', + plugins: [ + // See options at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#storybooktest + storybookTest(),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall} + ], + test: { + name: 'storybook', + browser: { + enabled: true, + headless: true, + name: 'chromium', + provider: 'playwright', }, + // Make sure to adjust this pattern to match your stories files. + include: ['**/*.stories.?(m)[jt]s?(x)'], + setupFiles: ['./.storybook/vitest.setup.ts'], }, - ]); - `.replace(/\s+extends: '',/, '') - ); - } + }, + ]); + `.replace(/\s+extends: '',/, '') + ); } else { // If there's no existing Vitest/Vite config, we create a new Vitest config file. - logger.info(c.bold('Writing vitest.config.ts file...')); + const newVitestConfigFile = path.resolve('vitest.config.ts'); + + logger.line(1); + logger.plain(`${step} Creating a Vitest project config file:`); + logger.plain(colors.gray(` ${newVitestConfigFile}`)); + await writeFile( - resolve('vitest.config.ts'), + newVitestConfigFile, dedent` - import { defineConfig } from "vitest/config"; - import { storybookTest } from "@storybook/experimental-addon-test/vite-plugin"; - ${vitestInfo.frameworkPluginImport ? vitestInfo.frameworkPluginImport + '\n' : ''} + import { defineConfig } from 'vitest/config'; + import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport} + + // More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest export default defineConfig({ plugins: [ - storybookTest(),${vitestInfo.frameworkPluginCall ? '\n' + vitestInfo.frameworkPluginCall : ''} + // See options at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest#storybooktest + storybookTest(),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall} ], test: { + name: 'storybook', browser: { enabled: true, headless: true, name: 'chromium', provider: 'playwright', }, + // Make sure to adjust this pattern to match your stories files. include: ['**/*.stories.?(m)[jt]s?(x)'], setupFiles: ['./.storybook/vitest.setup.ts'], }, @@ -184,37 +350,55 @@ export default async function postInstall(options: PostinstallOptions) { ); } - logger.info( + const runCommand = rootConfig ? `npx vitest --project=storybook` : `npx vitest`; + + printSuccess( + '🎉 All done!', dedent` - The Vitest addon is now configured and you're ready to run your tests! + The Storybook Test addon is now configured and you're ready to run your tests! + + Here are a couple of tips to get you started: + • You can run tests with ${colors.gray(runCommand)} + • When using the Vitest extension in your editor, all of your stories will be shown as tests! + Check the documentation for more information about its features and options at: - https://storybook.js.org/docs/writing-tests/test-runner-with-vitest + ${c.cyan`https://storybook.js.org/docs/writing-tests/test-runner-with-vitest`} ` ); + logger.line(1); } const getVitestPluginInfo = (framework: string) => { let frameworkPluginImport = ''; let frameworkPluginCall = ''; + let frameworkPluginDocs = ''; if (framework === '@storybook/nextjs') { frameworkPluginImport = - "import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin'"; + "import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin';"; + frameworkPluginDocs = + '// More info at: https://github.com/storybookjs/vite-plugin-storybook-nextjs'; frameworkPluginCall = 'storybookNextJsPlugin()'; } if (framework === '@storybook/sveltekit') { frameworkPluginImport = - "import { storybookSveltekitPlugin } from '@storybook/sveltekit/vite-plugin'"; + "import { storybookSveltekitPlugin } from '@storybook/sveltekit/vite-plugin';"; frameworkPluginCall = 'storybookSveltekitPlugin()'; } if (framework === '@storybook/vue3-vite') { - frameworkPluginImport = "import { storybookVuePlugin } from '@storybook/vue3-vite/vite-plugin'"; + frameworkPluginImport = + "import { storybookVuePlugin } from '@storybook/vue3-vite/vite-plugin';"; frameworkPluginCall = 'storybookVuePlugin()'; } - return { frameworkPluginImport, frameworkPluginCall }; + // spaces for file identation + frameworkPluginImport = `\n${frameworkPluginImport}`; + frameworkPluginDocs = frameworkPluginDocs ? `\n ${frameworkPluginDocs}` : ''; + frameworkPluginCall = frameworkPluginCall ? `\n ${frameworkPluginCall},` : ''; + + return { frameworkPluginImport, frameworkPluginCall, frameworkPluginDocs }; }; async function getFrameworkInfo({ configDir, packageManager: pkgMgr }: PostinstallOptions) { diff --git a/code/addons/test/src/plugin/global-setup.ts b/code/addons/test/src/vitest-plugin/global-setup.ts similarity index 100% rename from code/addons/test/src/plugin/global-setup.ts rename to code/addons/test/src/vitest-plugin/global-setup.ts diff --git a/code/addons/test/src/plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts similarity index 100% rename from code/addons/test/src/plugin/index.ts rename to code/addons/test/src/vitest-plugin/index.ts diff --git a/code/addons/test/src/plugin/setup-file.test.ts b/code/addons/test/src/vitest-plugin/setup-file.test.ts similarity index 100% rename from code/addons/test/src/plugin/setup-file.test.ts rename to code/addons/test/src/vitest-plugin/setup-file.test.ts diff --git a/code/addons/test/src/plugin/setup-file.ts b/code/addons/test/src/vitest-plugin/setup-file.ts similarity index 100% rename from code/addons/test/src/plugin/setup-file.ts rename to code/addons/test/src/vitest-plugin/setup-file.ts diff --git a/code/addons/test/src/plugin/test-utils.ts b/code/addons/test/src/vitest-plugin/test-utils.ts similarity index 100% rename from code/addons/test/src/plugin/test-utils.ts rename to code/addons/test/src/vitest-plugin/test-utils.ts diff --git a/code/addons/test/src/plugin/types.ts b/code/addons/test/src/vitest-plugin/types.ts similarity index 100% rename from code/addons/test/src/plugin/types.ts rename to code/addons/test/src/vitest-plugin/types.ts diff --git a/code/addons/test/src/plugin/viewports.test.ts b/code/addons/test/src/vitest-plugin/viewports.test.ts similarity index 100% rename from code/addons/test/src/plugin/viewports.test.ts rename to code/addons/test/src/vitest-plugin/viewports.test.ts diff --git a/code/addons/test/src/plugin/viewports.ts b/code/addons/test/src/vitest-plugin/viewports.ts similarity index 100% rename from code/addons/test/src/plugin/viewports.ts rename to code/addons/test/src/vitest-plugin/viewports.ts diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 87e37349f47d..e83374efdf5e 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index f0fa5b5bf958..af631dca4c59 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 724718303734..faafc88f0e63 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index fc4dbf92ce22..aa1239fd2f47 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index ad223680d6eb..c0cb7ac2cff4 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/package.json b/code/core/package.json index 2da448ffa6e0..b6497ac7809a 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -307,7 +307,7 @@ "@ndelangen/get-tarball": "^3.0.7", "@popperjs/core": "^2.6.0", "@radix-ui/react-dialog": "^1.0.5", - "@radix-ui/react-scroll-area": "^1.0.5", + "@radix-ui/react-scroll-area": "1.2.0-rc.7", "@radix-ui/react-slot": "^1.0.2", "@storybook/docs-mdx": "4.0.0-next.1", "@storybook/global": "^5.0.0", diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index efad4705e14c..ed064cc606f5 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -1,87 +1,87 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.3.0-beta.2', - '@storybook/addon-actions': '8.3.0-beta.2', - '@storybook/addon-backgrounds': '8.3.0-beta.2', - '@storybook/addon-controls': '8.3.0-beta.2', - '@storybook/addon-docs': '8.3.0-beta.2', - '@storybook/addon-essentials': '8.3.0-beta.2', - '@storybook/addon-mdx-gfm': '8.3.0-beta.2', - '@storybook/addon-highlight': '8.3.0-beta.2', - '@storybook/addon-interactions': '8.3.0-beta.2', - '@storybook/addon-jest': '8.3.0-beta.2', - '@storybook/addon-links': '8.3.0-beta.2', - '@storybook/addon-measure': '8.3.0-beta.2', - '@storybook/addon-onboarding': '8.3.0-beta.2', - '@storybook/addon-outline': '8.3.0-beta.2', - '@storybook/addon-storysource': '8.3.0-beta.2', - '@storybook/experimental-addon-test': '8.3.0-beta.2', - '@storybook/addon-themes': '8.3.0-beta.2', - '@storybook/addon-toolbars': '8.3.0-beta.2', - '@storybook/addon-viewport': '8.3.0-beta.2', - '@storybook/builder-vite': '8.3.0-beta.2', - '@storybook/builder-webpack5': '8.3.0-beta.2', - '@storybook/core': '8.3.0-beta.2', - '@storybook/builder-manager': '8.3.0-beta.2', - '@storybook/channels': '8.3.0-beta.2', - '@storybook/client-logger': '8.3.0-beta.2', - '@storybook/components': '8.3.0-beta.2', - '@storybook/core-common': '8.3.0-beta.2', - '@storybook/core-events': '8.3.0-beta.2', - '@storybook/core-server': '8.3.0-beta.2', - '@storybook/csf-tools': '8.3.0-beta.2', - '@storybook/docs-tools': '8.3.0-beta.2', - '@storybook/manager': '8.3.0-beta.2', - '@storybook/manager-api': '8.3.0-beta.2', - '@storybook/node-logger': '8.3.0-beta.2', - '@storybook/preview': '8.3.0-beta.2', - '@storybook/preview-api': '8.3.0-beta.2', - '@storybook/router': '8.3.0-beta.2', - '@storybook/telemetry': '8.3.0-beta.2', - '@storybook/theming': '8.3.0-beta.2', - '@storybook/types': '8.3.0-beta.2', - '@storybook/angular': '8.3.0-beta.2', - '@storybook/ember': '8.3.0-beta.2', - '@storybook/experimental-nextjs-vite': '8.3.0-beta.2', - '@storybook/html-vite': '8.3.0-beta.2', - '@storybook/html-webpack5': '8.3.0-beta.2', - '@storybook/nextjs': '8.3.0-beta.2', - '@storybook/preact-vite': '8.3.0-beta.2', - '@storybook/preact-webpack5': '8.3.0-beta.2', - '@storybook/react-vite': '8.3.0-beta.2', - '@storybook/react-webpack5': '8.3.0-beta.2', - '@storybook/server-webpack5': '8.3.0-beta.2', - '@storybook/svelte-vite': '8.3.0-beta.2', - '@storybook/svelte-webpack5': '8.3.0-beta.2', - '@storybook/sveltekit': '8.3.0-beta.2', - '@storybook/vue3-vite': '8.3.0-beta.2', - '@storybook/vue3-webpack5': '8.3.0-beta.2', - '@storybook/web-components-vite': '8.3.0-beta.2', - '@storybook/web-components-webpack5': '8.3.0-beta.2', - '@storybook/blocks': '8.3.0-beta.2', - storybook: '8.3.0-beta.2', - sb: '8.3.0-beta.2', - '@storybook/cli': '8.3.0-beta.2', - '@storybook/codemod': '8.3.0-beta.2', - '@storybook/core-webpack': '8.3.0-beta.2', - 'create-storybook': '8.3.0-beta.2', - '@storybook/csf-plugin': '8.3.0-beta.2', - '@storybook/instrumenter': '8.3.0-beta.2', - '@storybook/react-dom-shim': '8.3.0-beta.2', - '@storybook/source-loader': '8.3.0-beta.2', - '@storybook/test': '8.3.0-beta.2', - '@storybook/preset-create-react-app': '8.3.0-beta.2', - '@storybook/preset-html-webpack': '8.3.0-beta.2', - '@storybook/preset-preact-webpack': '8.3.0-beta.2', - '@storybook/preset-react-webpack': '8.3.0-beta.2', - '@storybook/preset-server-webpack': '8.3.0-beta.2', - '@storybook/preset-svelte-webpack': '8.3.0-beta.2', - '@storybook/preset-vue3-webpack': '8.3.0-beta.2', - '@storybook/html': '8.3.0-beta.2', - '@storybook/preact': '8.3.0-beta.2', - '@storybook/react': '8.3.0-beta.2', - '@storybook/server': '8.3.0-beta.2', - '@storybook/svelte': '8.3.0-beta.2', - '@storybook/vue3': '8.3.0-beta.2', - '@storybook/web-components': '8.3.0-beta.2', + '@storybook/addon-a11y': '8.3.0-beta.4', + '@storybook/addon-actions': '8.3.0-beta.4', + '@storybook/addon-backgrounds': '8.3.0-beta.4', + '@storybook/addon-controls': '8.3.0-beta.4', + '@storybook/addon-docs': '8.3.0-beta.4', + '@storybook/addon-essentials': '8.3.0-beta.4', + '@storybook/addon-mdx-gfm': '8.3.0-beta.4', + '@storybook/addon-highlight': '8.3.0-beta.4', + '@storybook/addon-interactions': '8.3.0-beta.4', + '@storybook/addon-jest': '8.3.0-beta.4', + '@storybook/addon-links': '8.3.0-beta.4', + '@storybook/addon-measure': '8.3.0-beta.4', + '@storybook/addon-onboarding': '8.3.0-beta.4', + '@storybook/addon-outline': '8.3.0-beta.4', + '@storybook/addon-storysource': '8.3.0-beta.4', + '@storybook/experimental-addon-test': '8.3.0-beta.4', + '@storybook/addon-themes': '8.3.0-beta.4', + '@storybook/addon-toolbars': '8.3.0-beta.4', + '@storybook/addon-viewport': '8.3.0-beta.4', + '@storybook/builder-vite': '8.3.0-beta.4', + '@storybook/builder-webpack5': '8.3.0-beta.4', + '@storybook/core': '8.3.0-beta.4', + '@storybook/builder-manager': '8.3.0-beta.4', + '@storybook/channels': '8.3.0-beta.4', + '@storybook/client-logger': '8.3.0-beta.4', + '@storybook/components': '8.3.0-beta.4', + '@storybook/core-common': '8.3.0-beta.4', + '@storybook/core-events': '8.3.0-beta.4', + '@storybook/core-server': '8.3.0-beta.4', + '@storybook/csf-tools': '8.3.0-beta.4', + '@storybook/docs-tools': '8.3.0-beta.4', + '@storybook/manager': '8.3.0-beta.4', + '@storybook/manager-api': '8.3.0-beta.4', + '@storybook/node-logger': '8.3.0-beta.4', + '@storybook/preview': '8.3.0-beta.4', + '@storybook/preview-api': '8.3.0-beta.4', + '@storybook/router': '8.3.0-beta.4', + '@storybook/telemetry': '8.3.0-beta.4', + '@storybook/theming': '8.3.0-beta.4', + '@storybook/types': '8.3.0-beta.4', + '@storybook/angular': '8.3.0-beta.4', + '@storybook/ember': '8.3.0-beta.4', + '@storybook/experimental-nextjs-vite': '8.3.0-beta.4', + '@storybook/html-vite': '8.3.0-beta.4', + '@storybook/html-webpack5': '8.3.0-beta.4', + '@storybook/nextjs': '8.3.0-beta.4', + '@storybook/preact-vite': '8.3.0-beta.4', + '@storybook/preact-webpack5': '8.3.0-beta.4', + '@storybook/react-vite': '8.3.0-beta.4', + '@storybook/react-webpack5': '8.3.0-beta.4', + '@storybook/server-webpack5': '8.3.0-beta.4', + '@storybook/svelte-vite': '8.3.0-beta.4', + '@storybook/svelte-webpack5': '8.3.0-beta.4', + '@storybook/sveltekit': '8.3.0-beta.4', + '@storybook/vue3-vite': '8.3.0-beta.4', + '@storybook/vue3-webpack5': '8.3.0-beta.4', + '@storybook/web-components-vite': '8.3.0-beta.4', + '@storybook/web-components-webpack5': '8.3.0-beta.4', + '@storybook/blocks': '8.3.0-beta.4', + storybook: '8.3.0-beta.4', + sb: '8.3.0-beta.4', + '@storybook/cli': '8.3.0-beta.4', + '@storybook/codemod': '8.3.0-beta.4', + '@storybook/core-webpack': '8.3.0-beta.4', + 'create-storybook': '8.3.0-beta.4', + '@storybook/csf-plugin': '8.3.0-beta.4', + '@storybook/instrumenter': '8.3.0-beta.4', + '@storybook/react-dom-shim': '8.3.0-beta.4', + '@storybook/source-loader': '8.3.0-beta.4', + '@storybook/test': '8.3.0-beta.4', + '@storybook/preset-create-react-app': '8.3.0-beta.4', + '@storybook/preset-html-webpack': '8.3.0-beta.4', + '@storybook/preset-preact-webpack': '8.3.0-beta.4', + '@storybook/preset-react-webpack': '8.3.0-beta.4', + '@storybook/preset-server-webpack': '8.3.0-beta.4', + '@storybook/preset-svelte-webpack': '8.3.0-beta.4', + '@storybook/preset-vue3-webpack': '8.3.0-beta.4', + '@storybook/html': '8.3.0-beta.4', + '@storybook/preact': '8.3.0-beta.4', + '@storybook/react': '8.3.0-beta.4', + '@storybook/server': '8.3.0-beta.4', + '@storybook/svelte': '8.3.0-beta.4', + '@storybook/vue3': '8.3.0-beta.4', + '@storybook/web-components': '8.3.0-beta.4', }; diff --git a/code/core/src/manager-api/version.ts b/code/core/src/manager-api/version.ts index 0661e8936b6c..1c66037e4d34 100644 --- a/code/core/src/manager-api/version.ts +++ b/code/core/src/manager-api/version.ts @@ -1 +1 @@ -export const version = '8.3.0-beta.2'; +export const version = '8.3.0-beta.4'; diff --git a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx index b682ba959837..972606b79598 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx @@ -143,6 +143,42 @@ export const WithRefs: Story = { }, }; +export const WithRefsNarrow: Story = { + args: { + refs: { + wide: { + ...refs.optimized, + title: 'This is a ref with a very long title', + }, + }, + }, + parameters: { + viewport: { + options: { + narrow: { + name: 'narrow', + styles: { + width: '400px', + height: '800px', + }, + }, + }, + }, + chromatic: { + modes: { + narrow: { + viewport: 400, + }, + }, + }, + }, + globals: { + viewport: { + value: 'narrow', + }, + }, +}; + export const LoadingWithRefs: Story = { args: { ...Loading.args, diff --git a/code/deprecated/builder-manager/package.json b/code/deprecated/builder-manager/package.json index 1767ebae20cc..7b388a902566 100644 --- a/code/deprecated/builder-manager/package.json +++ b/code/deprecated/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/deprecated/channels/package.json b/code/deprecated/channels/package.json index 6df04e8b899f..d00f6021aed4 100644 --- a/code/deprecated/channels/package.json +++ b/code/deprecated/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-logger/package.json b/code/deprecated/client-logger/package.json index 2a944a19a731..57c2cf4316d6 100644 --- a/code/deprecated/client-logger/package.json +++ b/code/deprecated/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/components/package.json b/code/deprecated/components/package.json index f10f19ffb505..f97b5c2aef14 100644 --- a/code/deprecated/components/package.json +++ b/code/deprecated/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/core-common/package.json b/code/deprecated/core-common/package.json index 7027b8ad40e5..89b42c158fe5 100644 --- a/code/deprecated/core-common/package.json +++ b/code/deprecated/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/core-events/package.json b/code/deprecated/core-events/package.json index 64f3ddb887bd..0a21e7d9e8c4 100644 --- a/code/deprecated/core-events/package.json +++ b/code/deprecated/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/deprecated/core-server/package.json b/code/deprecated/core-server/package.json index 5fea92edc866..2a09a96d174d 100644 --- a/code/deprecated/core-server/package.json +++ b/code/deprecated/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/csf-tools/package.json b/code/deprecated/csf-tools/package.json index e9166328f53a..2703425d8857 100644 --- a/code/deprecated/csf-tools/package.json +++ b/code/deprecated/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/deprecated/docs-tools/package.json b/code/deprecated/docs-tools/package.json index 0883fea9ac84..d952c1789ce4 100644 --- a/code/deprecated/docs-tools/package.json +++ b/code/deprecated/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api/package.json b/code/deprecated/manager-api/package.json index 8afc5897a48a..65449140e3d5 100644 --- a/code/deprecated/manager-api/package.json +++ b/code/deprecated/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/deprecated/manager/package.json b/code/deprecated/manager/package.json index 02aa2fb8b31e..30ec9ee1459d 100644 --- a/code/deprecated/manager/package.json +++ b/code/deprecated/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook UI", "keywords": [ "storybook" diff --git a/code/deprecated/node-logger/package.json b/code/deprecated/node-logger/package.json index 1bb83d43db27..d26f3d0fb207 100644 --- a/code/deprecated/node-logger/package.json +++ b/code/deprecated/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview-api/package.json b/code/deprecated/preview-api/package.json index 9eb08df8dc42..1bcedb15c9ba 100644 --- a/code/deprecated/preview-api/package.json +++ b/code/deprecated/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview/package.json b/code/deprecated/preview/package.json index 0aaf64218c49..5e293120aa4d 100644 --- a/code/deprecated/preview/package.json +++ b/code/deprecated/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/router/package.json b/code/deprecated/router/package.json index 0db062a08bcf..83b20c6f6b31 100644 --- a/code/deprecated/router/package.json +++ b/code/deprecated/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/deprecated/telemetry/package.json b/code/deprecated/telemetry/package.json index 5b5893077b9d..909e98511df3 100644 --- a/code/deprecated/telemetry/package.json +++ b/code/deprecated/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/deprecated/theming/package.json b/code/deprecated/theming/package.json index b30b2131bf09..803249838852 100644 --- a/code/deprecated/theming/package.json +++ b/code/deprecated/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/types/package.json b/code/deprecated/types/package.json index d06b79c15a57..da38c9b0cea1 100644 --- a/code/deprecated/types/package.json +++ b/code/deprecated/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 4289c3d1c247..1f299fad3865 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index b5bbca754326..0ccf6e3e8511 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index 098bbc990196..18c1ad61eb65 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-nextjs-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Next.js and Vite", "keywords": [ "storybook", @@ -55,8 +55,8 @@ }, "./vite-plugin": { "types": "./dist/vite-plugin/index.d.ts", - "import": "./dist/vite-plugin/index.js", - "require": "./dist/vite-plugin/index.cjs" + "import": "./dist/vite-plugin/index.mjs", + "require": "./dist/vite-plugin/index.js" }, "./package.json": "./package.json" }, @@ -107,6 +107,7 @@ "typescript": "^5.3.2" }, "peerDependencies": { + "@storybook/test": "workspace:*", "next": "^14.1.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 521a19650f0a..c96bb225cbb7 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 9a4e471c0978..d942efb70359 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index e0f5cbb511e0..415e57c96964 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Next.js", "keywords": [ "storybook", @@ -160,7 +160,7 @@ "sass-loader": "^12.4.0", "semver": "^7.3.5", "style-loader": "^3.3.1", - "styled-jsx": "5.1.1", + "styled-jsx": "^5.1.6", "ts-dedent": "^2.0.0", "tsconfig-paths": "^4.0.0", "tsconfig-paths-webpack-plugin": "^4.0.1" diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index ded9f46d52b5..7901cc54ddb1 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index e76d151efdc7..5924abce7021 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 97f10e09e620..ffcab019deb2 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index b788f45179b7..8fa2d42ff357 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 66ba71580313..b77941e0f4e7 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 9a31cf72157a..f2b87e3bc268 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index beb9fefba0ad..f368810a808b 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 9ce67b30dee2..f76c5e909f4e 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index e5b461e32585..081720b77961 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index f7d845209dc2..965b4020a46f 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 95aeff843780..64ded4415b44 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 2606ad0ff2cc..b3fe2ca851a9 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index ac86c5f6c80e..c6f1f96d7fae 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 5743737b83f6..20382e2fec72 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 19a5d4e38043..d37d1aaf529e 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/src/add.ts b/code/lib/cli-storybook/src/add.ts index d0e64efdf443..522fb4b6899e 100644 --- a/code/lib/cli-storybook/src/add.ts +++ b/code/lib/cli-storybook/src/add.ts @@ -10,6 +10,7 @@ import { } from 'storybook/internal/common'; import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; +import prompts from 'prompts'; import SemVer from 'semver'; import { dedent } from 'ts-dedent'; @@ -97,19 +98,28 @@ export async function add( if (typeof configDir === 'undefined') { throw new Error(dedent` - Unable to find storybook config directory + Unable to find storybook config directory. Please specify your Storybook config directory with the --config-dir flag. `); } if (!mainConfig) { - logger.error('Unable to find storybook main.js config'); + logger.error('Unable to find Storybook main.js config'); return; } + let shouldAddToMain = true; if (checkInstalled(addonName, requireMain(configDir))) { - throw new Error(dedent` - Addon ${addonName} is already installed; we skipped adding it to your ${mainConfig}. - `); + const { shouldForceInstall } = await prompts({ + type: 'confirm', + name: 'shouldForceInstall', + message: `The Storybook addon "${addonName}" is already present in ${mainConfig}. Do you wish to install it again?`, + }); + + if (!shouldForceInstall) { + return; + } + + shouldAddToMain = false; } const main = await readConfig(mainConfig); @@ -139,18 +149,20 @@ export async function add( logger.log(`Installing ${addonWithVersion}`); await packageManager.addDependencies({ installAsDevDependencies: true }, [addonWithVersion]); - logger.log(`Adding '${addon}' to main.js addons field.`); + if (shouldAddToMain) { + logger.log(`Adding '${addon}' to the "addons" field in ${mainConfig}`); - const mainConfigAddons = main.getFieldNode(['addons']); - if (mainConfigAddons && getRequireWrapperName(main) !== null) { - const addonNode = main.valueToNode(addonName); - main.appendNodeToArray(['addons'], addonNode as any); - wrapValueWithRequireWrapper(main, addonNode as any); - } else { - main.appendValueToArray(['addons'], addonName); - } + const mainConfigAddons = main.getFieldNode(['addons']); + if (mainConfigAddons && getRequireWrapperName(main) !== null) { + const addonNode = main.valueToNode(addonName); + main.appendNodeToArray(['addons'], addonNode as any); + wrapValueWithRequireWrapper(main, addonNode as any); + } else { + main.appendValueToArray(['addons'], addonName); + } - await writeConfig(main); + await writeConfig(main); + } if (!skipPostinstall && isCoreAddon(addonName)) { await postinstallAddon(addonName, { packageManager: packageManager.type, configDir }); diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 9731af8d21cf..bda6d2d79d6f 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 35d467ad3d4c..d23937951533 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 28bc9a4e5240..3ff2f28e586e 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/create-storybook/package.json b/code/lib/create-storybook/package.json index 9c24463ffe59..187bd286a799 100644 --- a/code/lib/create-storybook/package.json +++ b/code/lib/create-storybook/package.json @@ -1,6 +1,6 @@ { "name": "create-storybook", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Initialize Storybook into your project", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/create-storybook", "bugs": { diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index ec96de04c625..721dab51a263 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 58577b4ae4ac..ff16fc3e7b01 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 8fac8f7d9cb6..caaeed8cb007 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 3389ba2820d0..22e617fc9c6b 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/test/package.json b/code/lib/test/package.json index af353c830615..6bcc55ef4574 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index 40355bc18e1b..aa4f7f09cf97 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index ed2930f3e86a..e77c0aad747a 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index f219c4644ed0..40a127610a18 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 88a8b657e5c4..638ff695aca0 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 846947ba5b62..76244cac1bf7 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index a17df0763793..b58cd2a73bf9 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 520a8c6157d6..1c5ccf77b50b 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 66d1532f4f19..6a692823e2d4 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index ae3682b70adc..de24babe4b8e 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 01d2a9de0e70..cc83c3a83951 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 03c7daee6606..10f5c58b4588 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 5f4dd895c939..f699fde6b410 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 9858889861ee..e09bd81b0d32 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index bf7d142a789f..77faa267b610 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 033d7c1bab40..f2c1b0b34caf 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.3.0-beta.2", + "version": "8.3.0-beta.4", "description": "Storybook web-components renderer", "keywords": [ "lit", diff --git a/code/yarn.lock b/code/yarn.lock index 83b4b2ba2bdc..80ebe411b341 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -4670,12 +4670,10 @@ __metadata: languageName: node linkType: hard -"@radix-ui/number@npm:1.0.1": - version: 1.0.1 - resolution: "@radix-ui/number@npm:1.0.1" - dependencies: - "@babel/runtime": "npm:^7.13.10" - checksum: 10c0/42e4870cd14459da6da03e43c7507dc4c807ed787a87bda52912a0d1d6d5013326b697c18c9625fc6a2cf0af2b45d9c86747985b45358fd92ab646b983978e3c +"@radix-ui/number@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/number@npm:1.1.0" + checksum: 10c0/a48e34d5ff1484de1b7cf5d7317fefc831d49e96a2229f300fd37b657bd8cfb59c922830c00ec02838ab21de3b299a523474592e4f30882153412ed47edce6a4 languageName: node linkType: hard @@ -4688,6 +4686,13 @@ __metadata: languageName: node linkType: hard +"@radix-ui/primitive@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/primitive@npm:1.1.0" + checksum: 10c0/1dcc8b5401799416ff8bdb15c7189b4536c193220ad8fd348a48b88f804ee38cec7bd03e2b9641f7da24610e2f61f23a306911ce883af92c4e8c1abac634cb61 + languageName: node + linkType: hard + "@radix-ui/react-compose-refs@npm:1.0.1": version: 1.0.1 resolution: "@radix-ui/react-compose-refs@npm:1.0.1" @@ -4703,6 +4708,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-compose-refs@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-compose-refs@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/7e18706084397d9458ca3473d8565b10691da06f6499a78edbcc4bd72cde08f62e91120658d17d58c19fc39d6b1dffe0133cc4535c8f5fce470abd478f6107e5 + languageName: node + linkType: hard + "@radix-ui/react-context@npm:1.0.1": version: 1.0.1 resolution: "@radix-ui/react-context@npm:1.0.1" @@ -4718,6 +4736,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-context@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-context@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/c843980f568cc61b512708863ec84c42a02e0f88359b22ad1c0e290cea3e6d7618eccbd2cd37bd974fadaa7636cbed5bda27553722e61197eb53852eaa34f1bb + languageName: node + linkType: hard + "@radix-ui/react-dialog@npm:^1.0.5": version: 1.0.5 resolution: "@radix-ui/react-dialog@npm:1.0.5" @@ -4751,18 +4782,16 @@ __metadata: languageName: node linkType: hard -"@radix-ui/react-direction@npm:1.0.1": - version: 1.0.1 - resolution: "@radix-ui/react-direction@npm:1.0.1" - dependencies: - "@babel/runtime": "npm:^7.13.10" +"@radix-ui/react-direction@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-direction@npm:1.1.0" peerDependencies: "@types/react": "*" - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: "@types/react": optional: true - checksum: 10c0/b1a45b4d1d5070ca3b5864b920f6c6210c962bdb519abb62b38b1baef9d06737dc3d8ecdb61860b7504a735235a539652f5977c7299ec021da84e6b0f64d988a + checksum: 10c0/eb07d8cc3ae2388b824e0a11ae0e3b71fb0c49972b506e249cec9f27a5b7ef4305ee668c98b674833c92e842163549a83beb0a197dec1ec65774bdeeb61f932c languageName: node linkType: hard @@ -4884,6 +4913,26 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-presence@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-presence@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": "npm:1.1.0" + "@radix-ui/react-use-layout-effect": "npm:1.1.0" + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 10c0/58acb658b15b72991ad7a234ea90995902c470b3a182aa90ad03145cbbeaa40f211700c444bfa14cf47537cbb6b732e1359bc5396182de839bd680843c11bf31 + languageName: node + linkType: hard + "@radix-ui/react-primitive@npm:1.0.3": version: 1.0.3 resolution: "@radix-ui/react-primitive@npm:1.0.3" @@ -4904,31 +4953,49 @@ __metadata: languageName: node linkType: hard -"@radix-ui/react-scroll-area@npm:^1.0.5": - version: 1.0.5 - resolution: "@radix-ui/react-scroll-area@npm:1.0.5" +"@radix-ui/react-primitive@npm:2.0.0": + version: 2.0.0 + resolution: "@radix-ui/react-primitive@npm:2.0.0" dependencies: - "@babel/runtime": "npm:^7.13.10" - "@radix-ui/number": "npm:1.0.1" - "@radix-ui/primitive": "npm:1.0.1" - "@radix-ui/react-compose-refs": "npm:1.0.1" - "@radix-ui/react-context": "npm:1.0.1" - "@radix-ui/react-direction": "npm:1.0.1" - "@radix-ui/react-presence": "npm:1.0.1" - "@radix-ui/react-primitive": "npm:1.0.3" - "@radix-ui/react-use-callback-ref": "npm:1.0.1" - "@radix-ui/react-use-layout-effect": "npm:1.0.1" + "@radix-ui/react-slot": "npm:1.1.0" peerDependencies: "@types/react": "*" "@types/react-dom": "*" - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: "@types/react": optional: true "@types/react-dom": optional: true - checksum: 10c0/a08818aeeb15920a02e708699a8bdc85c26eab0579ab741129b464a799b5d9a04f81810a2d200f1cf4aef03452067770e87b0f81593a689350fcd7e51819e4cb + checksum: 10c0/00cb6ca499252ca848c299212ba6976171cea7608b10b3f9a9639d6732dea2df1197ba0d97c001a4fdb29313c3e7fc2a490f6245dd3579617a0ffd85ae964fdd + languageName: node + linkType: hard + +"@radix-ui/react-scroll-area@npm:1.2.0-rc.7": + version: 1.2.0-rc.7 + resolution: "@radix-ui/react-scroll-area@npm:1.2.0-rc.7" + dependencies: + "@radix-ui/number": "npm:1.1.0" + "@radix-ui/primitive": "npm:1.1.0" + "@radix-ui/react-compose-refs": "npm:1.1.0" + "@radix-ui/react-context": "npm:1.1.0" + "@radix-ui/react-direction": "npm:1.1.0" + "@radix-ui/react-presence": "npm:1.1.0" + "@radix-ui/react-primitive": "npm:2.0.0" + "@radix-ui/react-use-callback-ref": "npm:1.1.0" + "@radix-ui/react-use-layout-effect": "npm:1.1.0" + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 10c0/61bc26101508d9956ed07e7464cd90a37439b9d2fec2c4ee4f4383d10a8e19d34b7be4dafaa04ded05b46a3519168fa5898328bd814fed73da06c1bcbd2b884e languageName: node linkType: hard @@ -4948,6 +5015,21 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-slot@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-slot@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": "npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/a2e8bfb70c440506dd84a1a274f9a8bc433cca37ceae275e53552c9122612e3837744d7fc6f113d6ef1a11491aa914f4add71d76de41cb6d4db72547a8e261ae + languageName: node + linkType: hard + "@radix-ui/react-use-callback-ref@npm:1.0.1": version: 1.0.1 resolution: "@radix-ui/react-use-callback-ref@npm:1.0.1" @@ -4963,6 +5045,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-use-callback-ref@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-callback-ref@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/e954863f3baa151faf89ac052a5468b42650efca924417470efd1bd254b411a94c69c30de2fdbb90187b38cb984795978e12e30423dc41e4309d93d53b66d819 + languageName: node + linkType: hard + "@radix-ui/react-use-controllable-state@npm:1.0.1": version: 1.0.1 resolution: "@radix-ui/react-use-controllable-state@npm:1.0.1" @@ -5010,6 +5105,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-use-layout-effect@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-layout-effect@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/9bf87ece1845c038ed95863cfccf9d75f557c2400d606343bab0ab3192b9806b9840e6aa0a0333fdf3e83cf9982632852192f3e68d7d8367bc8c788dfdf8e62b + languageName: node + linkType: hard + "@rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.1.0": version: 5.1.0 resolution: "@rollup/pluginutils@npm:5.1.0" @@ -5915,7 +6023,7 @@ __metadata: "@ndelangen/get-tarball": "npm:^3.0.7" "@popperjs/core": "npm:^2.6.0" "@radix-ui/react-dialog": "npm:^1.0.5" - "@radix-ui/react-scroll-area": "npm:^1.0.5" + "@radix-ui/react-scroll-area": "npm:1.2.0-rc.7" "@radix-ui/react-slot": "npm:^1.0.2" "@storybook/csf": "npm:^0.1.11" "@storybook/docs-mdx": "npm:4.0.0-next.1" @@ -6131,8 +6239,11 @@ __metadata: resolution: "@storybook/experimental-addon-test@workspace:addons/test" dependencies: "@storybook/csf": "npm:^0.1.11" + "@types/semver": "npm:^7" "@vitest/browser": "npm:^2.0.0" + boxen: "npm:^8.0.1" find-up: "npm:^7.0.0" + semver: "npm:^7.6.3" tinyrainbow: "npm:^1.2.0" ts-dedent: "npm:^2.2.0" vitest: "npm:^2.0.0" @@ -6157,6 +6268,7 @@ __metadata: typescript: "npm:^5.3.2" vite-plugin-storybook-nextjs: "npm:^1.0.10" peerDependencies: + "@storybook/test": "workspace:*" next: ^14.1.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta @@ -6336,7 +6448,7 @@ __metadata: semver: "npm:^7.3.5" sharp: "npm:^0.33.3" style-loader: "npm:^3.3.1" - styled-jsx: "npm:5.1.1" + styled-jsx: "npm:^5.1.6" ts-dedent: "npm:^2.0.0" tsconfig-paths: "npm:^4.0.0" tsconfig-paths-webpack-plugin: "npm:^4.0.1" @@ -8175,7 +8287,7 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.3.12, @types/semver@npm:^7.3.4, @types/semver@npm:^7.5.0, @types/semver@npm:^7.5.6, @types/semver@npm:^7.5.8": +"@types/semver@npm:^7, @types/semver@npm:^7.3.12, @types/semver@npm:^7.3.4, @types/semver@npm:^7.5.0, @types/semver@npm:^7.5.6, @types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa @@ -9760,7 +9872,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0": +"ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0, ansi-styles@npm:^6.2.1": version: 6.2.1 resolution: "ansi-styles@npm:6.2.1" checksum: 10c0/5d1ec38c123984bcedd996eac680d548f31828bd679a66db2bdf11844634dde55fec3efa9c6bb1d89056a5e79c1ac540c4c784d592ea1d25028a92227d2f2d5c @@ -10716,6 +10828,22 @@ __metadata: languageName: node linkType: hard +"boxen@npm:^8.0.1": + version: 8.0.1 + resolution: "boxen@npm:8.0.1" + dependencies: + ansi-align: "npm:^3.0.1" + camelcase: "npm:^8.0.0" + chalk: "npm:^5.3.0" + cli-boxes: "npm:^3.0.0" + string-width: "npm:^7.2.0" + type-fest: "npm:^4.21.0" + widest-line: "npm:^5.0.0" + wrap-ansi: "npm:^9.0.0" + checksum: 10c0/8c54f9797bf59eec0b44c9043d9cb5d5b2783dc673e4650235e43a5155c43334e78ec189fd410cf92056c1054aee3758279809deed115b49e68f1a1c6b3faa32 + languageName: node + linkType: hard + "bplist-parser@npm:^0.2.0": version: 0.2.0 resolution: "bplist-parser@npm:0.2.0" @@ -13621,6 +13749,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^10.3.0": + version: 10.4.0 + resolution: "emoji-regex@npm:10.4.0" + checksum: 10c0/a3fcedfc58bfcce21a05a5f36a529d81e88d602100145fcca3dc6f795e3c8acc4fc18fe773fbf9b6d6e9371205edb3afa2668ec3473fa2aa7fd47d2a9d46482d + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -15922,6 +16057,13 @@ __metadata: languageName: node linkType: hard +"get-east-asian-width@npm:^1.0.0": + version: 1.2.0 + resolution: "get-east-asian-width@npm:1.2.0" + checksum: 10c0/914b1e217cf38436c24b4c60b4c45289e39a45bf9e65ef9fd343c2815a1a02b8a0215aeec8bf9c07c516089004b6e3826332481f40a09529fcadbf6e579f286b + languageName: node + linkType: hard + "get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": version: 2.0.2 resolution: "get-func-name@npm:2.0.2" @@ -25335,6 +25477,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.6.3": + version: 7.6.3 + resolution: "semver@npm:7.6.3" + bin: + semver: bin/semver.js + checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf + languageName: node + linkType: hard + "send@npm:0.18.0": version: 0.18.0 resolution: "send@npm:0.18.0" @@ -26231,6 +26382,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^7.0.0, string-width@npm:^7.2.0": + version: 7.2.0 + resolution: "string-width@npm:7.2.0" + dependencies: + emoji-regex: "npm:^10.3.0" + get-east-asian-width: "npm:^1.0.0" + strip-ansi: "npm:^7.1.0" + checksum: 10c0/eb0430dd43f3199c7a46dcbf7a0b34539c76fe3aa62763d0b0655acdcbdf360b3f66f3d58ca25ba0205f42ea3491fa00f09426d3b7d3040e506878fc7664c9b9 + languageName: node + linkType: hard + "string.prototype.matchall@npm:^4.0.8": version: 4.0.10 resolution: "string.prototype.matchall@npm:4.0.10" @@ -26458,7 +26620,7 @@ __metadata: languageName: node linkType: hard -"styled-jsx@npm:5.1.6": +"styled-jsx@npm:5.1.6, styled-jsx@npm:^5.1.6": version: 5.1.6 resolution: "styled-jsx@npm:5.1.6" dependencies: @@ -29254,6 +29416,15 @@ __metadata: languageName: node linkType: hard +"widest-line@npm:^5.0.0": + version: 5.0.0 + resolution: "widest-line@npm:5.0.0" + dependencies: + string-width: "npm:^7.0.0" + checksum: 10c0/6bd6cca8cda502ef50e05353fd25de0df8c704ffc43ada7e0a9cf9a5d4f4e12520485d80e0b77cec8a21f6c3909042fcf732aa9281e5dbb98cc9384a138b2578 + languageName: node + linkType: hard + "wildcard@npm:^2.0.0": version: 2.0.1 resolution: "wildcard@npm:2.0.1" @@ -29333,6 +29504,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^9.0.0": + version: 9.0.0 + resolution: "wrap-ansi@npm:9.0.0" + dependencies: + ansi-styles: "npm:^6.2.1" + string-width: "npm:^7.0.0" + strip-ansi: "npm:^7.1.0" + checksum: 10c0/a139b818da9573677548dd463bd626a5a5286271211eb6e4e82f34a4f643191d74e6d4a9bb0a3c26ec90e6f904f679e0569674ac099ea12378a8b98e20706066 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" diff --git a/docs/versions/next.json b/docs/versions/next.json index cee5922cb222..4d28c32e82f6 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.3.0-beta.2","info":{"plain":"- Addon Vitest: Fix indentation of 'vitePluginNext' in generated Vitest config file - [#29011](https://github.com/storybookjs/storybook/pull/29011), thanks @ghengeveld!\n- Backgrounds/Viewports: Make defaults overridable in `StoryGlobals`-mode - [#29025](https://github.com/storybookjs/storybook/pull/29025), thanks @JReinhold!\n- CLI: Handle Yarn PnP wrapper scenario when adding an addon - [#29027](https://github.com/storybookjs/storybook/pull/29027), thanks @yannbf!\n- Maintenance: Rename addon-vitest to addon-test - [#29014](https://github.com/storybookjs/storybook/pull/29014), thanks @yannbf!\n- Nextjs-Vite: Re-export vite-plugin-storybook-nextjs - [#29012](https://github.com/storybookjs/storybook/pull/29012), thanks @valentinpalkovic!\n- SvelteKit/Vue3: Refactor plugin export paths - [#29016](https://github.com/storybookjs/storybook/pull/29016), thanks @yannbf!"}} +{"version":"8.3.0-beta.4","info":{"plain":"- Test: Rename vitest plugin entrypoint - [#29067](https://github.com/storybookjs/storybook/pull/29067), thanks @yannbf!\n- UI: Fix sidebar not wrapping - [#29055](https://github.com/storybookjs/storybook/pull/29055), thanks @JReinhold!"}} diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 971bcb7e27c3..07c518a9986e 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -437,7 +437,7 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio join(sandboxDir, 'vitest.workspace.ts'), dedent` import { defineWorkspace, defaultExclude } from "vitest/config"; - import { storybookTest } from "@storybook/experimental-addon-test/vite-plugin"; + import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin"; ${frameworkPluginImport} export default defineWorkspace([