From 393e9350e207ea0a63c79128cc78e7387b0344fa Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 29 Feb 2024 10:43:05 +0800 Subject: [PATCH 001/169] React: Fix RSC compatibility with addon-themes --- code/renderers/react/src/entry-preview-rsc.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/code/renderers/react/src/entry-preview-rsc.tsx b/code/renderers/react/src/entry-preview-rsc.tsx index 96b04ab996ba..f19ba3366e85 100644 --- a/code/renderers/react/src/entry-preview-rsc.tsx +++ b/code/renderers/react/src/entry-preview-rsc.tsx @@ -1,13 +1,9 @@ import * as React from 'react'; import semver from 'semver'; import type { Addon_DecoratorFunction } from '@storybook/types'; -import type { StoryContext } from './types'; -export const ServerComponentDecorator = ( - Story: React.FC, - { parameters }: StoryContext -): React.ReactNode => { - if (!parameters?.react?.rsc) return ; +export const ServerComponentDecorator: Addon_DecoratorFunction = (story, { parameters }) => { + if (!parameters?.react?.rsc) return story(); const major = semver.major(React.version); const minor = semver.minor(React.version); @@ -15,14 +11,10 @@ export const ServerComponentDecorator = ( throw new Error('React Server Components require React >= 18.3'); } - return ( - - - - ); + return {story() as React.ReactNode}; }; -export const decorators: Addon_DecoratorFunction[] = [ServerComponentDecorator]; +export const decorators = [ServerComponentDecorator]; export const parameters = { react: { From 5461f739e21869d595f4210619d60e65e1c5b108 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 27 Sep 2024 15:45:25 +0200 Subject: [PATCH 002/169] support statsJson in angular schemas --- .../src/builders/build-storybook/schema.json | 35 +++++++++++++++---- .../src/builders/start-storybook/schema.json | 35 +++++++++++++++---- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index dbc2a734417e..afd42aa4de07 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -67,16 +67,30 @@ "compodocArgs": { "type": "array", "description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.", - "default": ["-e", "json"], + "default": [ + "-e", + "json" + ], "items": { "type": "string" } }, "webpackStatsJson": { - "type": ["boolean", "string"], + "type": [ + "boolean", + "string" + ], "description": "Write Webpack Stats JSON to disk", "default": false }, + "statsJson": { + "type": [ + "boolean", + "string" + ], + "description": "Write stats JSON to disk", + "default": false + }, "previewUrl": { "type": "string", "description": "Disables the default storybook preview and lets you use your own" @@ -113,7 +127,10 @@ } }, "sourceMap": { - "type": ["boolean", "object"], + "type": [ + "boolean", + "object" + ], "description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration", "default": false } @@ -151,7 +168,11 @@ } }, "additionalProperties": false, - "required": ["glob", "input", "output"] + "required": [ + "glob", + "input", + "output" + ] }, { "type": "string" @@ -179,7 +200,9 @@ } }, "additionalProperties": false, - "required": ["input"] + "required": [ + "input" + ] }, { "type": "string", @@ -188,4 +211,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index a2eef03e4b08..a96182ea1b1e 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -94,7 +94,10 @@ "compodocArgs": { "type": "array", "description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.", - "default": ["-e", "json"], + "default": [ + "-e", + "json" + ], "items": { "type": "string" } @@ -135,10 +138,21 @@ "description": "URL path to be appended when visiting Storybook for the first time" }, "webpackStatsJson": { - "type": ["boolean", "string"], + "type": [ + "boolean", + "string" + ], "description": "Write Webpack Stats JSON to disk", "default": false }, + "statsJson": { + "type": [ + "boolean", + "string" + ], + "description": "Write stats JSON to disk", + "default": false + }, "previewUrl": { "type": "string", "description": "Disables the default storybook preview and lets you use your own" @@ -149,7 +163,10 @@ "pattern": "(silly|verbose|info|warn|silent)" }, "sourceMap": { - "type": ["boolean", "object"], + "type": [ + "boolean", + "object" + ], "description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration", "default": false } @@ -187,7 +204,11 @@ } }, "additionalProperties": false, - "required": ["glob", "input", "output"] + "required": [ + "glob", + "input", + "output" + ] }, { "type": "string" @@ -215,7 +236,9 @@ } }, "additionalProperties": false, - "required": ["input"] + "required": [ + "input" + ] }, { "type": "string", @@ -224,4 +247,4 @@ ] } } -} +} \ No newline at end of file From fd7f82f1f620ba07de603f2135420cfcf451a2ba Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 5 Nov 2024 11:13:02 +0100 Subject: [PATCH 003/169] Addon Docs: Dynamically import rehype --- code/addons/docs/src/plugins/mdx-plugin.ts | 5 +++-- code/addons/docs/src/preset.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/addons/docs/src/plugins/mdx-plugin.ts b/code/addons/docs/src/plugins/mdx-plugin.ts index 40d8e88c3f3a..36fe3b691e97 100644 --- a/code/addons/docs/src/plugins/mdx-plugin.ts +++ b/code/addons/docs/src/plugins/mdx-plugin.ts @@ -3,8 +3,6 @@ import { dirname, join } from 'node:path'; import type { Options } from 'storybook/internal/types'; import { createFilter } from '@rollup/pluginutils'; -import rehypeExternalLinks from 'rehype-external-links'; -import rehypeSlug from 'rehype-slug'; import type { Plugin } from 'vite'; import type { CompileOptions } from '../compiler'; @@ -24,6 +22,9 @@ export async function mdxPlugin(options: Options): Promise { const presetOptions = await presets.apply>('options', {}); const mdxPluginOptions = presetOptions?.mdxPluginOptions as CompileOptions; + const rehypeSlug = (await import('rehype-slug')).default; + const rehypeExternalLinks = (await import('rehype-external-links')).default; + return { name: 'storybook:mdx-plugin', enforce: 'pre', diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index e418b5e2e8aa..9cff707e8472 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -5,9 +5,6 @@ import type { DocsOptions, Options, PresetProperty } from 'storybook/internal/ty import type { CsfPluginOptions } from '@storybook/csf-plugin'; -import rehypeExternalLinks from 'rehype-external-links'; -import rehypeSlug from 'rehype-slug'; - import type { CompileOptions } from './compiler'; /** @@ -42,6 +39,9 @@ async function webpack( const { csfPluginOptions = {}, mdxPluginOptions = {} } = options; + const rehypeSlug = (await import('rehype-slug')).default; + const rehypeExternalLinks = (await import('rehype-external-links')).default; + const mdxLoaderOptions: CompileOptions = await options.presets.apply('mdxLoaderOptions', { ...mdxPluginOptions, mdxCompileOptions: { @@ -175,6 +175,9 @@ export const viteFinal = async (config: any, options: Options) => { const { plugins = [] } = config; const { mdxPlugin } = await import('./plugins/mdx-plugin'); + const rehypeSlug = (await import('rehype-slug')).default; + const rehypeExternalLinks = (await import('rehype-external-links')).default; + // Use the resolvedReact preset to alias react and react-dom to either the users version or the version shipped with addon-docs const { react, reactDom, mdx } = await getResolvedReact(options); From 2a02e134805f9659481f90237478a39516322c44 Mon Sep 17 00:00:00 2001 From: Kevin Yank Date: Tue, 19 Nov 2024 18:14:41 +1100 Subject: [PATCH 004/169] Fix webpack fsCache not working with @storybook/nextjs Next.js overrides certain internal webpack packages (particularly `webpack-sources`), which are involved with filesystem caching, with its own versions from next/dist/compiled. For filesystem caching to work, Next.js must be allowed to perform these overrides before webpack is first initialized by @storybook/builder-webpack5. If it is not, the objects to be serialized to disk in the caching process will be instantiated using the original (non-Next.js) modules, but the serializers will be created using the Next.js modules. This mismatch between the objects to be cached and the serializers that write the filesystem cache prevents the cache from being written; instead, webpack outputs a warning message to the console for every object that it tries and fails to find a matching serializer for. This fix works by invoking Next.js to configure webpack in the `core` hook of @storybook/nextjs/preset, immediately before loading @storybook/builder-webpack5. We don't actually use this configuration that Next.js creates; the actual configuration that will be used in the build is still generated in `webpackFinal` as before. `fsCache` has a large impact on Storybook build performance. Even in a minimal project with a single story, enabling it reduces build time by 66%! This is therefore a very valuable option to be able to enable. Fixes #29621 --- code/frameworks/nextjs/src/preset.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index 3463910175e1..84255fc62e20 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -36,6 +36,19 @@ export const addons: PresetProperty<'addons'> = [ export const core: PresetProperty<'core'> = async (config, options) => { const framework = await options.presets.apply('framework'); + // Load the Next.js configuration before we need it in webpackFinal (below). + // This gives Next.js an opportunity to override some of webpack's internals + // (see next/dist/server/config-utils.js) before @storybook/builder-webpack5 + // starts to use it. Without this, webpack's file system cache (fsCache: true) + // does not work. + const { nextConfigPath } = await options.presets.apply('frameworkOptions'); + await configureConfig({ + // Pass in a dummy webpack config object for now, since we don't want to + // modify the real one yet. We pass in the real one in webpackFinal. + baseConfig: {}, + nextConfigPath, + }); + return { ...config, builder: { From 0a3e05bceafe0ad4aae8a2d3e19984c2d337b420 Mon Sep 17 00:00:00 2001 From: Kevin Yank Date: Wed, 27 Nov 2024 11:33:40 +1100 Subject: [PATCH 005/169] Fix crash when framework is not specified with options --- code/frameworks/nextjs/src/preset.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index 84255fc62e20..f10550acc900 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -34,19 +34,18 @@ export const addons: PresetProperty<'addons'> = [ ]; export const core: PresetProperty<'core'> = async (config, options) => { - const framework = await options.presets.apply('framework'); + const framework = await options.presets.apply('framework'); // Load the Next.js configuration before we need it in webpackFinal (below). // This gives Next.js an opportunity to override some of webpack's internals // (see next/dist/server/config-utils.js) before @storybook/builder-webpack5 // starts to use it. Without this, webpack's file system cache (fsCache: true) // does not work. - const { nextConfigPath } = await options.presets.apply('frameworkOptions'); await configureConfig({ // Pass in a dummy webpack config object for now, since we don't want to // modify the real one yet. We pass in the real one in webpackFinal. baseConfig: {}, - nextConfigPath, + nextConfigPath: typeof framework === 'string' ? undefined : framework.options.nextConfigPath, }); return { From 83a1f24f02c50a0b5ed4a03c6b248100183a3b01 Mon Sep 17 00:00:00 2001 From: Kevin Yank Date: Tue, 3 Dec 2024 12:27:09 +1100 Subject: [PATCH 006/169] Defer all imports from webpack until after Next.js has loaded its internal instance --- code/frameworks/nextjs/src/config/webpack.ts | 14 +++++--- code/frameworks/nextjs/src/preset.ts | 35 +++++++++++--------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/code/frameworks/nextjs/src/config/webpack.ts b/code/frameworks/nextjs/src/config/webpack.ts index 76edac25c81c..030da6b2ab77 100644 --- a/code/frameworks/nextjs/src/config/webpack.ts +++ b/code/frameworks/nextjs/src/config/webpack.ts @@ -1,8 +1,7 @@ import type { NextConfig } from 'next'; import type { Configuration as WebpackConfig } from 'webpack'; -import { DefinePlugin } from 'webpack'; -import { addScopedAlias, resolveNextConfig, setAlias } from '../utils'; +import { addScopedAlias, resolveNextConfig } from '../utils'; const tryResolve = (path: string) => { try { @@ -48,12 +47,15 @@ export const configureConfig = async ({ addScopedAlias(baseConfig, 'react-dom/server', 'next/dist/compiled/react-dom/server'); } - setupRuntimeConfig(baseConfig, nextConfig); + await setupRuntimeConfig(baseConfig, nextConfig); return nextConfig; }; -const setupRuntimeConfig = (baseConfig: WebpackConfig, nextConfig: NextConfig): void => { +const setupRuntimeConfig = async ( + baseConfig: WebpackConfig, + nextConfig: NextConfig +): Promise => { const definePluginConfig: Record = { // this mimics what nextjs does client side // https://github.com/vercel/next.js/blob/57702cb2a9a9dba4b552e0007c16449cf36cfb44/packages/next/client/index.tsx#L101 @@ -67,5 +69,7 @@ const setupRuntimeConfig = (baseConfig: WebpackConfig, nextConfig: NextConfig): definePluginConfig['process.env.__NEXT_NEW_LINK_BEHAVIOR'] = newNextLinkBehavior; - baseConfig.plugins?.push(new DefinePlugin(definePluginConfig)); + // Load DefinePlugin with a dynamic import to ensure that Next.js can first + // replace webpack with its own internal instance, and we get that here. + baseConfig.plugins?.push(new (await import('webpack')).DefinePlugin(definePluginConfig)); }; diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index f10550acc900..473e24655848 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -10,24 +10,10 @@ import type { ConfigItem, PluginItem, TransformOptions } from '@babel/core'; import { loadPartialConfig } from '@babel/core'; import semver from 'semver'; -import { configureAliases } from './aliases/webpack'; -import { configureBabelLoader } from './babel/loader'; import nextBabelPreset from './babel/preset'; -import { configureCompatibilityAliases } from './compatibility/compatibility-map'; import { configureConfig } from './config/webpack'; -import { configureCss } from './css/webpack'; -import { configureNextExportMocks } from './export-mocks/webpack'; -import { configureFastRefresh } from './fastRefresh/webpack'; import TransformFontImports from './font/babel'; -import { configureNextFont } from './font/webpack/configureNextFont'; -import { configureImages } from './images/webpack'; -import { configureImports } from './imports/webpack'; -import { configureNodePolyfills } from './nodePolyfills/webpack'; -import { configureRSC } from './rsc/webpack'; -import { configureStyledJsx } from './styledJsx/webpack'; -import { configureSWCLoader } from './swc/loader'; import type { FrameworkOptions, StorybookConfig } from './types'; -import { configureRuntimeNextjsVersionResolution, getNextjsVersion } from './utils'; export const addons: PresetProperty<'addons'> = [ dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))), @@ -156,6 +142,22 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig, nextConfigPath, }); + // Use dynamic imports to ensure these modules that use webpack load after + // Next.js has been configured (above), and has replaced webpack with its precompiled + // version. + const { configureNextFont } = await import('./font/webpack/configureNextFont'); + const { configureRuntimeNextjsVersionResolution, getNextjsVersion } = await import('./utils'); + const { configureImports } = await import('./imports/webpack'); + const { configureCss } = await import('./css/webpack'); + const { configureImages } = await import('./images/webpack'); + const { configureStyledJsx } = await import('./styledJsx/webpack'); + const { configureNodePolyfills } = await import('./nodePolyfills/webpack'); + const { configureAliases } = await import('./aliases/webpack'); + const { configureFastRefresh } = await import('./fastRefresh/webpack'); + const { configureRSC } = await import('./rsc/webpack'); + const { configureSWCLoader } = await import('./swc/loader'); + const { configureBabelLoader } = await import('./babel/loader'); + const babelRCPath = join(getProjectRoot(), '.babelrc'); const babelConfigPath = join(getProjectRoot(), 'babel.config.js'); const hasBabelConfig = existsSync(babelRCPath) || existsSync(babelConfigPath); @@ -168,7 +170,10 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig, configureNextFont(baseConfig, useSWC); configureRuntimeNextjsVersionResolution(baseConfig); - configureImports({ baseConfig, configDir: options.configDir }); + configureImports({ + baseConfig, + configDir: options.configDir, + }); configureCss(baseConfig, nextConfig); configureImages(baseConfig, nextConfig); configureStyledJsx(baseConfig); From 82e0c629f25ca39d94e4437e2540b4dee0512534 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 3 Dec 2024 20:39:04 +0100 Subject: [PATCH 007/169] ugprade vitest dependencies to 2.1.6 --- code/addons/test/package.json | 6 +- code/lib/instrumenter/package.json | 2 +- code/lib/test/package.json | 4 +- code/package.json | 8 +- code/yarn.lock | 488 ++++++++------- scripts/package.json | 4 +- .../react/package.json | 5 +- .../react/yarn.lock | 589 ++++++++++-------- 8 files changed, 600 insertions(+), 506 deletions(-) diff --git a/code/addons/test/package.json b/code/addons/test/package.json index bcbf9acf0512..0e28c4846757 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -95,8 +95,8 @@ "@types/istanbul-lib-report": "^3.0.3", "@types/node": "^22.0.0", "@types/semver": "^7", - "@vitest/browser": "^2.1.3", - "@vitest/runner": "^2.1.3", + "@vitest/browser": "^2.1.6", + "@vitest/runner": "^2.1.6", "ansi-to-html": "^0.7.2", "boxen": "^8.0.1", "es-toolkit": "^1.22.0", @@ -113,7 +113,7 @@ "strip-ansi": "^7.1.0", "ts-dedent": "^2.2.0", "typescript": "^5.3.2", - "vitest": "^2.1.3" + "vitest": "^2.1.6" }, "peerDependencies": { "@vitest/browser": "^2.1.1", diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 9a2469f72610..5ceea9e3e8f7 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@storybook/global": "^5.0.0", - "@vitest/utils": "^2.1.1" + "@vitest/utils": "^2.1.6" }, "devDependencies": { "typescript": "^5.3.2" diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 045e54b02cff..8543c6965633 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -49,8 +49,8 @@ "@testing-library/dom": "10.4.0", "@testing-library/jest-dom": "6.5.0", "@testing-library/user-event": "14.5.2", - "@vitest/expect": "2.0.5", - "@vitest/spy": "2.0.5" + "@vitest/expect": "2.1.6", + "@vitest/spy": "2.1.6" }, "devDependencies": { "chai": "^5.1.1", diff --git a/code/package.json b/code/package.json index b7eb230b10d9..cd7193b61aa6 100644 --- a/code/package.json +++ b/code/package.json @@ -178,9 +178,9 @@ "@typescript-eslint/parser": "^6.18.1", "@vitejs/plugin-react": "^4.3.2", "@vitejs/plugin-vue": "^4.4.0", - "@vitest/browser": "^2.1.3", - "@vitest/coverage-istanbul": "^2.1.3", - "@vitest/coverage-v8": "^2.1.3", + "@vitest/browser": "^2.1.6", + "@vitest/coverage-istanbul": "^2.1.6", + "@vitest/coverage-v8": "^2.1.6", "create-storybook": "workspace:*", "cross-env": "^7.0.3", "danger": "^12.3.3", @@ -221,7 +221,7 @@ "util": "^0.12.4", "vite": "^4.0.0", "vite-plugin-inspect": "^0.8.5", - "vitest": "^2.1.3", + "vitest": "^2.1.6", "wait-on": "^7.0.1" }, "dependenciesMeta": { diff --git a/code/yarn.lock b/code/yarn.lock index 1bada105b2f1..63ac4045dd4c 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -927,7 +927,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.26.2 resolution: "@babel/parser@npm:7.26.2" dependencies: @@ -2477,7 +2477,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": +"@babel/types@npm:^7.25.4, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": version: 7.26.0 resolution: "@babel/types@npm:7.26.0" dependencies: @@ -2511,12 +2511,12 @@ __metadata: languageName: node linkType: hard -"@bundled-es-modules/cookie@npm:^2.0.0": - version: 2.0.0 - resolution: "@bundled-es-modules/cookie@npm:2.0.0" +"@bundled-es-modules/cookie@npm:^2.0.1": + version: 2.0.1 + resolution: "@bundled-es-modules/cookie@npm:2.0.1" dependencies: - cookie: "npm:^0.5.0" - checksum: 10c0/0655dd331b35d7b5b6dd2301c3bcfb7233018c0e3235a40ced1d53f00463ab92dc01f0091f153812867bc0ef0f8e0a157a30acb16e8d7ef149702bf8db9fe7a6 + cookie: "npm:^0.7.2" + checksum: 10c0/dfac5e36127e827c5557b8577f17a8aa94c057baff6d38555917927b99da0ecf0b1357e7fedadc8853ecdbd4a8a7fa1f5e64111b2a656612f4a36376f5bdbe8d languageName: node linkType: hard @@ -3961,50 +3961,48 @@ __metadata: languageName: node linkType: hard -"@inquirer/confirm@npm:^3.0.0": - version: 3.1.20 - resolution: "@inquirer/confirm@npm:3.1.20" +"@inquirer/confirm@npm:^5.0.0": + version: 5.0.2 + resolution: "@inquirer/confirm@npm:5.0.2" dependencies: - "@inquirer/core": "npm:^9.0.8" - "@inquirer/type": "npm:^1.5.1" - checksum: 10c0/5cf4c15c194932a6c97c7efa89266e585be70d209993eafdcf0b91a6f1219fe232c7485706b314af3befb0d579051218d9c7f82df6970d9d59b95879dd1abdfd + "@inquirer/core": "npm:^10.1.0" + "@inquirer/type": "npm:^3.0.1" + peerDependencies: + "@types/node": ">=18" + checksum: 10c0/c121cfb0557b42dd6570b54dce707a048d85f328481d5230d21fede195902012ede06887aa478875cc83afa064c2e30953eb2cab0744f832195867b418865115 languageName: node linkType: hard -"@inquirer/core@npm:^9.0.8": - version: 9.0.8 - resolution: "@inquirer/core@npm:9.0.8" +"@inquirer/core@npm:^10.1.0": + version: 10.1.0 + resolution: "@inquirer/core@npm:10.1.0" dependencies: - "@inquirer/figures": "npm:^1.0.5" - "@inquirer/type": "npm:^1.5.1" - "@types/mute-stream": "npm:^0.0.4" - "@types/node": "npm:^22.0.0" - "@types/wrap-ansi": "npm:^3.0.0" + "@inquirer/figures": "npm:^1.0.8" + "@inquirer/type": "npm:^3.0.1" ansi-escapes: "npm:^4.3.2" - cli-spinners: "npm:^2.9.2" cli-width: "npm:^4.1.0" - mute-stream: "npm:^1.0.0" + mute-stream: "npm:^2.0.0" signal-exit: "npm:^4.1.0" strip-ansi: "npm:^6.0.1" wrap-ansi: "npm:^6.2.0" yoctocolors-cjs: "npm:^2.1.2" - checksum: 10c0/b38f9c8af932f159501f9ca38c670bd19794400a6f1421f61e08ed42982b44f33ab992237ca81bcf2fb4aa756c683e50067676cd3ef70c691219502df73c0ecf + checksum: 10c0/ffd187edb210426c3e25ed564f7aa8844468c28dd2ba3c53dbe28d3359b519cdfae987b31bf927c1dd2e9f70a914fdefe319abe4c5f384e5e08410d11e0a7ce2 languageName: node linkType: hard -"@inquirer/figures@npm:^1.0.5": - version: 1.0.5 - resolution: "@inquirer/figures@npm:1.0.5" - checksum: 10c0/ec9ba23db42cb33fa18eb919abf2a18e750e739e64c1883ce4a98345cd5711c60cac12d1faf56a859f52d387deb221c8d3dfe60344ee07955a9a262f8b821fe3 +"@inquirer/figures@npm:^1.0.8": + version: 1.0.8 + resolution: "@inquirer/figures@npm:1.0.8" + checksum: 10c0/34d287ff1fd16476c58bbd5b169db315f8319b5ffb09f81a1bb9aabd4165114e7406b1f418d021fd9cd48923008446e3eec274bb818f378ea132a0450bbc91d4 languageName: node linkType: hard -"@inquirer/type@npm:^1.5.1": - version: 1.5.1 - resolution: "@inquirer/type@npm:1.5.1" - dependencies: - mute-stream: "npm:^1.0.0" - checksum: 10c0/a4fa548179210b55102c05bb7f475bb757385fb5ccbc7f8f20b8020d9f3acb75d544f26292b35ebb8b7b5ebac54ecb503d238058aea4a34f2b47b78c8c63020e +"@inquirer/type@npm:^3.0.1": + version: 3.0.1 + resolution: "@inquirer/type@npm:3.0.1" + peerDependencies: + "@types/node": ">=18" + checksum: 10c0/c8612362d382114a318dbb523de7b1f54dc6bc6d3016c6eaf299b6a32486b92b0dfb1b4cfc6fe9d99496d15fbb721873a1bd66819f796c8bb09853a3b808812d languageName: node linkType: hard @@ -4250,9 +4248,9 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.35.6": - version: 0.35.6 - resolution: "@mswjs/interceptors@npm:0.35.6" +"@mswjs/interceptors@npm:^0.37.0": + version: 0.37.3 + resolution: "@mswjs/interceptors@npm:0.37.3" dependencies: "@open-draft/deferred-promise": "npm:^2.2.0" "@open-draft/logger": "npm:^0.3.0" @@ -4260,7 +4258,7 @@ __metadata: is-node-process: "npm:^1.2.0" outvariant: "npm:^1.4.3" strict-event-emitter: "npm:^0.5.1" - checksum: 10c0/9472f640183675869368bf2ccf32354db0dfb320c754bcbfc683059f5380674598c59dde4fa58007f74817e31aa1dbd123787fcd0b1d37d53595aa718d06bfbe + checksum: 10c0/5a8d9ab7c491d14dff996f23bda0fa7b7059f68a1d4981b804b6114f1c0c0490bc35860df135ed36da1720984323878b1a9d13dbc80936bbfa67b3d3c3476f6c languageName: node linkType: hard @@ -6615,8 +6613,8 @@ __metadata: "@types/istanbul-lib-report": "npm:^3.0.3" "@types/node": "npm:^22.0.0" "@types/semver": "npm:^7" - "@vitest/browser": "npm:^2.1.3" - "@vitest/runner": "npm:^2.1.3" + "@vitest/browser": "npm:^2.1.6" + "@vitest/runner": "npm:^2.1.6" ansi-to-html: "npm:^0.7.2" boxen: "npm:^8.0.1" es-toolkit: "npm:^1.22.0" @@ -6635,7 +6633,7 @@ __metadata: strip-ansi: "npm:^7.1.0" ts-dedent: "npm:^2.2.0" typescript: "npm:^5.3.2" - vitest: "npm:^2.1.3" + vitest: "npm:^2.1.6" peerDependencies: "@vitest/browser": ^2.1.1 "@vitest/runner": ^2.1.1 @@ -6757,7 +6755,7 @@ __metadata: resolution: "@storybook/instrumenter@workspace:lib/instrumenter" dependencies: "@storybook/global": "npm:^5.0.0" - "@vitest/utils": "npm:^2.1.1" + "@vitest/utils": "npm:^2.1.6" typescript: "npm:^5.3.2" peerDependencies: storybook: "workspace:^" @@ -7308,9 +7306,9 @@ __metadata: "@typescript-eslint/parser": "npm:^6.18.1" "@vitejs/plugin-react": "npm:^4.3.2" "@vitejs/plugin-vue": "npm:^4.4.0" - "@vitest/browser": "npm:^2.1.3" - "@vitest/coverage-istanbul": "npm:^2.1.3" - "@vitest/coverage-v8": "npm:^2.1.3" + "@vitest/browser": "npm:^2.1.6" + "@vitest/coverage-istanbul": "npm:^2.1.6" + "@vitest/coverage-v8": "npm:^2.1.6" create-storybook: "workspace:*" cross-env: "npm:^7.0.3" danger: "npm:^12.3.3" @@ -7351,7 +7349,7 @@ __metadata: util: "npm:^0.12.4" vite: "npm:^4.0.0" vite-plugin-inspect: "npm:^0.8.5" - vitest: "npm:^2.1.3" + vitest: "npm:^2.1.6" wait-on: "npm:^7.0.1" dependenciesMeta: ejs: @@ -7536,8 +7534,8 @@ __metadata: "@testing-library/dom": "npm:10.4.0" "@testing-library/jest-dom": "npm:6.5.0" "@testing-library/user-event": "npm:14.5.2" - "@vitest/expect": "npm:2.0.5" - "@vitest/spy": "npm:2.0.5" + "@vitest/expect": "npm:2.1.6" + "@vitest/spy": "npm:2.1.6" chai: "npm:^5.1.1" tinyspy: "npm:^3.0.0" ts-dedent: "npm:^2.2.0" @@ -8506,15 +8504,6 @@ __metadata: languageName: node linkType: hard -"@types/mute-stream@npm:^0.0.4": - version: 0.0.4 - resolution: "@types/mute-stream@npm:0.0.4" - dependencies: - "@types/node": "npm:*" - checksum: 10c0/944730fd7b398c5078de3c3d4d0afeec8584283bc694da1803fdfca14149ea385e18b1b774326f1601baf53898ce6d121a952c51eb62d188ef6fcc41f725c0dc - languageName: node - linkType: hard - "@types/node@npm:^22.0.0": version: 22.1.0 resolution: "@types/node@npm:22.1.0" @@ -8878,13 +8867,6 @@ __metadata: languageName: node linkType: hard -"@types/wrap-ansi@npm:^3.0.0": - version: 3.0.0 - resolution: "@types/wrap-ansi@npm:3.0.0" - checksum: 10c0/8d8f53363f360f38135301a06b596c295433ad01debd082078c33c6ed98b05a5c8fe8853a88265432126096084f4a135ec1564e3daad631b83296905509f90b3 - languageName: node - linkType: hard - "@types/ws@npm:^8, @types/ws@npm:^8.5.5": version: 8.5.10 resolution: "@types/ws@npm:8.5.10" @@ -9178,22 +9160,22 @@ __metadata: languageName: node linkType: hard -"@vitest/browser@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/browser@npm:2.1.3" +"@vitest/browser@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/browser@npm:2.1.8" dependencies: "@testing-library/dom": "npm:^10.4.0" "@testing-library/user-event": "npm:^14.5.2" - "@vitest/mocker": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - magic-string: "npm:^0.30.11" - msw: "npm:^2.3.5" - sirv: "npm:^2.0.4" + "@vitest/mocker": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + magic-string: "npm:^0.30.12" + msw: "npm:^2.6.4" + sirv: "npm:^3.0.0" tinyrainbow: "npm:^1.2.0" ws: "npm:^8.18.0" peerDependencies: playwright: "*" - vitest: 2.1.3 + vitest: 2.1.8 webdriverio: "*" peerDependenciesMeta: playwright: @@ -9202,189 +9184,175 @@ __metadata: optional: true webdriverio: optional: true - checksum: 10c0/428a8d62ffcc2d637363fc7eb986d6beaeda7681b032d785f2bc475f8d105a14c674610e22a0a0c74e4ee10774b3709b11bc359e0458c6867c3d4acdc3f190a6 + checksum: 10c0/00e89e43064654d42dab85ccae5743e350ae91d441563fe3678c6569362cb7527756dddff154ef33120841cc553caef16a82a7df4ca4569563c52dedacc719e9 languageName: node linkType: hard -"@vitest/coverage-istanbul@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/coverage-istanbul@npm:2.1.3" +"@vitest/coverage-istanbul@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/coverage-istanbul@npm:2.1.8" dependencies: "@istanbuljs/schema": "npm:^0.1.3" - debug: "npm:^4.3.6" + debug: "npm:^4.3.7" istanbul-lib-coverage: "npm:^3.2.2" istanbul-lib-instrument: "npm:^6.0.3" istanbul-lib-report: "npm:^3.0.1" istanbul-lib-source-maps: "npm:^5.0.6" istanbul-reports: "npm:^3.1.7" - magicast: "npm:^0.3.4" + magicast: "npm:^0.3.5" test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" peerDependencies: - vitest: 2.1.3 - checksum: 10c0/6b21eb219f45dc0f3bfb35049280658687b6b2f4ba5e17dc2c7e2c221f5d37e60c6962c5cfd77bd5f2848bb56debd26f82e5684b293f5775a8a416a0173f1803 + vitest: 2.1.8 + checksum: 10c0/809eeccebaa7fd0e349d89a8d374e449c65a1d626f46b03b080aa507ac93dfb340c90dd491fe9a08dca896d6832e0f3dcffd6fd7ba3d05c1dc95c7a32aabc50c languageName: node linkType: hard -"@vitest/coverage-v8@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/coverage-v8@npm:2.1.3" +"@vitest/coverage-v8@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/coverage-v8@npm:2.1.8" dependencies: "@ampproject/remapping": "npm:^2.3.0" "@bcoe/v8-coverage": "npm:^0.2.3" - debug: "npm:^4.3.6" + debug: "npm:^4.3.7" istanbul-lib-coverage: "npm:^3.2.2" istanbul-lib-report: "npm:^3.0.1" istanbul-lib-source-maps: "npm:^5.0.6" istanbul-reports: "npm:^3.1.7" - magic-string: "npm:^0.30.11" - magicast: "npm:^0.3.4" - std-env: "npm:^3.7.0" + magic-string: "npm:^0.30.12" + magicast: "npm:^0.3.5" + std-env: "npm:^3.8.0" test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" peerDependencies: - "@vitest/browser": 2.1.3 - vitest: 2.1.3 + "@vitest/browser": 2.1.8 + vitest: 2.1.8 peerDependenciesMeta: "@vitest/browser": optional: true - checksum: 10c0/5fdff9e9dd8b8d2030c00a5273ba2b27441c0cb45d007b6671504745dac6d095c160a01433789e7ed1ca6cd234246f883c1d52c02cfb62f8ae81dda17dd56bc6 + checksum: 10c0/b228a23bbaf0eae07ac939399f968b0def2df786091948a12d614919db3f5b6e46db7a1ab4f9d05d5d7f696afd53133a67abc25915f85480cd032442664ac725 languageName: node linkType: hard -"@vitest/expect@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/expect@npm:2.0.5" - dependencies: - "@vitest/spy": "npm:2.0.5" - "@vitest/utils": "npm:2.0.5" - chai: "npm:^5.1.1" - tinyrainbow: "npm:^1.2.0" - checksum: 10c0/08cb1b0f106d16a5b60db733e3d436fa5eefc68571488eb570dfe4f599f214ab52e4342273b03dbe12331cc6c0cdc325ac6c94f651ad254cd62f3aa0e3d185aa - languageName: node - linkType: hard - -"@vitest/expect@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/expect@npm:2.1.3" +"@vitest/expect@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/expect@npm:2.1.6" dependencies: - "@vitest/spy": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - chai: "npm:^5.1.1" + "@vitest/spy": "npm:2.1.6" + "@vitest/utils": "npm:2.1.6" + chai: "npm:^5.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/0837adcbb938feebcc083664afc5c4d12e42f1f2442b6f1bedc6b5650a8ff2448b1f10713b45afb099c839fb5cf766c971736267fa9b0fe2ac87f3e2d7f782c2 + checksum: 10c0/86327692f03b2ec6895486b118f25e1a141749c31ba671d253da4e33cf81db81f40755198ac9b46616155a8b74765d0ab15b8080041dbe139c83a9a0690004a2 languageName: node linkType: hard -"@vitest/expect@patch:@vitest/expect@npm%3A2.0.5#~/.yarn/patches/@vitest-expect-npm-2.0.5-8933466cce.patch": - version: 2.0.5 - resolution: "@vitest/expect@patch:@vitest/expect@npm%3A2.0.5#~/.yarn/patches/@vitest-expect-npm-2.0.5-8933466cce.patch::version=2.0.5&hash=368591" +"@vitest/expect@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/expect@npm:2.1.8" dependencies: - "@vitest/spy": "npm:2.0.5" - "@vitest/utils": "npm:2.0.5" - chai: "npm:^5.1.1" + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/0834adbe2c7094277adf3a45aa20fece84ca3b381fb3fe118fa424d2d490f20d0365c57dcaf845b413e583e36118f2815afa34bd175e305d6169c947e29576c3 + checksum: 10c0/6fbf4abc2360efe4d3671d3425f8bb6012fe2dd932a88720d8b793030b766ba260494822c721d3fc497afe52373515c7e150635a95c25f6e1b567f86155c5408 languageName: node linkType: hard -"@vitest/mocker@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/mocker@npm:2.1.3" +"@vitest/mocker@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/mocker@npm:2.1.8" dependencies: - "@vitest/spy": "npm:2.1.3" + "@vitest/spy": "npm:2.1.8" estree-walker: "npm:^3.0.3" - magic-string: "npm:^0.30.11" + magic-string: "npm:^0.30.12" peerDependencies: - "@vitest/spy": 2.1.3 - msw: ^2.3.5 + msw: ^2.4.9 vite: ^5.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - checksum: 10c0/03c80628d092244f21a0ba9041665fc75f987d0d11fab1ae0b7027ec21e503f65057e8c24b936602c5f852d83fbb183da13d05dba117c99785b41b3dafd105ce + checksum: 10c0/b4113ed8a57c0f60101d02e1b1769357a346ecd55ded499eab384d52106fd4b12d51e9aaa6db98f47de0d56662477be0ed8d46d6dfa84c235f9e1b234709814e languageName: node linkType: hard -"@vitest/pretty-format@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/pretty-format@npm:2.0.5" +"@vitest/pretty-format@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/pretty-format@npm:2.1.6" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10c0/236c0798c5170a0b5ad5d4bd06118533738e820b4dd30079d8fbcb15baee949d41c60f42a9f769906c4a5ce366d7ef11279546070646c0efc03128c220c31f37 + checksum: 10c0/5c82496e5816c0c388bbe18a88ed01b39f5492aaa8e0df90868a65a50ee135105da367e58b4a0bed0dc67201c0518c451a32a5d9b81f56665b76b1c75c550686 languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.3, @vitest/pretty-format@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/pretty-format@npm:2.1.3" +"@vitest/pretty-format@npm:2.1.8, @vitest/pretty-format@npm:^2.1.8": + version: 2.1.8 + resolution: "@vitest/pretty-format@npm:2.1.8" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10c0/5a6ee872a8adf5e2764f2b5b2276d8a2199be4ef14777ab693428caf359481851400af10b59721d4972289c955ffe7277954a662b04cfb10233824574c7074ba + checksum: 10c0/1dc5c9b1c7c7e78e46a2a16033b6b20be05958bbebc5a5b78f29e32718c80252034804fccd23f34db6b3583239db47e68fc5a8e41942c54b8047cc3b4133a052 languageName: node linkType: hard -"@vitest/runner@npm:2.1.3, @vitest/runner@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/runner@npm:2.1.3" +"@vitest/runner@npm:2.1.8, @vitest/runner@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/runner@npm:2.1.8" dependencies: - "@vitest/utils": "npm:2.1.3" + "@vitest/utils": "npm:2.1.8" pathe: "npm:^1.1.2" - checksum: 10c0/d5b077643265d10025e22fa64a0e54c3d4fddc23e05f9fcd143dbcc4080851b0df31985986e57890a974577a18d3af624758b6062801d7dd96f9b4f2eaf591f1 + checksum: 10c0/d0826a71494adeafc8c6478257f584d11655145c83e2d8f94c17301d7059c7463ad768a69379e394c50838a7435abcc9255a6b7d8894f5ee06b153e314683a75 languageName: node linkType: hard -"@vitest/snapshot@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/snapshot@npm:2.1.3" +"@vitest/snapshot@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/snapshot@npm:2.1.8" dependencies: - "@vitest/pretty-format": "npm:2.1.3" - magic-string: "npm:^0.30.11" + "@vitest/pretty-format": "npm:2.1.8" + magic-string: "npm:^0.30.12" pathe: "npm:^1.1.2" - checksum: 10c0/a3dcea6a5f7581b6a34dc3bf5f7bd42a05e2ccf6e1171d9f1b759688aebe650e6412564d066aeaa45e83ac549d453b6a3edcf774a8ac728c0c639f8dc919039f + checksum: 10c0/8d7a77a52e128630ea737ee0a0fe746d1d325cac5848326861dbf042844da4d5c1a5145539ae0ed1a3f0b0363506e98d86f2679fadf114ec4b987f1eb616867b languageName: node linkType: hard -"@vitest/spy@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/spy@npm:2.0.5" +"@vitest/spy@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/spy@npm:2.1.6" dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10c0/70634c21921eb271b54d2986c21d7ab6896a31c0f4f1d266940c9bafb8ac36237846d6736638cbf18b958bd98e5261b158a6944352742accfde50b7818ff655e + tinyspy: "npm:^3.0.2" + checksum: 10c0/4d3e965f9096968125dd4f53a66a8afd7a105852a41bd36865288bef5b6a79f3ec6f2056cc1c7be5a0afb2cd86b3b83e354451f452bf049ddd4516005a748f6f languageName: node linkType: hard -"@vitest/spy@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/spy@npm:2.1.3" +"@vitest/spy@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/spy@npm:2.1.8" dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10c0/8d85a5c2848c5bd81892af989aebad65d0c7ae74094aa98ad4f35ecf80755259c7a748a8e7bf683b2906fac29a51fc0ffa82f8fc073b36dbd8a0418261fccdba + tinyspy: "npm:^3.0.2" + checksum: 10c0/9740f10772ede004ea7f9ffb8a6c3011341d75d9d7f2d4d181b123a701c4691e942f38cf1700684a3bb5eea3c78addf753fd8cdf78c51d8eadc3bada6fadf8f2 languageName: node linkType: hard -"@vitest/utils@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/utils@npm:2.0.5" +"@vitest/utils@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/utils@npm:2.1.6" dependencies: - "@vitest/pretty-format": "npm:2.0.5" - estree-walker: "npm:^3.0.3" - loupe: "npm:^3.1.1" + "@vitest/pretty-format": "npm:2.1.6" + loupe: "npm:^3.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/0d1de748298f07a50281e1ba058b05dcd58da3280c14e6f016265e950bd79adab6b97822de8f0ea82d3070f585654801a9b1bcf26db4372e51cf7746bf86d73b + checksum: 10c0/1ec077b9707ec627075348f1a98687c7bb2fcbf9edf6e73dea6842c328d0d51a33663d22679e2a90a75f45afca9246f8fa3ea452447f474ae9d5f4eca4023b91 languageName: node linkType: hard -"@vitest/utils@npm:2.1.3, @vitest/utils@npm:^2.1.1": - version: 2.1.3 - resolution: "@vitest/utils@npm:2.1.3" +"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/utils@npm:2.1.8" dependencies: - "@vitest/pretty-format": "npm:2.1.3" - loupe: "npm:^3.1.1" + "@vitest/pretty-format": "npm:2.1.8" + loupe: "npm:^3.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/55a044e43b84c0f8f573d8578107f26440678b6f506c8d9fee88b7ef120d19efd27c9be77985c107113b0f3f3db298dcee57074e1c1c214bee7a097fd08a209b + checksum: 10c0/d4a29ecd8f6c24c790e4c009f313a044d89e664e331bc9c3cfb57fe1380fb1d2999706dbbfc291f067d6c489602e76d00435309fbc906197c0d01f831ca17d64 languageName: node linkType: hard @@ -11984,6 +11952,19 @@ __metadata: languageName: node linkType: hard +"chai@npm:^5.1.2": + version: 5.1.2 + resolution: "chai@npm:5.1.2" + dependencies: + assertion-error: "npm:^2.0.1" + check-error: "npm:^2.1.1" + deep-eql: "npm:^5.0.1" + loupe: "npm:^3.1.0" + pathval: "npm:^2.0.0" + checksum: 10c0/6c04ff8495b6e535df9c1b062b6b094828454e9a3c9493393e55b2f4dbff7aa2a29a4645133cad160fb00a16196c4dc03dc9bb37e1f4ba9df3b5f50d7533a736 + languageName: node + linkType: hard + "chalk@npm:5.3.0, chalk@npm:^5.0.0, chalk@npm:^5.2.0, chalk@npm:^5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" @@ -12267,7 +12248,7 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.9.2": +"cli-spinners@npm:^2.5.0": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" checksum: 10c0/907a1c227ddf0d7a101e7ab8b300affc742ead4b4ebe920a5bf1bc6d45dce2958fcd195eb28fa25275062fe6fa9b109b93b63bc8033396ed3bcb50297008b3a3 @@ -12757,10 +12738,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 10c0/c01ca3ef8d7b8187bae434434582288681273b5a9ed27521d4d7f9f7928fe0c920df0decd9f9d3bbd2d14ac432b8c8cf42b98b3bdd5bfe0e6edddeebebe8b61d +"cookie@npm:^0.7.2": + version: 0.7.2 + resolution: "cookie@npm:0.7.2" + checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2 languageName: node linkType: hard @@ -13306,7 +13287,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^4.3.6, debug@npm:^4.3.7": +"debug@npm:^4.3.7": version: 4.3.7 resolution: "debug@npm:4.3.7" dependencies: @@ -14510,6 +14491,13 @@ __metadata: languageName: node linkType: hard +"es-module-lexer@npm:^1.5.4": + version: 1.5.4 + resolution: "es-module-lexer@npm:1.5.4" + checksum: 10c0/300a469488c2f22081df1e4c8398c78db92358496e639b0df7f89ac6455462aaf5d8893939087c1a1cbcbf20eed4610c70e0bcb8f3e4b0d80a5d2611c539408c + languageName: node + linkType: hard + "es-object-atoms@npm:^1.0.0": version: 1.0.0 resolution: "es-object-atoms@npm:1.0.0" @@ -15513,6 +15501,13 @@ __metadata: languageName: node linkType: hard +"expect-type@npm:^1.1.0": + version: 1.1.0 + resolution: "expect-type@npm:1.1.0" + checksum: 10c0/5af0febbe8fe18da05a6d51e3677adafd75213512285408156b368ca471252565d5ca6e59e4bddab25121f3cfcbbebc6a5489f8cc9db131cc29e69dcdcc7ae15 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -19844,7 +19839,7 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.0, loupe@npm:^3.1.1": +"loupe@npm:^3.1.0": version: 3.1.1 resolution: "loupe@npm:3.1.1" dependencies: @@ -19853,6 +19848,13 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^3.1.2": + version: 3.1.2 + resolution: "loupe@npm:3.1.2" + checksum: 10c0/b13c02e3ddd6a9d5f8bf84133b3242de556512d824dddeea71cce2dbd6579c8f4d672381c4e742d45cf4423d0701765b4a6e5fbc24701def16bc2b40f8daa96a + languageName: node + linkType: hard + "lower-case@npm:^2.0.2": version: 2.0.2 resolution: "lower-case@npm:2.0.2" @@ -19972,14 +19974,14 @@ __metadata: languageName: node linkType: hard -"magicast@npm:^0.3.4": - version: 0.3.4 - resolution: "magicast@npm:0.3.4" +"magicast@npm:^0.3.5": + version: 0.3.5 + resolution: "magicast@npm:0.3.5" dependencies: - "@babel/parser": "npm:^7.24.4" - "@babel/types": "npm:^7.24.0" + "@babel/parser": "npm:^7.25.4" + "@babel/types": "npm:^7.25.4" source-map-js: "npm:^1.2.0" - checksum: 10c0/7ebaaac397b13c31ca05e6d9649296751d76749b945d10a0800107872119fbdf267acdb604571d25e38ec6fd7ab3568a951b6e76eaef1caba9eaa11778fd9783 + checksum: 10c0/a6cacc0a848af84f03e3f5bda7b0de75e4d0aa9ddce5517fd23ed0f31b5ddd51b2d0ff0b7e09b51f7de0f4053c7a1107117edda6b0732dca3e9e39e6c5a68c64 languageName: node linkType: hard @@ -21610,15 +21612,16 @@ __metadata: languageName: node linkType: hard -"msw@npm:^2.3.5": - version: 2.4.8 - resolution: "msw@npm:2.4.8" +"msw@npm:^2.6.4": + version: 2.6.6 + resolution: "msw@npm:2.6.6" dependencies: - "@bundled-es-modules/cookie": "npm:^2.0.0" + "@bundled-es-modules/cookie": "npm:^2.0.1" "@bundled-es-modules/statuses": "npm:^1.0.1" "@bundled-es-modules/tough-cookie": "npm:^0.1.6" - "@inquirer/confirm": "npm:^3.0.0" - "@mswjs/interceptors": "npm:^0.35.6" + "@inquirer/confirm": "npm:^5.0.0" + "@mswjs/interceptors": "npm:^0.37.0" + "@open-draft/deferred-promise": "npm:^2.2.0" "@open-draft/until": "npm:^2.1.0" "@types/cookie": "npm:^0.6.0" "@types/statuses": "npm:^2.0.4" @@ -21626,10 +21629,10 @@ __metadata: graphql: "npm:^16.8.1" headers-polyfill: "npm:^4.0.2" is-node-process: "npm:^1.2.0" - outvariant: "npm:^1.4.2" + outvariant: "npm:^1.4.3" path-to-regexp: "npm:^6.3.0" strict-event-emitter: "npm:^0.5.1" - type-fest: "npm:^4.9.0" + type-fest: "npm:^4.26.1" yargs: "npm:^17.7.2" peerDependencies: typescript: ">= 4.8.x" @@ -21638,7 +21641,7 @@ __metadata: optional: true bin: msw: cli/index.js - checksum: 10c0/33a8c5697f7cb003a2af33ff6b259eaf7babf180fadf0697d107d0856ab0d2ff1a80d319e788d9127f289ff091334bee589f348180a1fdd0914bf8c4725830dc + checksum: 10c0/d7f0e0ea6512cfddda5b7695a0c6c6a0ed43b36b62f25925beee8e12daec12a5ef369d00e0976f9dd76d3af779741fda11a3eae812da11a044b03992e697010c languageName: node linkType: hard @@ -21668,13 +21671,20 @@ __metadata: languageName: node linkType: hard -"mute-stream@npm:1.0.0, mute-stream@npm:^1.0.0": +"mute-stream@npm:1.0.0": version: 1.0.0 resolution: "mute-stream@npm:1.0.0" checksum: 10c0/dce2a9ccda171ec979a3b4f869a102b1343dee35e920146776780de182f16eae459644d187e38d59a3d37adf85685e1c17c38cf7bfda7e39a9880f7a1d10a74c languageName: node linkType: hard +"mute-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "mute-stream@npm:2.0.0" + checksum: 10c0/2cf48a2087175c60c8dcdbc619908b49c07f7adcfc37d29236b0c5c612d6204f789104c98cc44d38acab7b3c96f4a3ec2cfdc4934d0738d876dbefa2a12c69f4 + languageName: node + linkType: hard + "nanoid@npm:^3.3.6, nanoid@npm:^3.3.7": version: 3.3.7 resolution: "nanoid@npm:3.3.7" @@ -22581,7 +22591,7 @@ __metadata: languageName: node linkType: hard -"outvariant@npm:^1.4.0, outvariant@npm:^1.4.2, outvariant@npm:^1.4.3": +"outvariant@npm:^1.4.0, outvariant@npm:^1.4.3": version: 1.4.3 resolution: "outvariant@npm:1.4.3" checksum: 10c0/5976ca7740349cb8c71bd3382e2a762b1aeca6f33dc984d9d896acdf3c61f78c3afcf1bfe9cc633a7b3c4b295ec94d292048f83ea2b2594fae4496656eba992c @@ -26422,6 +26432,17 @@ __metadata: languageName: node linkType: hard +"sirv@npm:^3.0.0": + version: 3.0.0 + resolution: "sirv@npm:3.0.0" + dependencies: + "@polka/url": "npm:^1.0.0-next.24" + mrmime: "npm:^2.0.0" + totalist: "npm:^3.0.0" + checksum: 10c0/282c52ee5a93cafa297096ad31aa6c3004a21d4c93abe728b701e51e4329acb887f6e92f07696225414fd6bb4a7782fd64a42d0b6b6467ae0f66bd3fde90b865 + languageName: node + linkType: hard + "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -26848,10 +26869,10 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.7.0": - version: 3.7.0 - resolution: "std-env@npm:3.7.0" - checksum: 10c0/60edf2d130a4feb7002974af3d5a5f3343558d1ccf8d9b9934d225c638606884db4a20d2fe6440a09605bca282af6b042ae8070a10490c0800d69e82e478f41e +"std-env@npm:^3.8.0": + version: 3.8.0 + resolution: "std-env@npm:3.8.0" + checksum: 10c0/f560a2902fd0fa3d648d7d0acecbd19d664006f7372c1fba197ed4c216b4c9e48db6e2769b5fe1616d42a9333c9f066c5011935035e85c59f45dc4f796272040 languageName: node linkType: hard @@ -27692,17 +27713,17 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^0.3.0": - version: 0.3.0 - resolution: "tinyexec@npm:0.3.0" - checksum: 10c0/138a4f4241aea6b6312559508468ab275a31955e66e2f57ed206e0aaabecee622624f208c5740345f0a66e33478fd065e359ed1eb1269eb6fd4fa25d44d0ba3b +"tinyexec@npm:^0.3.1": + version: 0.3.1 + resolution: "tinyexec@npm:0.3.1" + checksum: 10c0/11e7a7c5d8b3bddf8b5cbe82a9290d70a6fad84d528421d5d18297f165723cb53d2e737d8f58dcce5ca56f2e4aa2d060f02510b1f8971784f97eb3e9aec28f09 languageName: node linkType: hard -"tinypool@npm:^1.0.0": - version: 1.0.0 - resolution: "tinypool@npm:1.0.0" - checksum: 10c0/71b20b9c54366393831c286a0772380c20f8cad9546d724c484edb47aea3228f274c58e98cf51d28c40869b39f5273209ef3ea94a9d2a23f8b292f4731cd3e4e +"tinypool@npm:^1.0.1": + version: 1.0.2 + resolution: "tinypool@npm:1.0.2" + checksum: 10c0/31ac184c0ff1cf9a074741254fe9ea6de95026749eb2b8ec6fd2b9d8ca94abdccda731f8e102e7f32e72ed3b36d32c6975fd5f5523df3f1b6de6c3d8dfd95e63 languageName: node linkType: hard @@ -27727,6 +27748,13 @@ __metadata: languageName: node linkType: hard +"tinyspy@npm:^3.0.2": + version: 3.0.2 + resolution: "tinyspy@npm:3.0.2" + checksum: 10c0/55ffad24e346622b59292e097c2ee30a63919d5acb7ceca87fc0d1c223090089890587b426e20054733f97a58f20af2c349fb7cc193697203868ab7ba00bcea0 + languageName: node + linkType: hard + "tmp@npm:0.0.28": version: 0.0.28 resolution: "tmp@npm:0.0.28" @@ -29104,17 +29132,18 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:2.1.3": - version: 2.1.3 - resolution: "vite-node@npm:2.1.3" +"vite-node@npm:2.1.8": + version: 2.1.8 + resolution: "vite-node@npm:2.1.8" dependencies: cac: "npm:^6.7.14" - debug: "npm:^4.3.6" + debug: "npm:^4.3.7" + es-module-lexer: "npm:^1.5.4" pathe: "npm:^1.1.2" vite: "npm:^5.0.0" bin: vite-node: vite-node.mjs - checksum: 10c0/1b06139880a8170651e025e8c35aa92a917f8ec8f24507cda5bf4be09843f6447e1f494932a8d7eb98124f1c8c9fee02283ef318ddd57e2b861d2d85a409a206 + checksum: 10c0/cb28027a7425ba29780e216164c07d36a4ff9eb60d83afcad3bc222fd5a5f3e36030071c819edd6d910940f502d49e52f7564743617bc1c5875485b0952c72d5 languageName: node linkType: hard @@ -29254,34 +29283,35 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^2.1.3": - version: 2.1.3 - resolution: "vitest@npm:2.1.3" - dependencies: - "@vitest/expect": "npm:2.1.3" - "@vitest/mocker": "npm:2.1.3" - "@vitest/pretty-format": "npm:^2.1.3" - "@vitest/runner": "npm:2.1.3" - "@vitest/snapshot": "npm:2.1.3" - "@vitest/spy": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - chai: "npm:^5.1.1" - debug: "npm:^4.3.6" - magic-string: "npm:^0.30.11" +"vitest@npm:^2.1.6": + version: 2.1.8 + resolution: "vitest@npm:2.1.8" + dependencies: + "@vitest/expect": "npm:2.1.8" + "@vitest/mocker": "npm:2.1.8" + "@vitest/pretty-format": "npm:^2.1.8" + "@vitest/runner": "npm:2.1.8" + "@vitest/snapshot": "npm:2.1.8" + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" + debug: "npm:^4.3.7" + expect-type: "npm:^1.1.0" + magic-string: "npm:^0.30.12" pathe: "npm:^1.1.2" - std-env: "npm:^3.7.0" + std-env: "npm:^3.8.0" tinybench: "npm:^2.9.0" - tinyexec: "npm:^0.3.0" - tinypool: "npm:^1.0.0" + tinyexec: "npm:^0.3.1" + tinypool: "npm:^1.0.1" tinyrainbow: "npm:^1.2.0" vite: "npm:^5.0.0" - vite-node: "npm:2.1.3" + vite-node: "npm:2.1.8" why-is-node-running: "npm:^2.3.0" peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": 2.1.3 - "@vitest/ui": 2.1.3 + "@vitest/browser": 2.1.8 + "@vitest/ui": 2.1.8 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -29299,7 +29329,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 10c0/7688fdce37205e7f3b448039df216e103e3a52994af0201993e22decbb558d129a734001b991f3c3d80bf4a4ef91ca6a5665a7395d5b051249da60a0016eda36 + checksum: 10c0/e70631bad5662d6c60c5cf836a4baf58b890db6654fef1f608fe6a86aa49a2b9f078aac74b719d4d3c87c5c781968cc73590a7935277b48f3d8b6fb9c5b4d276 languageName: node linkType: hard diff --git a/scripts/package.json b/scripts/package.json index e8903525a4f3..8d86035027c7 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -94,7 +94,7 @@ "@typescript-eslint/eslint-plugin": "^7.16.0", "@typescript-eslint/experimental-utils": "^5.62.0", "@typescript-eslint/parser": "^7.16.0", - "@vitest/coverage-v8": "^2.1.3", + "@vitest/coverage-v8": "^2.1.6", "ansi-regex": "^6.0.1", "browser-assert": "^1.2.1", "chromatic": "^11.5.5", @@ -183,7 +183,7 @@ "typescript": "^5.4.5", "util": "^0.12.5", "uuid": "^9.0.1", - "vitest": "^2.1.3", + "vitest": "^2.1.6", "wait-on": "^7.2.0", "window-size": "^1.1.1", "yaml": "^2.4.5", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 5af90b56b2e3..4c20025a192b 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -108,7 +108,8 @@ "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-react": "^4.2.1", - "@vitest/browser": "^2.1.3", + "@vitest/browser": "^2.1.6", + "@vitest/coverage-v8": "^2.1.6", "cypress": "^13.6.4", "eslint": "^8.56.0", "eslint-plugin-react-hooks": "^4.6.0", @@ -120,6 +121,6 @@ "storybook": "^8.0.0", "typescript": "^5.2.2", "vite": "^5.1.1", - "vitest": "^2.1.3" + "vitest": "^2.1.6" } } diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 2041ffe4ec1a..ff334163229a 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -12,7 +12,7 @@ __metadata: languageName: node linkType: hard -"@ampproject/remapping@npm:^2.2.0": +"@ampproject/remapping@npm:^2.2.0, @ampproject/remapping@npm:^2.3.0": version: 2.3.0 resolution: "@ampproject/remapping@npm:2.3.0" dependencies: @@ -135,6 +135,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-string-parser@npm:7.25.9" + checksum: 10/c28656c52bd48e8c1d9f3e8e68ecafd09d949c57755b0d353739eb4eae7ba4f7e67e92e4036f1cd43378cc1397a2c943ed7bcaf5949b04ab48607def0258b775 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.25.7": version: 7.25.7 resolution: "@babel/helper-validator-identifier@npm:7.25.7" @@ -142,6 +149,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-validator-identifier@npm:7.25.9" + checksum: 10/3f9b649be0c2fd457fa1957b694b4e69532a668866b8a0d81eabfa34ba16dbf3107b39e0e7144c55c3c652bf773ec816af8df4a61273a2bb4eb3145ca9cf478e + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.25.7": version: 7.25.7 resolution: "@babel/helper-validator-option@npm:7.25.7" @@ -182,6 +196,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.4": + version: 7.26.2 + resolution: "@babel/parser@npm:7.26.2" + dependencies: + "@babel/types": "npm:^7.26.0" + bin: + parser: ./bin/babel-parser.js + checksum: 10/8baee43752a3678ad9f9e360ec845065eeee806f1fdc8e0f348a8a0e13eef0959dabed4a197c978896c493ea205c804d0a1187cc52e4a1ba017c7935bab4983d + languageName: node + linkType: hard + "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -437,6 +462,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.4, @babel/types@npm:^7.26.0": + version: 7.26.0 + resolution: "@babel/types@npm:7.26.0" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10/40780741ecec886ed9edae234b5eb4976968cc70d72b4e5a40d55f83ff2cc457de20f9b0f4fe9d858350e43dab0ea496e7ef62e2b2f08df699481a76df02cd6e + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -444,12 +479,12 @@ __metadata: languageName: node linkType: hard -"@bundled-es-modules/cookie@npm:^2.0.0": - version: 2.0.0 - resolution: "@bundled-es-modules/cookie@npm:2.0.0" +"@bundled-es-modules/cookie@npm:^2.0.1": + version: 2.0.1 + resolution: "@bundled-es-modules/cookie@npm:2.0.1" dependencies: - cookie: "npm:^0.5.0" - checksum: 10/c8ef02aa5d3f6c786cfa407e1c93b4af29c600eb09990973f47a7a49e4771c1bec37c8f8e567638bb9cbc41f4e38d065ff1d8eaf9bf91f0c3613a6d60bc82c8c + cookie: "npm:^0.7.2" + checksum: 10/0038a5e82c41bfcd722afedabeb6961a5f15747b3681d7f4b61e35eb1e33130039e10ee9250dc9c9e4d3915ce1aeee717c0fb92225111574f0a030411abc0987 languageName: node linkType: hard @@ -911,58 +946,48 @@ __metadata: languageName: node linkType: hard -"@inquirer/confirm@npm:^3.0.0": - version: 3.2.0 - resolution: "@inquirer/confirm@npm:3.2.0" +"@inquirer/confirm@npm:^5.0.0": + version: 5.0.2 + resolution: "@inquirer/confirm@npm:5.0.2" dependencies: - "@inquirer/core": "npm:^9.1.0" - "@inquirer/type": "npm:^1.5.3" - checksum: 10/6b032a26c64075dc14769558720b17f09bc6784a223bbf2c85ec42e491be6ce4c4b83518433c47e05d7e8836ba680ab1b2f6b9c553410d4326582308a1fd2259 + "@inquirer/core": "npm:^10.1.0" + "@inquirer/type": "npm:^3.0.1" + peerDependencies: + "@types/node": ">=18" + checksum: 10/4e775b80b689adeb0b2852ed79b368ef23a82fe3d5f580a562f4af7cdf002a19e0ec1b3b95acc6d49427a72c0fcb5b6548e0cdcafe2f0d3f3d6a923e04aabd0c languageName: node linkType: hard -"@inquirer/core@npm:^9.1.0": - version: 9.2.1 - resolution: "@inquirer/core@npm:9.2.1" +"@inquirer/core@npm:^10.1.0": + version: 10.1.0 + resolution: "@inquirer/core@npm:10.1.0" dependencies: - "@inquirer/figures": "npm:^1.0.6" - "@inquirer/type": "npm:^2.0.0" - "@types/mute-stream": "npm:^0.0.4" - "@types/node": "npm:^22.5.5" - "@types/wrap-ansi": "npm:^3.0.0" + "@inquirer/figures": "npm:^1.0.8" + "@inquirer/type": "npm:^3.0.1" ansi-escapes: "npm:^4.3.2" cli-width: "npm:^4.1.0" - mute-stream: "npm:^1.0.0" + mute-stream: "npm:^2.0.0" signal-exit: "npm:^4.1.0" strip-ansi: "npm:^6.0.1" wrap-ansi: "npm:^6.2.0" yoctocolors-cjs: "npm:^2.1.2" - checksum: 10/bf35e46e70add8ffa9e9d4ae6b528ac660484afca082bca31af95ce8a145a2f8c8d0d07cc7a8627771452e68ade9849c9c9c450a004133ed10ac2d6730900452 + checksum: 10/5d097d0484c1b758f788b792d29395199bdc84af3e8cd4d9273e31de2c5202839b6edf299056956044ba7fb097c4cee7b5c0288e094a380c045082b044f9946e languageName: node linkType: hard -"@inquirer/figures@npm:^1.0.6": - version: 1.0.7 - resolution: "@inquirer/figures@npm:1.0.7" - checksum: 10/ce896860de9d822a7c2a212667bcfd0f04cf2ce86d9a2411cc9c077bb59cd61732cb5f72ac66e88d52912466eec433f005bf8a25efa658f41e1a32f3977080bd - languageName: node - linkType: hard - -"@inquirer/type@npm:^1.5.3": - version: 1.5.5 - resolution: "@inquirer/type@npm:1.5.5" - dependencies: - mute-stream: "npm:^1.0.0" - checksum: 10/bd3f3d7510785af4ad599e042e99e4be6380f52f79f3db140fe6fed0a605acf27b1a0a20fb5cc688eaf7b8aa0c36dacb1d89c7bba4586f38cbf58ba9f159e7b5 +"@inquirer/figures@npm:^1.0.8": + version: 1.0.8 + resolution: "@inquirer/figures@npm:1.0.8" + checksum: 10/0e5e4fbb15e799e818c598fcc3558ef076daf78662149711b046723fd6316381e95f7d5573d6ef0062095ad22c6ac98833033f0948df5c722932107a567fd9c3 languageName: node linkType: hard -"@inquirer/type@npm:^2.0.0": - version: 2.0.0 - resolution: "@inquirer/type@npm:2.0.0" - dependencies: - mute-stream: "npm:^1.0.0" - checksum: 10/e85f359866c28cce06272d2d51cc17788a5c9de9fda7f181c27775dd26821de0dacbc947b521cfe2009cd2965ec54696799035ef3a25a9a5794e47d8e8bdf794 +"@inquirer/type@npm:^3.0.1": + version: 3.0.1 + resolution: "@inquirer/type@npm:3.0.1" + peerDependencies: + "@types/node": ">=18" + checksum: 10/af412f1e7541d43554b02199ae71a2039a1bff5dc51ceefd87de9ece55b199682733b28810fb4b6cb3ed4a159af4cc4a26d4bb29c58dd127e7d9dbda0797d8e7 languageName: node linkType: hard @@ -1239,21 +1264,19 @@ __metadata: languageName: node linkType: hard -"@joshwooding/vite-plugin-react-docgen-typescript@npm:0.3.0": - version: 0.3.0 - resolution: "@joshwooding/vite-plugin-react-docgen-typescript@npm:0.3.0" +"@joshwooding/vite-plugin-react-docgen-typescript@npm:0.4.2": + version: 0.4.2 + resolution: "@joshwooding/vite-plugin-react-docgen-typescript@npm:0.4.2" dependencies: - glob: "npm:^7.2.0" - glob-promise: "npm:^4.2.0" magic-string: "npm:^0.27.0" react-docgen-typescript: "npm:^2.2.2" peerDependencies: typescript: ">= 4.3.x" - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/9237499394b1f5f1320c9a489dbf5db2ba4b1d68081bf767a08895b70d0d0830adb9f0f1e2c5c94202e5bee63fe031ea2b91870a6bc806ed5e370be6b06df2e8 + checksum: 10/0878171c598ee85997a2b9ea452715ea3df4c0faa3c646ffc0be62a772c3f4919986a9045864fe7cf2208b3f577bbe1e029f8ea3f3bf83f509be8d7a064f0396 languageName: node linkType: hard @@ -1289,7 +1312,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1311,9 +1334,9 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.35.8": - version: 0.35.9 - resolution: "@mswjs/interceptors@npm:0.35.9" +"@mswjs/interceptors@npm:^0.37.0": + version: 0.37.3 + resolution: "@mswjs/interceptors@npm:0.37.3" dependencies: "@open-draft/deferred-promise": "npm:^2.2.0" "@open-draft/logger": "npm:^0.3.0" @@ -1321,7 +1344,7 @@ __metadata: is-node-process: "npm:^1.2.0" outvariant: "npm:^1.4.3" strict-event-emitter: "npm:^0.5.1" - checksum: 10/9eaf8d7876c9a38c2c9a1259873f8ad27ab41c68a49f7e14a55cd9f596458d9232adb85a5084b044d4eead3be1e7ef5bf54ed6d774d16b02d96caf1e7faa2ab3 + checksum: 10/3d3e2e073feead8702c18dc97e5201785865292b32bd882c4d80461adc3380483b33517c55d7c6c1e53723f5e2ecf50cca0412e6ecd2eb771f4eaabfa2138932 languageName: node linkType: hard @@ -1764,16 +1787,16 @@ __metadata: ts-dedent: "npm:^2.0.0" peerDependencies: storybook: "workspace:^" - vite: ^4.0.0 || ^5.0.0 + vite: ^4.0.0 || ^5.0.0 || ^6.0.0 languageName: node linkType: soft "@storybook/components@file:../../../code/deprecated/components::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.4 - resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=60237a&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.15 + resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=0be72f&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/0366ac53c8eed65b69aaa174337d27ec2283c446b328811f92ffc9de0a219860afd2e3bdc5f11c30485c43c21d246ff036bca74429ba307dc557917d14a9beba + checksum: 10/744a23254c29518601e7f3ff9e549693c6c17b5bf75fccb532826213860fb78c8b3d9dc1be0e4f6dbaa4f42b439521017f79f0d0d43ddaacddf9938174048ff6 languageName: node linkType: hard @@ -1829,8 +1852,8 @@ __metadata: linkType: hard "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.4 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=6bed1d&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.15 + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=637429&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1853,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/9d842f824d9891bd19e508d654ce7f9f7cf8c73090588b84f29b2649e68338d13d7cd85a6d4bd92fe6beef276eb12783445bed4a4249563a5986f6f537ccc6d8 + checksum: 10/31d4f67b7bf72037481a896d86e551280692bc3f21edff1e27558657096171f128966e8eda20b19edc109c24098d107956a889e217c9d394c231d173ba3400a0 languageName: node linkType: hard @@ -1879,27 +1902,27 @@ __metadata: resolution: "@storybook/instrumenter@portal:../../../code/lib/instrumenter::locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/global": "npm:^5.0.0" - "@vitest/utils": "npm:^2.1.1" + "@vitest/utils": "npm:^2.1.6" peerDependencies: storybook: "workspace:^" languageName: node linkType: soft "@storybook/manager-api@file:../../../code/deprecated/manager-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.4 - resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=8c9581&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.15 + resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=524260&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/20f439e660e49c2bba2ce4fc73ddb9306c04cea9e6eaa0ddc23fc2047e135b7df4cc0b742dc662cee71013051b0d7e9e9e7a4f28323c1734fc6ad024ac47b9db + checksum: 10/fcef37968ca864618fda44849c4442f89ffa1349239a0107b00c830d289e44bc48602c0f5b1ea90a092939cf3bb51030649ac042f6a8210dfa18ed87efcf4b80 languageName: node linkType: hard "@storybook/preview-api@file:../../../code/deprecated/preview-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.4 - resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=a7858a&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.15 + resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=a4220e&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/29559a5fd2698758e0bcf5442421fb583da5d95344f9740dcdc3615b3bec3dfb105f134fba08423a1fd1a68fbfa2615c91408271c4ef8926d43c0b5c6f8d0bb8 + checksum: 10/7e69d44343f24a1291b9604450d85e11149dccf61755ded28268d9791e887f6a60b3ec05b76df4d9dd9be6b2b30a6d6bb7db1feea27448e0ab904162e5fbb630 languageName: node linkType: hard @@ -1917,7 +1940,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/react-vite@portal:../../../code/frameworks/react-vite::locator=portable-stories-react%40workspace%3A." dependencies: - "@joshwooding/vite-plugin-react-docgen-typescript": "npm:0.3.0" + "@joshwooding/vite-plugin-react-docgen-typescript": "npm:0.4.2" "@rollup/pluginutils": "npm:^5.0.2" "@storybook/builder-vite": "workspace:*" "@storybook/react": "workspace:*" @@ -1930,7 +1953,7 @@ __metadata: 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 storybook: "workspace:^" - vite: ^4.0.0 || ^5.0.0 + vite: ^4.0.0 || ^5.0.0 || ^6.0.0 languageName: node linkType: soft @@ -1968,19 +1991,19 @@ __metadata: "@testing-library/dom": "npm:10.4.0" "@testing-library/jest-dom": "npm:6.5.0" "@testing-library/user-event": "npm:14.5.2" - "@vitest/expect": "npm:2.0.5" - "@vitest/spy": "npm:2.0.5" + "@vitest/expect": "npm:2.1.6" + "@vitest/spy": "npm:2.1.6" peerDependencies: storybook: "workspace:^" languageName: node linkType: soft "@storybook/theming@file:../../../code/deprecated/theming::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.4 - resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=74a1c8&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.15 + resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=6dcd01&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/387dd03f4a10a4a1f6381a9e150a3c4a96a5ce3f6aec4557a954fa3c629630e667a5e60003fed6a5ed31a7844dcd3507bcf996614e1ddb0cda8ad74b6922f3b4 + checksum: 10/070e791f22ca7bb55dffdd43e52d80aa1ae367a64375718d7634b73798536f4f1210820f1547991e7c00f821e2763edb8b30e64f22af5eaf10b4af21b3ad230e languageName: node linkType: hard @@ -2275,16 +2298,6 @@ __metadata: languageName: node linkType: hard -"@types/glob@npm:^7.1.3": - version: 7.2.0 - resolution: "@types/glob@npm:7.2.0" - dependencies: - "@types/minimatch": "npm:*" - "@types/node": "npm:*" - checksum: 10/6ae717fedfdfdad25f3d5a568323926c64f52ef35897bcac8aca8e19bc50c0bd84630bbd063e5d52078b2137d8e7d3c26eabebd1a2f03ff350fff8a91e79fc19 - languageName: node - linkType: hard - "@types/graceful-fs@npm:^4.1.3": version: 4.1.9 resolution: "@types/graceful-fs@npm:4.1.9" @@ -2351,23 +2364,7 @@ __metadata: languageName: node linkType: hard -"@types/minimatch@npm:*": - version: 5.1.2 - resolution: "@types/minimatch@npm:5.1.2" - checksum: 10/94db5060d20df2b80d77b74dd384df3115f01889b5b6c40fa2dfa27cfc03a68fb0ff7c1f2a0366070263eb2e9d6bfd8c87111d4bc3ae93c3f291297c1bf56c85 - languageName: node - linkType: hard - -"@types/mute-stream@npm:^0.0.4": - version: 0.0.4 - resolution: "@types/mute-stream@npm:0.0.4" - dependencies: - "@types/node": "npm:*" - checksum: 10/af8d83ad7b68ea05d9357985daf81b6c9b73af4feacb2f5c2693c7fd3e13e5135ef1bd083ce8d5bdc8e97acd28563b61bb32dec4e4508a8067fcd31b8a098632 - languageName: node - linkType: hard - -"@types/node@npm:*, @types/node@npm:^22.5.5": +"@types/node@npm:*": version: 22.7.7 resolution: "@types/node@npm:22.7.7" dependencies: @@ -2458,13 +2455,6 @@ __metadata: languageName: node linkType: hard -"@types/wrap-ansi@npm:^3.0.0": - version: 3.0.0 - resolution: "@types/wrap-ansi@npm:3.0.0" - checksum: 10/8aa644946ca4e859668c36b8e2bcf2ac4bdee59dac760414730ea57be8a93ae9166ebd40a088f2ab714843aaea2a2a67f0e6e6ec11cfc9c8701b2466ca1c4089 - languageName: node - linkType: hard - "@types/yargs-parser@npm:*": version: 21.0.3 resolution: "@types/yargs-parser@npm:21.0.3" @@ -2698,22 +2688,22 @@ __metadata: languageName: node linkType: hard -"@vitest/browser@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/browser@npm:2.1.3" +"@vitest/browser@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/browser@npm:2.1.8" dependencies: "@testing-library/dom": "npm:^10.4.0" "@testing-library/user-event": "npm:^14.5.2" - "@vitest/mocker": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - magic-string: "npm:^0.30.11" - msw: "npm:^2.3.5" - sirv: "npm:^2.0.4" + "@vitest/mocker": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + magic-string: "npm:^0.30.12" + msw: "npm:^2.6.4" + sirv: "npm:^3.0.0" tinyrainbow: "npm:^1.2.0" ws: "npm:^8.18.0" peerDependencies: playwright: "*" - vitest: 2.1.3 + vitest: 2.1.8 webdriverio: "*" peerDependenciesMeta: playwright: @@ -2722,131 +2712,155 @@ __metadata: optional: true webdriverio: optional: true - checksum: 10/e639496fa529140fb9e7dce97890c5b75fffbfb41881bee5ef25b194832d3cadcb77490d9b54777bfa968b993f6878649fe4961d6ef312ca1222b9a2fc8d4f12 + checksum: 10/6063e02222440347bbc23b2c54e259078aa83a29869337b9ffd642be5a4321ac3ddf3c0bbe4eac5237eb0bb8b9fa17d21d2c31299376de407716e3c7dd3b704c languageName: node linkType: hard -"@vitest/expect@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/expect@npm:2.0.5" +"@vitest/coverage-v8@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/coverage-v8@npm:2.1.8" dependencies: - "@vitest/spy": "npm:2.0.5" - "@vitest/utils": "npm:2.0.5" - chai: "npm:^5.1.1" + "@ampproject/remapping": "npm:^2.3.0" + "@bcoe/v8-coverage": "npm:^0.2.3" + debug: "npm:^4.3.7" + istanbul-lib-coverage: "npm:^3.2.2" + istanbul-lib-report: "npm:^3.0.1" + istanbul-lib-source-maps: "npm:^5.0.6" + istanbul-reports: "npm:^3.1.7" + magic-string: "npm:^0.30.12" + magicast: "npm:^0.3.5" + std-env: "npm:^3.8.0" + test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" - checksum: 10/ca9a218f50254b2259fd16166b2d8c9ccc8ee2cc068905e6b3d6281da10967b1590cc7d34b5fa9d429297f97e740450233745583b4cc12272ff11705faf70a37 + peerDependencies: + "@vitest/browser": 2.1.8 + vitest: 2.1.8 + peerDependenciesMeta: + "@vitest/browser": + optional: true + checksum: 10/2e1e7fe2a20c1eec738f6d84d890bed4aa5138094943dd1229962c2c42428a1a517c8a4ad4fb52637d7494f044440e061e9bc5982a83df95223db185d5a28f4d languageName: node linkType: hard -"@vitest/expect@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/expect@npm:2.1.3" +"@vitest/expect@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/expect@npm:2.1.6" dependencies: - "@vitest/spy": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - chai: "npm:^5.1.1" + "@vitest/spy": "npm:2.1.6" + "@vitest/utils": "npm:2.1.6" + chai: "npm:^5.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10/94e61e01f14cfcd9ced0e7ac1bbdeee55ff4bf68f09d8f244fd7d73f97b106f35d10cba3fe7a0132464c312206f2eee9e83b16a8d761101b61da053890062858 + checksum: 10/78d5c3e9781ec4d4954d4d532612fd3f78321214a86ca50413c2507d5ac36b20ceef3a8a401bfd1aae10d13bb0ef8a0f53f1ce3f212908c2458c4fb855d98612 languageName: node linkType: hard -"@vitest/mocker@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/mocker@npm:2.1.3" +"@vitest/expect@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/expect@npm:2.1.8" + dependencies: + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" + tinyrainbow: "npm:^1.2.0" + checksum: 10/3594149dd67dfac884a90f8b6a35687cdddd2f5f764562819bf7b66ae2eacfd4aa5e8914155deb4082fbe5a3792dced2fd7e59a948ffafe67acba4d2229dfe5f + languageName: node + linkType: hard + +"@vitest/mocker@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/mocker@npm:2.1.8" dependencies: - "@vitest/spy": "npm:2.1.3" + "@vitest/spy": "npm:2.1.8" estree-walker: "npm:^3.0.3" - magic-string: "npm:^0.30.11" + magic-string: "npm:^0.30.12" peerDependencies: - "@vitest/spy": 2.1.3 - msw: ^2.3.5 + msw: ^2.4.9 vite: ^5.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - checksum: 10/84be8830d6e965109730257d7a84b3d7594db0998ae55decdbfc304857c1c7d29b49f1f5b23f2addcbce1bd7e8bb33832407737a9bb3f95cb3bf7bb312db4d9d + checksum: 10/f04060f42102caa4cca72059e63c1ecae8b8e091aaa61a2d4a914b129fc711ada4ad117eb0184e49e363757784ed1117fdbf9f4a81a45fe575fd92769740a970 languageName: node linkType: hard -"@vitest/pretty-format@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/pretty-format@npm:2.0.5" +"@vitest/pretty-format@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/pretty-format@npm:2.1.6" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10/70bf452dd0b8525e658795125b3f11110bd6baadfaa38c5bb91ca763bded35ec6dc80e27964ad4e91b91be6544d35e18ea7748c1997693988f975a7283c3e9a0 + checksum: 10/be0dea81e14b2e32f9843d96d5c72915acbabe7f06155d396b97f2fc4bef8f88866221ae215820f69674aec58a18ddd43d85aedf6db7d6aa3024ff2813ae1c08 languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.3, @vitest/pretty-format@npm:^2.1.3": - version: 2.1.3 - resolution: "@vitest/pretty-format@npm:2.1.3" +"@vitest/pretty-format@npm:2.1.8, @vitest/pretty-format@npm:^2.1.8": + version: 2.1.8 + resolution: "@vitest/pretty-format@npm:2.1.8" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10/d9382ee93f0f32e2ef8fe03bda818e5277f052a50ddb05b6a6cf0864b2ccb228484f12f130c05faf62dc2140292ffafc213f2941b0fa24058b3ee2943daa286c + checksum: 10/f0f60c007424194887ad398d202867d58d850154de327993925041e2972357544eea95a22e0bb3a62a470b006ff8de5f691d2078708dcd7f625e24f8a06b26e7 languageName: node linkType: hard -"@vitest/runner@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/runner@npm:2.1.3" +"@vitest/runner@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/runner@npm:2.1.8" dependencies: - "@vitest/utils": "npm:2.1.3" + "@vitest/utils": "npm:2.1.8" pathe: "npm:^1.1.2" - checksum: 10/cdf9b82d388c1cc148753f4a8632dfcadf9c4a1c0e065fdcd485d5af824af62507fd7eab9efb21244009775c05773ccb59547043af522a5ab6d216433321066e + checksum: 10/27f265a3ab1e20297b948b06232bfa4dc9fda44d1f9bb6206baa9e6fa643b71143ebfd2d1771570296b7ee74a12d684e529a830f545ad61235cefb454e94a8e9 languageName: node linkType: hard -"@vitest/snapshot@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/snapshot@npm:2.1.3" +"@vitest/snapshot@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/snapshot@npm:2.1.8" dependencies: - "@vitest/pretty-format": "npm:2.1.3" - magic-string: "npm:^0.30.11" + "@vitest/pretty-format": "npm:2.1.8" + magic-string: "npm:^0.30.12" pathe: "npm:^1.1.2" - checksum: 10/2c0c4ad8abb758f2f76d1d6094f8928360437e09d0a59e0c6a85a544c892cc41a5324ebbc5657a66c8a3793e51cbf58e357c7f71e899f4e5c5eb76e8c9745abf + checksum: 10/71edf4f574d317579c605ed0a7ecab7ee96fddcebc777bd130774a770ddc692c538f9f5b3dfde89af83ecb36f7338fe880943c83cede58f55e3556768a1a0749 languageName: node linkType: hard -"@vitest/spy@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/spy@npm:2.0.5" +"@vitest/spy@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/spy@npm:2.1.6" dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10/ed19f4c3bb4d3853241e8070979615138e24403ce4c137fa48c903b3af2c8b3ada2cc26aca9c1aa323bb314a457a8130a29acbb18dafd4e42737deefb2abf1ca + tinyspy: "npm:^3.0.2" + checksum: 10/4a926126bfb6ea6f0a2496b2aaa395dd8246de9dcadb5f143aa43bcff310e6eef567f5f05a350ff906b4dcf298790c25ccd961d5a851f47d0c8244f1141dd2b2 languageName: node linkType: hard -"@vitest/spy@npm:2.1.3": - version: 2.1.3 - resolution: "@vitest/spy@npm:2.1.3" +"@vitest/spy@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/spy@npm:2.1.8" dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10/94d6f1bc34da5d0c973d9382c133b938e555fcf2d238edf0aaad3de1a98dd57ebf7c104ba229c6beec48122d2e6f55386d8d2cf96a5804dc95ac683a54754cc7 + tinyspy: "npm:^3.0.2" + checksum: 10/9a1cb9cf6b23c122681469b5890d91ca26fc8d74953b3d46d293a5d2a4944490106891f6a178cd732ab7a8abbda339f43681c81d1594565ecc3bf3e7f9b7735f languageName: node linkType: hard -"@vitest/utils@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/utils@npm:2.0.5" +"@vitest/utils@npm:2.1.6": + version: 2.1.6 + resolution: "@vitest/utils@npm:2.1.6" dependencies: - "@vitest/pretty-format": "npm:2.0.5" - estree-walker: "npm:^3.0.3" - loupe: "npm:^3.1.1" + "@vitest/pretty-format": "npm:2.1.6" + loupe: "npm:^3.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10/d631d56d29c33bc8de631166b2b6691c470187a345469dfef7048befe6027e1c6ff9552f2ee11c8a247522c325c4a64bfcc73f8f0f0c525da39cb9f190f119f8 + checksum: 10/7da93c871f2c0d5242caf65236b40f041e8820cfadddf9b68721e54eda5230c3dd8ed26a43600498930d922ee324dd3a65939e71b6db0906fe81bcf41c4bf040 languageName: node linkType: hard -"@vitest/utils@npm:2.1.3, @vitest/utils@npm:^2.1.1": - version: 2.1.3 - resolution: "@vitest/utils@npm:2.1.3" +"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.6": + version: 2.1.8 + resolution: "@vitest/utils@npm:2.1.8" dependencies: - "@vitest/pretty-format": "npm:2.1.3" - loupe: "npm:^3.1.1" + "@vitest/pretty-format": "npm:2.1.8" + loupe: "npm:^3.1.2" tinyrainbow: "npm:^1.2.0" - checksum: 10/f064e6634cb84c925a17d8937df7441d150c3e24fa5bbd6304151d11dab6cdeb0cb3d5a95a9aacb8b416c87fb0d9aa8c6b9cc5e174191784231e8345948d6d18 + checksum: 10/be1f4254347199fb5c1d9de8e4537dad4af3f434c033e7cd023165bd4b7e9de16fa0f86664256ab331120585df95ed6be8eea58b209b510651b49f6482051733 languageName: node linkType: hard @@ -3450,16 +3464,16 @@ __metadata: languageName: node linkType: hard -"chai@npm:^5.1.1": - version: 5.1.1 - resolution: "chai@npm:5.1.1" +"chai@npm:^5.1.2": + version: 5.1.2 + resolution: "chai@npm:5.1.2" dependencies: assertion-error: "npm:^2.0.1" check-error: "npm:^2.1.1" deep-eql: "npm:^5.0.1" loupe: "npm:^3.1.0" pathval: "npm:^2.0.0" - checksum: 10/ee67279a5613bd36dc1dc13660042429ae2f1dc5a9030a6abcf381345866dfb5bce7bc10b9d74c8de86b6f656489f654bbbef3f3361e06925591e6a00c72afff + checksum: 10/e8c2bbc83cb5a2f87130d93056d4cfbbe04106e12aa798b504816dbe3fa538a9f68541b472e56cbf0f54558b501d7e31867d74b8218abcd5a8cc8ba536fba46c languageName: node linkType: hard @@ -3683,10 +3697,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 10/aae7911ddc5f444a9025fbd979ad1b5d60191011339bce48e555cb83343d0f98b865ff5c4d71fecdfb8555a5cafdc65632f6fce172f32aaf6936830a883a0380 +"cookie@npm:^0.7.2": + version: 0.7.2 + resolution: "cookie@npm:0.7.2" + checksum: 10/24b286c556420d4ba4e9bc09120c9d3db7d28ace2bd0f8ccee82422ce42322f73c8312441271e5eefafbead725980e5996cc02766dbb89a90ac7f5636ede608f languageName: node linkType: hard @@ -3841,7 +3855,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.6": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.7": version: 4.3.7 resolution: "debug@npm:4.3.7" dependencies: @@ -4162,6 +4176,13 @@ __metadata: languageName: node linkType: hard +"es-module-lexer@npm:^1.5.4": + version: 1.5.4 + resolution: "es-module-lexer@npm:1.5.4" + checksum: 10/f29c7c97a58eb17640dcbd71bd6ef754ad4f58f95c3073894573d29dae2cad43ecd2060d97ed5b866dfb7804d5590fb7de1d2c5339a5fceae8bd60b580387fc5 + languageName: node + linkType: hard + "esbuild-register@npm:^3.5.0": version: 3.6.0 resolution: "esbuild-register@npm:3.6.0" @@ -4622,6 +4643,13 @@ __metadata: languageName: node linkType: hard +"expect-type@npm:^1.1.0": + version: 1.1.0 + resolution: "expect-type@npm:1.1.0" + checksum: 10/05fca80ddc7d493a89361f783c6b000750fa04a8226bc24701f3b90adb0efc2fb467f2a0baaed4015a02d8b9034ef5bb87521df9dba980f50b1105bd596ef833 + languageName: node + linkType: hard + "expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -5018,18 +5046,7 @@ __metadata: languageName: node linkType: hard -"glob-promise@npm:^4.2.0": - version: 4.2.2 - resolution: "glob-promise@npm:4.2.2" - dependencies: - "@types/glob": "npm:^7.1.3" - peerDependencies: - glob: ^7.1.6 - checksum: 10/c1a3d95f7c8393e4151d4899ec4e42bb2e8237160f840ad1eccbe9247407da8b6c13e28f463022e011708bc40862db87b9b77236d35afa3feb8aa86d518f2dfe - languageName: node - linkType: hard - -"glob@npm:^10.2.2, glob@npm:^10.3.10": +"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.4.1": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -5045,7 +5062,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.2.0": +"glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -5725,7 +5742,7 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": +"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0, istanbul-lib-coverage@npm:^3.2.2": version: 3.2.2 resolution: "istanbul-lib-coverage@npm:3.2.2" checksum: 10/40bbdd1e937dfd8c830fa286d0f665e81b7a78bdabcd4565f6d5667c99828bda3db7fb7ac6b96a3e2e8a2461ddbc5452d9f8bc7d00cb00075fa6a3e99f5b6a81 @@ -5758,7 +5775,7 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-report@npm:^3.0.0": +"istanbul-lib-report@npm:^3.0.0, istanbul-lib-report@npm:^3.0.1": version: 3.0.1 resolution: "istanbul-lib-report@npm:3.0.1" dependencies: @@ -5780,7 +5797,18 @@ __metadata: languageName: node linkType: hard -"istanbul-reports@npm:^3.1.3": +"istanbul-lib-source-maps@npm:^5.0.6": + version: 5.0.6 + resolution: "istanbul-lib-source-maps@npm:5.0.6" + dependencies: + "@jridgewell/trace-mapping": "npm:^0.3.23" + debug: "npm:^4.1.1" + istanbul-lib-coverage: "npm:^3.0.0" + checksum: 10/569dd0a392ee3464b1fe1accbaef5cc26de3479eacb5b91d8c67ebb7b425d39fd02247d85649c3a0e9c29b600809fa60b5af5a281a75a89c01f385b1e24823a2 + languageName: node + linkType: hard + +"istanbul-reports@npm:^3.1.3, istanbul-reports@npm:^3.1.7": version: 3.1.7 resolution: "istanbul-reports@npm:3.1.7" dependencies: @@ -6585,7 +6613,7 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.0, loupe@npm:^3.1.1": +"loupe@npm:^3.1.0, loupe@npm:^3.1.2": version: 3.1.2 resolution: "loupe@npm:3.1.2" checksum: 10/8f5734e53fb64cd914aa7d986e01b6d4c2e3c6c56dcbd5428d71c2703f0ab46b5ab9f9eeaaf2b485e8a1c43f865bdd16ec08ae1a661c8f55acdbd9f4d59c607a @@ -6626,7 +6654,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.0, magic-string@npm:^0.30.11": +"magic-string@npm:^0.30.0": version: 0.30.12 resolution: "magic-string@npm:0.30.12" dependencies: @@ -6635,6 +6663,26 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.30.12": + version: 0.30.14 + resolution: "magic-string@npm:0.30.14" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + checksum: 10/8ca0f8937c2824e48ebc70e7e065a193c467713639cc6e5972aaba0fa5417b375a6f62c383410a19a66e618c386bb7253fbd3ccbfb0144bb310f0ba772121f12 + languageName: node + linkType: hard + +"magicast@npm:^0.3.5": + version: 0.3.5 + resolution: "magicast@npm:0.3.5" + dependencies: + "@babel/parser": "npm:^7.25.4" + "@babel/types": "npm:^7.25.4" + source-map-js: "npm:^1.2.0" + checksum: 10/3a2dba6b0bdde957797361d09c7931ebdc1b30231705360eeb40ed458d28e1c3112841c3ed4e1b87ceb28f741e333c7673cd961193aa9fdb4f4946b202e6205a + languageName: node + linkType: hard + "make-dir@npm:^4.0.0": version: 4.0.0 resolution: "make-dir@npm:4.0.0" @@ -6884,15 +6932,16 @@ __metadata: languageName: node linkType: hard -"msw@npm:^2.3.5": - version: 2.4.11 - resolution: "msw@npm:2.4.11" +"msw@npm:^2.6.4": + version: 2.6.6 + resolution: "msw@npm:2.6.6" dependencies: - "@bundled-es-modules/cookie": "npm:^2.0.0" + "@bundled-es-modules/cookie": "npm:^2.0.1" "@bundled-es-modules/statuses": "npm:^1.0.1" "@bundled-es-modules/tough-cookie": "npm:^0.1.6" - "@inquirer/confirm": "npm:^3.0.0" - "@mswjs/interceptors": "npm:^0.35.8" + "@inquirer/confirm": "npm:^5.0.0" + "@mswjs/interceptors": "npm:^0.37.0" + "@open-draft/deferred-promise": "npm:^2.2.0" "@open-draft/until": "npm:^2.1.0" "@types/cookie": "npm:^0.6.0" "@types/statuses": "npm:^2.0.4" @@ -6912,14 +6961,14 @@ __metadata: optional: true bin: msw: cli/index.js - checksum: 10/d073ede4bfc7f1f41f7a0cb05b3d20d9befc1658e53faacd3f217a7cb78e3e748a3ee8e937e2a4d93fd09f16b35cba00d71df767736dd567ac15fd8e01aa7d6e + checksum: 10/7762ba5f1570789328af27167e03c2b8eb4981faa476ae47d74c125c90ddc1792bc28b9ce1100bbc4e105b55e3e7d65e7cae8d27fa7677b6516e42a63c38b7a3 languageName: node linkType: hard -"mute-stream@npm:^1.0.0": - version: 1.0.0 - resolution: "mute-stream@npm:1.0.0" - checksum: 10/36fc968b0e9c9c63029d4f9dc63911950a3bdf55c9a87f58d3a266289b67180201cade911e7699f8b2fa596b34c9db43dad37649e3f7fdd13c3bb9edb0017ee7 +"mute-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "mute-stream@npm:2.0.0" + checksum: 10/d2e4fd2f5aa342b89b98134a8d899d8ef9b0a6d69274c4af9df46faa2d97aeb1f2ce83d867880d6de63643c52386579b99139801e24e7526c3b9b0a6d1e18d6c languageName: node linkType: hard @@ -7370,7 +7419,8 @@ __metadata: "@typescript-eslint/eslint-plugin": "npm:^6.21.0" "@typescript-eslint/parser": "npm:^6.21.0" "@vitejs/plugin-react": "npm:^4.2.1" - "@vitest/browser": "npm:^2.1.3" + "@vitest/browser": "npm:^2.1.6" + "@vitest/coverage-v8": "npm:^2.1.6" cypress: "npm:^13.6.4" eslint: "npm:^8.56.0" eslint-plugin-react-hooks: "npm:^4.6.0" @@ -7384,7 +7434,7 @@ __metadata: storybook: "npm:^8.0.0" typescript: "npm:^5.2.2" vite: "npm:^5.1.1" - vitest: "npm:^2.1.3" + vitest: "npm:^2.1.6" languageName: unknown linkType: soft @@ -7982,14 +8032,14 @@ __metadata: languageName: node linkType: hard -"sirv@npm:^2.0.4": - version: 2.0.4 - resolution: "sirv@npm:2.0.4" +"sirv@npm:^3.0.0": + version: 3.0.0 + resolution: "sirv@npm:3.0.0" dependencies: "@polka/url": "npm:^1.0.0-next.24" mrmime: "npm:^2.0.0" totalist: "npm:^3.0.0" - checksum: 10/24f42cf06895017e589c9d16fc3f1c6c07fe8b0dbafce8a8b46322cfba67b7f2498610183954cb0e9d089c8cb60002a7ee7e8bca6a91a0d7042bfbc3473c95c3 + checksum: 10/94dbd5df7cf4965f7c5941767117cbf9709e1d25de1d619a114c3f77fc63c124b5a5255717af2a0de637bb83d0b0defd0822d01420764b56432b53281b1d675d languageName: node linkType: hard @@ -8057,7 +8107,7 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.2.1": +"source-map-js@npm:^1.2.0, source-map-js@npm:^1.2.1": version: 1.2.1 resolution: "source-map-js@npm:1.2.1" checksum: 10/ff9d8c8bf096d534a5b7707e0382ef827b4dd360a577d3f34d2b9f48e12c9d230b5747974ee7c607f0df65113732711bb701fe9ece3c7edbd43cb2294d707df3 @@ -8148,10 +8198,10 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.7.0": - version: 3.7.0 - resolution: "std-env@npm:3.7.0" - checksum: 10/6ee0cca1add3fd84656b0002cfbc5bfa20340389d9ba4720569840f1caa34bce74322aef4c93f046391583e50649d0cf81a5f8fe1d411e50b659571690a45f12 +"std-env@npm:^3.8.0": + version: 3.8.0 + resolution: "std-env@npm:3.8.0" + checksum: 10/034176196cfcaaab16dbdd96fc9e925a9544799fb6dc5a3e36fe43270f3a287c7f779d785b89edaf22cef2b5f1dcada2aae67430b8602e785ee74bdb3f671768 languageName: node linkType: hard @@ -8350,6 +8400,17 @@ __metadata: languageName: node linkType: hard +"test-exclude@npm:^7.0.1": + version: 7.0.1 + resolution: "test-exclude@npm:7.0.1" + dependencies: + "@istanbuljs/schema": "npm:^0.1.2" + glob: "npm:^10.4.1" + minimatch: "npm:^9.0.4" + checksum: 10/e6f6f4e1df2e7810e082e8d7dfc53be51a931e6e87925f5e1c2ef92cc1165246ba3bf2dae6b5d86251c16925683dba906bd41e40169ebc77120a2d1b5a0dbbe0 + languageName: node + linkType: hard + "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -8385,17 +8446,17 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^0.3.0": +"tinyexec@npm:^0.3.1": version: 0.3.1 resolution: "tinyexec@npm:0.3.1" checksum: 10/0537c70590d52d354f40c0255ff0f654a3d18ddb3812b440ddf9d436edf516c8057838ad5a38744c0c59670ec03e3cf23fbe04ae3d49f031d948274e99002569 languageName: node linkType: hard -"tinypool@npm:^1.0.0": - version: 1.0.1 - resolution: "tinypool@npm:1.0.1" - checksum: 10/eaceb93784b8e27e60c0e3e2c7d11c29e1e79b2a025b2c232215db73b90fe22bd4753ad53fc8e801c2b5a63b94a823af549555d8361272bc98271de7dd4a9925 +"tinypool@npm:^1.0.1": + version: 1.0.2 + resolution: "tinypool@npm:1.0.2" + checksum: 10/6109322f14b3763f65c8fa49fddab72cd3edd96b82dd50e05e63de74867329ff5353bff4377281ec963213d9314f37f4a353e9ee34bbac85fd4c1e4a568d6076 languageName: node linkType: hard @@ -8406,7 +8467,7 @@ __metadata: languageName: node linkType: hard -"tinyspy@npm:^3.0.0": +"tinyspy@npm:^3.0.2": version: 3.0.2 resolution: "tinyspy@npm:3.0.2" checksum: 10/5db671b2ff5cd309de650c8c4761ca945459d7204afb1776db9a04fb4efa28a75f08517a8620c01ee32a577748802231ad92f7d5b194dc003ee7f987a2a06337 @@ -8750,17 +8811,18 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:2.1.3": - version: 2.1.3 - resolution: "vite-node@npm:2.1.3" +"vite-node@npm:2.1.8": + version: 2.1.8 + resolution: "vite-node@npm:2.1.8" dependencies: cac: "npm:^6.7.14" - debug: "npm:^4.3.6" + debug: "npm:^4.3.7" + es-module-lexer: "npm:^1.5.4" pathe: "npm:^1.1.2" vite: "npm:^5.0.0" bin: vite-node: vite-node.mjs - checksum: 10/8ba6b145cbb02a492c7bb1f0490d02383000462f234ed61d24f650547163825c16f14e6908ee1eb661403bd0a7a3fb3cdbedf116cc015b1e5cdf7bb992872a01 + checksum: 10/0ff0ed7a6fb234d3ddc4946e4c1150229980cac9f34fb4bd7f443aab0aae2da5b73ac20ff68af1df476545807dc23189247194e8cea0dcdfa394311c73f04429 languageName: node linkType: hard @@ -8807,34 +8869,35 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^2.1.3": - version: 2.1.3 - resolution: "vitest@npm:2.1.3" - dependencies: - "@vitest/expect": "npm:2.1.3" - "@vitest/mocker": "npm:2.1.3" - "@vitest/pretty-format": "npm:^2.1.3" - "@vitest/runner": "npm:2.1.3" - "@vitest/snapshot": "npm:2.1.3" - "@vitest/spy": "npm:2.1.3" - "@vitest/utils": "npm:2.1.3" - chai: "npm:^5.1.1" - debug: "npm:^4.3.6" - magic-string: "npm:^0.30.11" +"vitest@npm:^2.1.6": + version: 2.1.8 + resolution: "vitest@npm:2.1.8" + dependencies: + "@vitest/expect": "npm:2.1.8" + "@vitest/mocker": "npm:2.1.8" + "@vitest/pretty-format": "npm:^2.1.8" + "@vitest/runner": "npm:2.1.8" + "@vitest/snapshot": "npm:2.1.8" + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" + debug: "npm:^4.3.7" + expect-type: "npm:^1.1.0" + magic-string: "npm:^0.30.12" pathe: "npm:^1.1.2" - std-env: "npm:^3.7.0" + std-env: "npm:^3.8.0" tinybench: "npm:^2.9.0" - tinyexec: "npm:^0.3.0" - tinypool: "npm:^1.0.0" + tinyexec: "npm:^0.3.1" + tinypool: "npm:^1.0.1" tinyrainbow: "npm:^1.2.0" vite: "npm:^5.0.0" - vite-node: "npm:2.1.3" + vite-node: "npm:2.1.8" why-is-node-running: "npm:^2.3.0" peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": 2.1.3 - "@vitest/ui": 2.1.3 + "@vitest/browser": 2.1.8 + "@vitest/ui": 2.1.8 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -8852,7 +8915,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 10/f6079a88583045b551e6526c08774aeac4a9cf85b132793a03f9470c013326abd7fce3985e3c2217dc0dac2fadeee3506e3dc51e215f10862b2fe9da9289af0f + checksum: 10/c2552c068f6faac82eb4e6debb9ed505c0e8016fd6e0a0f0e0dbb5b5417922fbcde80c54af0d3b5a5503a5d6ad6862b6e95b9b59b8b7e98bb553217b9c6fc227 languageName: node linkType: hard From 1373b3600162f56f3088297726ff0de1241e503d Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 3 Dec 2024 20:39:41 +0100 Subject: [PATCH 008/169] improve type-safety in coverage reporter --- code/addons/test/src/node/coverage-reporter.ts | 4 ++-- code/addons/test/src/node/vitest-manager.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/addons/test/src/node/coverage-reporter.ts b/code/addons/test/src/node/coverage-reporter.ts index 452643cd9d60..cc1dd548000f 100644 --- a/code/addons/test/src/node/coverage-reporter.ts +++ b/code/addons/test/src/node/coverage-reporter.ts @@ -8,7 +8,7 @@ import type { TestManager } from './test-manager'; export type StorybookCoverageReporterOptions = { testManager: TestManager; - coverageOptions: ResolvedCoverageOptions<'v8'>; + coverageOptions: ResolvedCoverageOptions<'v8'> | undefined; }; export default class StorybookCoverageReporter extends ReportBase implements Partial { @@ -32,7 +32,7 @@ export default class StorybookCoverageReporter extends ReportBase implements Par // Fallback to Vitest's default watermarks https://vitest.dev/config/#coverage-watermarks const [lowWatermark = 50, highWatermark = 80] = - this.#coverageOptions.watermarks?.statements ?? []; + this.#coverageOptions?.watermarks?.statements ?? []; const coverageDetails: Details['coverageSummary'] = { percentage, diff --git a/code/addons/test/src/node/vitest-manager.ts b/code/addons/test/src/node/vitest-manager.ts index 59aba03e7c71..f8be340cace3 100644 --- a/code/addons/test/src/node/vitest-manager.ts +++ b/code/addons/test/src/node/vitest-manager.ts @@ -45,7 +45,7 @@ export class VitestManager { '@storybook/experimental-addon-test/internal/coverage-reporter', { testManager: this.testManager, - coverageOptions: this.vitest?.config?.coverage as ResolvedCoverageOptions<'v8'>, + coverageOptions: this.vitest?.config?.coverage as ResolvedCoverageOptions<'v8'> | undefined, }, ]; const coverageOptions = ( From e111a2d8c6b8ff890a54bf56093ec6661c7f7cf4 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 3 Dec 2024 21:24:34 +0100 Subject: [PATCH 009/169] add coverage E2E test, a11y labels to coverage UI --- .../src/components/TestProviderRender.tsx | 7 ++- .../react/e2e-tests/component-testing.spec.ts | 52 +++++++++++++++++++ .../react/yarn.lock | 4 +- 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/code/addons/test/src/components/TestProviderRender.tsx b/code/addons/test/src/components/TestProviderRender.tsx index 16197a7c7ced..d5091a4d5c67 100644 --- a/code/addons/test/src/components/TestProviderRender.tsx +++ b/code/addons/test/src/components/TestProviderRender.tsx @@ -204,6 +204,7 @@ export const TestProviderRender: FC< href={'/coverage/index.html'} // @ts-expect-error ListItem doesn't include all anchor attributes in types, but it is an achor element target="_blank" + aria-label="Open coverage report" icon={ } - right={`${coverageSummary.percentage}%`} + right={ + + {coverageSummary.percentage} % + + } /> ) : ( { ); await expect(sidebarItems).toHaveCount(1); }); + + test("should collect coverage to testing module and HTML report", async ({ + page, + browserName, + }) => { + test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); + // Arrange - Prepare Storybook + await setForceFailureFlag(false); + + const sbPage = new SbPage(page, expect); + await sbPage.navigateToStory("addons/test", "Expected Failure"); + + const expandButton = await page.getByLabel('Expand testing module') + await expandButton.click(); + + const storyElement = sbPage + .getCanvasBodyElement() + .getByRole("button", { name: "test" }); + await expect(storyElement).toBeVisible({ timeout: 30000 }); + + // Assert - No coverage report initially + await expect(page.getByLabel("Open coverage report")).toHaveCount(0); + + // Act - Enable coverage and run tests + await page.getByLabel("Open settings for Component tests").click(); + await page.getByLabel("Coverage").click(); + await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); + await page.getByLabel("Close settings for Component tests").click(); + // Potentially wait for Vitest to have (re)started + await page.waitForTimeout(2000); + + await page.getByLabel("Start Component tests").click(); + + // Assert - Coverage report is collected and shown + await expect(page.getByLabel("Open coverage report")).toBeVisible({ timeout: 30000 }); + const sbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); + expect(sbPercentageText).toMatch(/^\d+\s%$/); + const sbPercentage = Number.parseInt(sbPercentageText!.replace(' %', '') ?? ''); + expect(sbPercentage).toBeGreaterThanOrEqual(0); + expect(sbPercentage).toBeLessThanOrEqual(100); + + // Act - Open HTML coverage report + const coverageReportLink = await page.getByLabel("Open coverage report"); + // Remove target="_blank" attribute to open in the same tab + await coverageReportLink.evaluate((elem) => elem.removeAttribute("target")); + await page.getByLabel("Open coverage report").click(); + + // Assert - HTML coverage report is accessible and reports the same coverage percentage as Storybook + const htmlPercentageText = await page.locator('span:has(+ :text("Statements"))').first().textContent() ?? ''; + const htmlPercentage = Number.parseFloat(htmlPercentageText.replace('% ', '')); + expect(Math.round(htmlPercentage)).toBe(sbPercentage); + }); }); diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index ff334163229a..88771208ddf2 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1853,7 +1853,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.15 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=637429&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=8c5acc&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/31d4f67b7bf72037481a896d86e551280692bc3f21edff1e27558657096171f128966e8eda20b19edc109c24098d107956a889e217c9d394c231d173ba3400a0 + checksum: 10/0dca94606557f8b58c5d09621e7b9b1360ee9d5f80ffb349fbf0cbe1233d839318a6eecf9e8430440e391127bd2ee9ebe96b7d1a25bb213522ac171437533e74 languageName: node linkType: hard From c00c054199d73cd88e6f53b713c3b944422c72c9 Mon Sep 17 00:00:00 2001 From: Kevin Yank Date: Wed, 4 Dec 2024 10:42:43 +1100 Subject: [PATCH 010/169] Undo unintentional formatting change --- code/frameworks/nextjs/src/preset.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index 473e24655848..6b90ae543a22 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -170,10 +170,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig, configureNextFont(baseConfig, useSWC); configureRuntimeNextjsVersionResolution(baseConfig); - configureImports({ - baseConfig, - configDir: options.configDir, - }); + configureImports({ baseConfig, configDir: options.configDir }); configureCss(baseConfig, nextConfig); configureImages(baseConfig, nextConfig); configureStyledJsx(baseConfig); From c91f6043927387e66ef25e8ac4b0cace63caf90c Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 11:41:53 +0100 Subject: [PATCH 011/169] commit stuff - not done --- code/addons/test/src/vitest-plugin/index.ts | 9 +- .../react/.storybook/main.ts | 6 + .../react/.storybook/preview-head.html | 5 + .../react/e2e-tests/component-testing.spec.ts | 212 ++++++++++++++++-- .../react/package.json | 2 + .../react/stories/AddonTest.stories.tsx | 26 ++- .../react/stories/Button.playwright.tsx | 2 +- .../react/stories/OtherComponent.stories.tsx | 24 ++ .../react/vitest.workspace.ts | 10 +- .../react/yarn.lock | 95 ++++++-- 10 files changed, 349 insertions(+), 42 deletions(-) create mode 100644 test-storybooks/portable-stories-kitchen-sink/react/.storybook/preview-head.html create mode 100644 test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index 05bf16e82ba6..aadd83680e07 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -79,14 +79,17 @@ export const storybookTest = (options?: UserOptions): Plugin => { name: 'vite-plugin-storybook-test', enforce: 'pre', async transformIndexHtml(html) { + console.log('LOG: transformIndexHtml'); const presets = await presetPromise; const headHtmlSnippet = await presets.apply('previewHead'); const bodyHtmlSnippet = await presets.apply('previewBody'); - html - .replace(/<\/head>/, `${headHtmlSnippet}`) - .replace(//, `${bodyHtmlSnippet}`); + const result = html + .replace('', `${headHtmlSnippet ?? ''}`) + .replace('', `${bodyHtmlSnippet ?? ''}`); + console.log('LOG: result', result); + return result; }, async config(input) { let config = input; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts index 9a2664c6e951..99ed3c65c752 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts @@ -13,5 +13,11 @@ const config: StorybookConfig = { core: { disableWhatsNewNotifications: true }, + previewHead: (head = '') => `${head} + `, }; export default config; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/preview-head.html b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/preview-head.html new file mode 100644 index 000000000000..61252d019910 --- /dev/null +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/preview-head.html @@ -0,0 +1,5 @@ + diff --git a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts index 5a79c80a313a..9aa8751b60ca 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts @@ -6,16 +6,13 @@ import { expect, test } from "@playwright/test"; import { SbPage } from "../../../../code/e2e-tests/util"; -const storybookUrl = "http://localhost:6006"; -const testStoryPath = path.resolve( - __dirname, - "..", - "stories/AddonTest.stories.tsx" -); +const STORYBOOK_URL = "http://localhost:6006"; +const TEST_STORY_PATH = path.resolve(__dirname, "..", "stories", "AddonTest.stories.tsx"); +const BUTTON_COMPONENT_PATH = path.resolve(__dirname, "..", "stories", "Button.tsx"); const setForceFailureFlag = async (value: boolean) => { // Read the story file content asynchronously - const storyContent = (await fs.readFile(testStoryPath)).toString(); + const storyContent = (await fs.readFile(TEST_STORY_PATH)).toString(); // Create a regex to match 'forceFailure: true' or 'forceFailure: false' const forceFailureRegex = /forceFailure:\s*(true|false)/; @@ -27,7 +24,7 @@ const setForceFailureFlag = async (value: boolean) => { ); // Write the updated content back to the file asynchronously - await fs.writeFile(testStoryPath, updatedContent); + await fs.writeFile(TEST_STORY_PATH, updatedContent); }; test.describe("component testing", () => { @@ -35,7 +32,7 @@ test.describe("component testing", () => { test.beforeEach(async ({ page }) => { const sbPage = new SbPage(page, expect); - await page.goto(storybookUrl); + await page.goto(STORYBOOK_URL); await page.evaluate(() => window.sessionStorage.clear()); await sbPage.waitUntilLoaded(); }); @@ -47,7 +44,7 @@ test.describe("component testing", () => { test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); const sbPage = new SbPage(page, expect); - await sbPage.navigateToStory("addons/test", "Mismatch Failure"); + await sbPage.navigateToStory("addons/group/test", "Mismatch Failure"); const expandButton = await page.getByLabel('Expand testing module') await expandButton.click(); @@ -97,7 +94,7 @@ test.describe("component testing", () => { ); // Assert discrepancy: CLI fail + Browser pass - await sbPage.navigateToStory("addons/test", "Mismatch Success"); + await sbPage.navigateToStory("addons/group/test", "Mismatch Success"); const successfulStoryElement = page.locator( '[data-item-id="addons-test--mismatch-success"] [role="status"]' ); @@ -118,7 +115,7 @@ test.describe("component testing", () => { await setForceFailureFlag(true); const sbPage = new SbPage(page, expect); - await sbPage.navigateToStory("addons/test", "Expected Failure"); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); const expandButton = await page.getByLabel('Expand testing module') await expandButton.click(); @@ -189,7 +186,7 @@ test.describe("component testing", () => { await setForceFailureFlag(false); const sbPage = new SbPage(page, expect); - await sbPage.navigateToStory("addons/test", "Expected Failure"); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); const expandButton = await page.getByLabel('Expand testing module') await expandButton.click(); @@ -247,7 +244,7 @@ test.describe("component testing", () => { await setForceFailureFlag(false); const sbPage = new SbPage(page, expect); - await sbPage.navigateToStory("addons/test", "Expected Failure"); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); const expandButton = await page.getByLabel('Expand testing module') await expandButton.click(); @@ -265,7 +262,7 @@ test.describe("component testing", () => { await page.getByLabel("Coverage").click(); await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); await page.getByLabel("Close settings for Component tests").click(); - // Potentially wait for Vitest to have (re)started + // Wait for Vitest to have (re)started await page.waitForTimeout(2000); await page.getByLabel("Start Component tests").click(); @@ -288,5 +285,190 @@ test.describe("component testing", () => { const htmlPercentageText = await page.locator('span:has(+ :text("Statements"))').first().textContent() ?? ''; const htmlPercentage = Number.parseFloat(htmlPercentageText.replace('% ', '')); expect(Math.round(htmlPercentage)).toBe(sbPercentage); + + // Cleanup - Disable coverage again + await page.getByLabel("Open settings for Component tests").click(); + await page.getByLabel("Coverage").click(); + await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); + }); + + test("should run focused test for a single story", async ({ + page, + browserName, + }) => { + test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); + // Arrange - Prepare Storybook + await setForceFailureFlag(false); + + const sbPage = new SbPage(page, expect); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); + + const expandButton = await page.getByLabel('Expand testing module') + await expandButton.click(); + + const storyElement = sbPage + .getCanvasBodyElement() + .getByRole("button", { name: "test" }); + await expect(storyElement).toBeVisible({ timeout: 30000 }); + + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="addons-group-test--expected-failure"]').hover(); + await page.locator('[data-item-id="addons-group-test--expected-failure"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Assert - Only one test is running and reported + await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/1'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test'); + await expect(sidebarContextMenu.getByLabel('status: passed')).toHaveCount(1); + await page.click('body'); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(1); }); + + test("should run focused test for a component", async ({ + page, + browserName, + }) => { + test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); + // Arrange - Prepare Storybook + await setForceFailureFlag(false); + + const sbPage = new SbPage(page, expect); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); + + const expandButton = await page.getByLabel('Expand testing module') + await expandButton.click(); + + const storyElement = sbPage + .getCanvasBodyElement() + .getByRole("button", { name: "test" }); + await expect(storyElement).toBeVisible({ timeout: 30000 }); + + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="addons-group-test"]').hover(); + await page.locator('[data-item-id="addons-group-test"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Assert - 5 tests are running and reported + await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/5'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 5 test'); + // Assert - 1 failing test shows as a failed status + await expect(sidebarContextMenu.getByText('1 story with errors')).toBeVisible(); + await expect(sidebarContextMenu.getByLabel('status: failed')).toHaveCount(1); + + await page.click('body'); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(4); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(1); + }); + + test("should run focused test for a group", async ({ + page, + browserName, + }) => { + test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); + // Arrange - Prepare Storybook + await setForceFailureFlag(false); + + const sbPage = new SbPage(page, expect); + await sbPage.navigateToStory("addons/group/test", "Expected Failure"); + + const expandButton = await page.getByLabel('Expand testing module') + await expandButton.click(); + + const storyElement = sbPage + .getCanvasBodyElement() + .getByRole("button", { name: "test" }); + await expect(storyElement).toBeVisible({ timeout: 30000 }); + + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="addons-group"]').hover(); + await page.locator('[data-item-id="addons-group"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Assert - 5 tests are running and reported + await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/7'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 7 test'); + // Assert - 1 failing test shows as a failed status + await expect(sidebarContextMenu.getByText('2 story with errors')).toBeVisible(); + await expect(sidebarContextMenu.getByLabel('status: failed')).toHaveCount(1); + + await page.click('body'); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(4); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(1); + }); + + test("should run focused tests without coverage, even when enabled", async ({ + page, + browserName, + }) => { + test.skip(browserName !== "chromium", `Skipping tests for ${browserName}`); + // Arrange - Prepare Storybook + await setForceFailureFlag(false); + + const sbPage = new SbPage(page, expect); + await sbPage.navigateToStory("example/button", "CSF 3 Primary"); + + const expandButton = await page.getByLabel('Expand testing module') + await expandButton.click(); + + const storyElement = sbPage + .getCanvasBodyElement() + .getByRole("button", { name: "test" }); + await expect(storyElement).toBeVisible({ timeout: 30000 }); + + // Act - Enable coverage and run ALL tests + await page.getByLabel("Open settings for Component tests").click(); + await page.getByLabel("Coverage").click(); + await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); + await page.getByLabel("Close settings for Component tests").click(); + // Wait for Vitest to have (re)started + await page.waitForTimeout(2000); + + await page.getByLabel("Start Component tests").click(); + + // Assert - Coverage report is collected and shown + await expect(page.getByLabel("Open coverage report")).toBeVisible({ timeout: 30000 }); + const firstSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); + expect(firstSbPercentageText).toMatch(/^\d+\s%$/); + const firstSbPercentage = Number.parseInt(firstSbPercentageText!.replace(' %', '') ?? ''); + + // Arrange - Add uncovered lines to Button.tsx to force coverage to drop + const initialButtonContent = (await fs.readFile(BUTTON_COMPONENT_PATH)).toString(); + await fs.writeFile(BUTTON_COMPONENT_PATH, [initialButtonContent, + `export const uncovered = () => { + ${Array.from({ length: 300 }).map(() => 'void;').join('\n')} + };`].join('\n')); +//TODO: CLEANUP + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); + await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Arrange - Wait for test to finish and unfocus sidebar context menu + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test'); + await page.click('body'); + + // Assert - Coverage percentage is unchanged + console.log('LOG: firstSbPercentageText', firstSbPercentageText); + console.log('LOG: secondSbPercentageText', await page.getByLabel(/percent coverage$/).textContent()); + expect(await page.getByLabel(/percent coverage$/).textContent()).toEqual(firstSbPercentageText); + + // Act - Run ALL tests again + await page.getByLabel("Start Component tests").click(); + + // Arrange - Wait for tests to finish + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/); + + // Assert - Coverage percentage is updated to reflect the new coverage + const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); + expect(updatedSbPercentageText).toMatch(/^\d+\s%$/); + const updatedSbPercentage = Number.parseInt(updatedSbPercentageText!.replace(' %', '') ?? ''); + expect(updatedSbPercentage).toBeGreaterThanOrEqual(0); + expect(updatedSbPercentage).toBeLessThan(firstSbPercentage); + + }); + }); diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 4c20025a192b..e7d4dae6cd83 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -11,6 +11,7 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "playwright-ct": "playwright test -c playwright-ct.config.ts", "playwright-e2e": "playwright test -c playwright-e2e.config.ts", + "vitest-non-failing-tests": "SKIP_FAIL_ON_PURPOSE=true vitest run", "preview": "vite preview", "storybook": "storybook dev -p 6006", "vitest": "echo 'not running'" @@ -110,6 +111,7 @@ "@vitejs/plugin-react": "^4.2.1", "@vitest/browser": "^2.1.6", "@vitest/coverage-v8": "^2.1.6", + "@vitest/ui": "2.1.8", "cypress": "^13.6.4", "eslint": "^8.56.0", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx index 365ed4da0e6b..8a61b2b89f1d 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx @@ -1,19 +1,24 @@ -import { Meta } from '@storybook/react' +import { expect } from '@storybook/test'; +import { Meta, type StoryObj } from '@storybook/react' import { instrument } from '@storybook/instrumenter' import type { StoryAnnotations } from 'storybook/internal/types'; declare global { - // eslint-disable-next-line no-var, @typescript-eslint/naming-convention + // eslint-disable-next-line no-var var __vitest_browser__: boolean; } const Component = () => -export default { - title: 'Addons/Test', +const meta = { + title: 'Addons/Group/Test', component: Component, } as Meta; +export default meta; + +type Story = StoryObj; + const { pass } = instrument({ pass: async () => {}, }, { intercept: true }) @@ -57,5 +62,16 @@ export const MismatchSuccess = { if(globalThis.__vitest_browser__) { throw new Error('Unexpected success'); } + }, + tags: ['fail-on-purpose'], +} satisfies StoryAnnotations; + +export const PreviewHeadTest: Story = { + play: async () => { + const styles = window.getComputedStyle(document.body); + // set in preview-head.html + expect(styles.backgroundColor).toBe('rgb(250, 250, 210)'); + // set in main.js#previewHead + expect(styles.borderColor).toBe('rgb(255, 0, 0)'); } -} satisfies StoryAnnotations; \ No newline at end of file +}; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.playwright.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.playwright.tsx index db4590c82fab..ee201e587159 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.playwright.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.playwright.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import { createTest } from '@storybook/react/experimental-playwright'; import { test as base, expect } from '@playwright/experimental-ct-react'; import stories, { SingleComposedStory, WithSpanishGlobal } from './Button.stories.playwright'; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx new file mode 100644 index 000000000000..98ef7e00065a --- /dev/null +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx @@ -0,0 +1,24 @@ +import { Meta } from '@storybook/react' +import type { StoryAnnotations } from 'storybook/internal/types'; + +declare global { + // eslint-disable-next-line no-var + var __vitest_browser__: boolean; +} + +const Component = () => + +export default { + title: 'Addons/Group/Other', + component: Component, +} as Meta; + +export const Passes = { +} satisfies StoryAnnotations; + +export const Fails = { + play: async () => { + throw new Error('Expected failure'); + }, + tags: ['fail-on-purpose'], +} satisfies StoryAnnotations; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts b/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts index f1657f3acddd..fdc40b556029 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts @@ -5,13 +5,17 @@ export default defineWorkspace([ { extends: "vite.config.ts", plugins: [ - storybookTest(), + storybookTest(process.env.SKIP_FAIL_ON_PURPOSE ? { + tags: { + exclude: ["fail-on-purpose"], + } + } : undefined), ], test: { name: "storybook", pool: "threads", include: [ - "stories/AddonTest.stories.?(c|m)[jt]s?(x)", + "stories/*.stories.?(c|m)[jt]s?(x)", ], deps: { optimizer: { @@ -30,4 +34,4 @@ export default defineWorkspace([ environment: "happy-dom", }, }, -]); \ No newline at end of file +]); diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 88771208ddf2..6aeacc4f54b3 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1792,11 +1792,11 @@ __metadata: linkType: soft "@storybook/components@file:../../../code/deprecated/components::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.15 - resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=0be72f&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.17 + resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=88319a&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/744a23254c29518601e7f3ff9e549693c6c17b5bf75fccb532826213860fb78c8b3d9dc1be0e4f6dbaa4f42b439521017f79f0d0d43ddaacddf9938174048ff6 + checksum: 10/d3e6ae03a1f331ae8e67e593d9f18f40fb2e3a8be4d8c8c495826ccb7b052775f68824371c514daaa87484182685007a636de76796ac1e5c26009407a7e6a64d languageName: node linkType: hard @@ -1852,8 +1852,8 @@ __metadata: linkType: hard "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.15 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=8c5acc&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.17 + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=769cd0&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/0dca94606557f8b58c5d09621e7b9b1360ee9d5f80ffb349fbf0cbe1233d839318a6eecf9e8430440e391127bd2ee9ebe96b7d1a25bb213522ac171437533e74 + checksum: 10/b78c23be02c5622a4ef5afc4229a92cd6cbe0c1bb60b739d7b2d823c6313db6f95642d5581ebee7fbf9b0f4da437cf88d97f5240901c1c5a98890edde6500396 languageName: node linkType: hard @@ -1909,20 +1909,20 @@ __metadata: linkType: soft "@storybook/manager-api@file:../../../code/deprecated/manager-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.15 - resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=524260&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.17 + resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=98fa43&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/fcef37968ca864618fda44849c4442f89ffa1349239a0107b00c830d289e44bc48602c0f5b1ea90a092939cf3bb51030649ac042f6a8210dfa18ed87efcf4b80 + checksum: 10/7276107e58c3598282d0359fce675b0eb95dd11792d2ec944caffcd5eb254b32b61d1900a74fd318ecc158959347aabae2642a3be6715f2ddcc9290a6468c05f languageName: node linkType: hard "@storybook/preview-api@file:../../../code/deprecated/preview-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.15 - resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=a4220e&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.17 + resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=a9de97&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/7e69d44343f24a1291b9604450d85e11149dccf61755ded28268d9791e887f6a60b3ec05b76df4d9dd9be6b2b30a6d6bb7db1feea27448e0ab904162e5fbb630 + checksum: 10/ac50a70d12304ab0661fdfdf7591d31d1dd943ac79f59cd554cff31f8dcc93de817256dabfff8f6d81db404d7ffcc46453e0cd2ef1983152f2668da618ebc4c9 languageName: node linkType: hard @@ -1950,10 +1950,14 @@ __metadata: resolve: "npm:^1.22.8" tsconfig-paths: "npm:^4.2.0" peerDependencies: + "@storybook/test": "workspace:*" 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 storybook: "workspace:^" vite: ^4.0.0 || ^5.0.0 || ^6.0.0 + peerDependenciesMeta: + "@storybook/test": + optional: true languageName: node linkType: soft @@ -1999,11 +2003,11 @@ __metadata: linkType: soft "@storybook/theming@file:../../../code/deprecated/theming::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.15 - resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=6dcd01&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.17 + resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=6cb022&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/070e791f22ca7bb55dffdd43e52d80aa1ae367a64375718d7634b73798536f4f1210820f1547991e7c00f821e2763edb8b30e64f22af5eaf10b4af21b3ad230e + checksum: 10/4b59447f28ca2682e24ab2cf62976fdaaea63c1aa97e687ec6da9e7865716d13439b8ea259aa742c8a0ede23f52025f57c7562f9acf794cddbe7c9a054bea069 languageName: node linkType: hard @@ -2842,6 +2846,23 @@ __metadata: languageName: node linkType: hard +"@vitest/ui@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/ui@npm:2.1.8" + dependencies: + "@vitest/utils": "npm:2.1.8" + fflate: "npm:^0.8.2" + flatted: "npm:^3.3.1" + pathe: "npm:^1.1.2" + sirv: "npm:^3.0.0" + tinyglobby: "npm:^0.2.10" + tinyrainbow: "npm:^1.2.0" + peerDependencies: + vitest: 2.1.8 + checksum: 10/7ff0532b3b0e3f93c037cad3528b8fde8a93188f3222b92faae42e0fdd996e9284b362c4e5e9d725ce0a019870d3b0b7ad80c1874f74b43ffc5a1d703803fdd8 + languageName: node + linkType: hard + "@vitest/utils@npm:2.1.6": version: 2.1.6 resolution: "@vitest/utils@npm:2.1.6" @@ -4769,6 +4790,25 @@ __metadata: languageName: node linkType: hard +"fdir@npm:^6.4.2": + version: 6.4.2 + resolution: "fdir@npm:6.4.2" + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + checksum: 10/5ff80d1d2034e75cc68be175401c9f64c4938a6b2c1e9a0c27f2d211ffbe491fd86d29e4576825d9da8aff9bd465f0283427c2dddc11653457906c46d3bbc448 + languageName: node + linkType: hard + +"fflate@npm:^0.8.2": + version: 0.8.2 + resolution: "fflate@npm:0.8.2" + checksum: 10/2bd26ba6d235d428de793c6a0cd1aaa96a06269ebd4e21b46c8fd1bd136abc631acf27e188d47c3936db090bf3e1ede11d15ce9eae9bffdc4bfe1b9dc66ca9cb + languageName: node + linkType: hard + "figures@npm:^3.2.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -4834,6 +4874,13 @@ __metadata: languageName: node linkType: hard +"flatted@npm:^3.3.1": + version: 3.3.2 + resolution: "flatted@npm:3.3.2" + checksum: 10/ac3c159742e01d0e860a861164bcfd35bb567ccbebb8a0dd041e61cf3c64a435b917dd1e7ed1c380c2ebca85735fb16644485ec33665bc6aafc3b316aa1eed44 + languageName: node + linkType: hard + "for-each@npm:^0.3.3": version: 0.3.3 resolution: "for-each@npm:0.3.3" @@ -7339,6 +7386,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: 10/ce617b8da36797d09c0baacb96ca8a44460452c89362d7cb8f70ca46b4158ba8bc3606912de7c818eb4a939f7f9015cef3c766ec8a0c6bfc725fdc078e39c717 + languageName: node + linkType: hard + "pify@npm:^2.2.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -7421,6 +7475,7 @@ __metadata: "@vitejs/plugin-react": "npm:^4.2.1" "@vitest/browser": "npm:^2.1.6" "@vitest/coverage-v8": "npm:^2.1.6" + "@vitest/ui": "npm:2.1.8" cypress: "npm:^13.6.4" eslint: "npm:^8.56.0" eslint-plugin-react-hooks: "npm:^4.6.0" @@ -8453,6 +8508,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.10": + version: 0.2.10 + resolution: "tinyglobby@npm:0.2.10" + dependencies: + fdir: "npm:^6.4.2" + picomatch: "npm:^4.0.2" + checksum: 10/10c976866d849702edc47fc3fef27d63f074c40f75ef17171ecc1452967900699fa1e62373681dd58e673ddff2e3f6094bcd0a2101e3e4b30f4c2b9da41397f2 + languageName: node + linkType: hard + "tinypool@npm:^1.0.1": version: 1.0.2 resolution: "tinypool@npm:1.0.2" From eb1a5261f797119e41cd8f5a9eef510a8ec9f04e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 5 Dec 2024 12:01:38 +0100 Subject: [PATCH 012/169] add an experimentalLoadStorybook api --- code/addons/test/src/vitest-plugin/index.ts | 10 +- code/core/src/core-server/index.ts | 2 + code/core/src/core-server/load.ts | 152 ++++++++++++++++++++ 3 files changed, 158 insertions(+), 6 deletions(-) create mode 100644 code/core/src/core-server/load.ts diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index aadd83680e07..44454556e3eb 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -8,7 +8,7 @@ import { normalizeStories, validateConfigurationFiles, } from 'storybook/internal/common'; -import { StoryIndexGenerator } from 'storybook/internal/core-server'; +import { StoryIndexGenerator, experimental_loadStorybook } from 'storybook/internal/core-server'; import { readConfig, vitestTransform } from 'storybook/internal/csf-tools'; import { MainFileMissingError } from 'storybook/internal/server-errors'; import type { DocsOptions, StoriesEntry } from 'storybook/internal/types'; @@ -68,10 +68,8 @@ export const storybookTest = (options?: UserOptions): Plugin => { const configDir = finalOptions.configDir; - const presetPromise = loadAllPresets({ + const presetPromise = experimental_loadStorybook({ configDir, - corePresets: [], - overridePresets: [], packageJson: {}, }); @@ -80,7 +78,7 @@ export const storybookTest = (options?: UserOptions): Plugin => { enforce: 'pre', async transformIndexHtml(html) { console.log('LOG: transformIndexHtml'); - const presets = await presetPromise; + const { presets } = await presetPromise; const headHtmlSnippet = await presets.apply('previewHead'); const bodyHtmlSnippet = await presets.apply('previewBody'); @@ -103,7 +101,7 @@ export const storybookTest = (options?: UserOptions): Plugin => { }); } - const presets = await presetPromise; + const { presets } = await presetPromise; const workingDir = process.cwd(); const directories = { diff --git a/code/core/src/core-server/index.ts b/code/core/src/core-server/index.ts index 3163e70875ea..d8fe607d203f 100644 --- a/code/core/src/core-server/index.ts +++ b/code/core/src/core-server/index.ts @@ -7,3 +7,5 @@ export * from './build-dev'; export * from './withTelemetry'; export { default as build } from './standalone'; export { StoryIndexGenerator } from './utils/StoryIndexGenerator'; + +export { loadStorybook as experimental_loadStorybook } from './load'; diff --git a/code/core/src/core-server/load.ts b/code/core/src/core-server/load.ts new file mode 100644 index 000000000000..b4d6d155f1db --- /dev/null +++ b/code/core/src/core-server/load.ts @@ -0,0 +1,152 @@ +import { join, relative, resolve } from 'node:path'; + +import { + getConfigInfo, + getProjectRoot, + loadAllPresets, + loadMainConfig, + resolveAddonName, + resolvePathInStorybookCache, + validateFrameworkName, + versions, +} from '@storybook/core/common'; +import { oneWayHash } from '@storybook/core/telemetry'; +import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storybook/core/types'; +import { global } from '@storybook/global'; + +import { MissingBuilderError } from '@storybook/core/server-errors'; + +import prompts from 'prompts'; +import invariant from 'tiny-invariant'; + +import { getManagerBuilder, getPreviewBuilder } from './utils/get-builders'; +import { getServerChannelUrl, getServerPort } from './utils/server-address'; +import { updateCheck } from './utils/update-check'; + +export async function loadStorybook( + options: CLIOptions & + LoadOptions & + BuilderOptions & { + storybookVersion?: string; + previewConfigPath?: string; + } +): Promise { + const { packageJson, versionUpdates } = options; + let { storybookVersion, previewConfigPath } = options; + const configDir = resolve(options.configDir); + if (packageJson) { + invariant( + packageJson.version !== undefined, + `Expected package.json#version to be defined in the "${packageJson.name}" package}` + ); + storybookVersion = packageJson.version; + previewConfigPath = getConfigInfo(packageJson, configDir).previewConfig ?? undefined; + } else { + if (!storybookVersion) { + storybookVersion = versions.storybook; + } + } + // updateInfo are cached, so this is typically pretty fast + const [port, versionCheck] = await Promise.all([ + getServerPort(options.port, { exactPort: options.exactPort }), + versionUpdates + ? updateCheck(storybookVersion) + : Promise.resolve({ success: false, cached: false, data: {}, time: Date.now() }), + ]); + + if (!options.ci && !options.smokeTest && options.port != null && port !== options.port) { + const { shouldChangePort } = await prompts({ + type: 'confirm', + initial: true, + name: 'shouldChangePort', + message: `Port ${options.port} is not available. Would you like to run Storybook on port ${port} instead?`, + }); + if (!shouldChangePort) { + process.exit(1); + } + } + + const rootDir = getProjectRoot(); + const cacheKey = oneWayHash(relative(rootDir, configDir)); + + const cacheOutputDir = resolvePathInStorybookCache('public', cacheKey); + let outputDir = resolve(options.outputDir || cacheOutputDir); + if (options.smokeTest) { + outputDir = cacheOutputDir; + } + + options.port = port; + options.versionCheck = versionCheck; + options.configType = 'DEVELOPMENT'; + options.configDir = configDir; + options.cacheKey = cacheKey; + options.outputDir = outputDir; + options.serverChannelUrl = getServerChannelUrl(port, options); + + const config = await loadMainConfig(options); + const { framework } = config; + const corePresets = []; + + let frameworkName = typeof framework === 'string' ? framework : framework?.name; + if (!options.ignorePreview) { + validateFrameworkName(frameworkName); + } + if (frameworkName) { + corePresets.push(join(frameworkName, 'preset')); + } + + frameworkName = frameworkName || 'custom'; + + // Load first pass: We need to determine the builder + // We need to do this because builders might introduce 'overridePresets' which we need to take into account + // We hope to remove this in SB8 + let presets = await loadAllPresets({ + corePresets, + overridePresets: [ + require.resolve('@storybook/core/core-server/presets/common-override-preset'), + ], + ...options, + isCritical: true, + }); + + const { renderer, builder, disableTelemetry } = await presets.apply('core', {}); + + if (!builder) { + throw new MissingBuilderError(); + } + + const builderName = typeof builder === 'string' ? builder : builder.name; + const [previewBuilder, managerBuilder] = await Promise.all([ + getPreviewBuilder(builderName, options.configDir), + getManagerBuilder(), + ]); + + const resolvedRenderer = renderer && resolveAddonName(options.configDir, renderer, options); + + // Load second pass: all presets are applied in order + presets = await loadAllPresets({ + corePresets: [ + require.resolve('@storybook/core/core-server/presets/common-preset'), + ...(managerBuilder.corePresets || []), + ...(previewBuilder.corePresets || []), + ...(resolvedRenderer ? [resolvedRenderer] : []), + ...corePresets, + ], + overridePresets: [ + ...(previewBuilder.overridePresets || []), + require.resolve('@storybook/core/core-server/presets/common-override-preset'), + ], + ...options, + }); + + const features = await presets.apply('features'); + global.FEATURES = features; + + const fullOptions: Options = { + ...options, + presets, + features, + }; + + return fullOptions; +} From 41a0c7a0fbab24b39b862330de312b3eb9284305 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 5 Dec 2024 13:36:34 +0100 Subject: [PATCH 013/169] cleanup --- code/addons/test/src/vitest-plugin/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index 44454556e3eb..11c5917ba383 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -4,7 +4,6 @@ import { mergeConfig } from 'vitest/config'; import { getInterpretedFile, - loadAllPresets, normalizeStories, validateConfigurationFiles, } from 'storybook/internal/common'; From bac7061dcdf17148b88976730734b3a98b30e4fe Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 5 Dec 2024 14:47:24 +0100 Subject: [PATCH 014/169] Nextjs: Add TS docgen support for Vite implementation --- code/frameworks/experimental-nextjs-vite/package.json | 1 + code/frameworks/experimental-nextjs-vite/src/preset.ts | 9 ++++++--- code/frameworks/react-native-web-vite/src/preset.ts | 1 - code/frameworks/react-vite/package.json | 10 ++++++++++ code/frameworks/react-vite/src/preset.ts | 2 +- code/yarn.lock | 1 + 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index 356177bfabeb..d5ea27b70763 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -97,6 +97,7 @@ "dependencies": { "@storybook/builder-vite": "workspace:*", "@storybook/react": "workspace:*", + "@storybook/react-vite": "workspace:*", "@storybook/test": "workspace:*", "styled-jsx": "5.1.6", "vite-plugin-storybook-nextjs": "^1.1.0" diff --git a/code/frameworks/experimental-nextjs-vite/src/preset.ts b/code/frameworks/experimental-nextjs-vite/src/preset.ts index 0a725be35804..633f62a5dceb 100644 --- a/code/frameworks/experimental-nextjs-vite/src/preset.ts +++ b/code/frameworks/experimental-nextjs-vite/src/preset.ts @@ -4,6 +4,7 @@ import path from 'node:path'; import type { PresetProperty } from 'storybook/internal/types'; import type { StorybookConfigVite } from '@storybook/builder-vite'; +import { viteFinal as reactViteFinal } from '@storybook/react-vite/preset'; import { dirname, join } from 'path'; import vitePluginStorybookNextjs from 'vite-plugin-storybook-nextjs'; @@ -34,11 +35,13 @@ export const previewAnnotations: PresetProperty<'previewAnnotations'> = (entry = }; export const viteFinal: StorybookConfigVite['viteFinal'] = async (config, options) => { - config.plugins = config.plugins || []; + const reactConfig = await reactViteFinal(config, options); + const { plugins = [] } = reactConfig; + const { nextConfigPath } = await options.presets.apply('frameworkOptions'); const nextDir = nextConfigPath ? path.dirname(nextConfigPath) : undefined; - config.plugins.push(vitePluginStorybookNextjs({ dir: nextDir })); + plugins.push(vitePluginStorybookNextjs({ dir: nextDir })); - return config; + return reactConfig; }; diff --git a/code/frameworks/react-native-web-vite/src/preset.ts b/code/frameworks/react-native-web-vite/src/preset.ts index 8e3d7d6b58a8..bdacadb5e0a1 100644 --- a/code/frameworks/react-native-web-vite/src/preset.ts +++ b/code/frameworks/react-native-web-vite/src/preset.ts @@ -1,4 +1,3 @@ -// @ts-expect-error FIXME import { viteFinal as reactViteFinal } from '@storybook/react-vite/preset'; import { esbuildFlowPlugin, flowPlugin } from '@bunchtogether/vite-plugin-flow'; diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index a6049e65c674..3394c59cbe3c 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -32,6 +32,16 @@ }, "./package.json": "./package.json" }, + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "preset": [ + "dist/preset.d.ts" + ] + } + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/frameworks/react-vite/src/preset.ts b/code/frameworks/react-vite/src/preset.ts index cef1a270f33b..a01721dadacc 100644 --- a/code/frameworks/react-vite/src/preset.ts +++ b/code/frameworks/react-vite/src/preset.ts @@ -12,7 +12,7 @@ export const core: PresetProperty<'core'> = { renderer: getAbsolutePath('@storybook/react'), }; -export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets }) => { +export const viteFinal: NonNullable = async (config, { presets }) => { const { plugins = [] } = config; // Add docgen plugin diff --git a/code/yarn.lock b/code/yarn.lock index 389084993441..4470010205ac 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6658,6 +6658,7 @@ __metadata: dependencies: "@storybook/builder-vite": "workspace:*" "@storybook/react": "workspace:*" + "@storybook/react-vite": "workspace:*" "@storybook/test": "workspace:*" "@types/node": "npm:^18.0.0" next: "npm:^15.0.3" From 6f48ea836b6149414cd0d3e9bc90ca5b0c4a54f8 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 20:41:12 +0100 Subject: [PATCH 015/169] fix coverage+watch test --- .../react/e2e-tests/component-testing.spec.ts | 16 ++++++++++------ .../react/yarn.lock | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts index 9aa8751b60ca..e326620ef600 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts @@ -415,7 +415,7 @@ test.describe("component testing", () => { const storyElement = sbPage .getCanvasBodyElement() - .getByRole("button", { name: "test" }); + .getByRole("button", { name: "foo" }); await expect(storyElement).toBeVisible({ timeout: 30000 }); // Act - Enable coverage and run ALL tests @@ -437,10 +437,12 @@ test.describe("component testing", () => { // Arrange - Add uncovered lines to Button.tsx to force coverage to drop const initialButtonContent = (await fs.readFile(BUTTON_COMPONENT_PATH)).toString(); await fs.writeFile(BUTTON_COMPONENT_PATH, [initialButtonContent, - `export const uncovered = () => { - ${Array.from({ length: 300 }).map(() => 'void;').join('\n')} - };`].join('\n')); -//TODO: CLEANUP + `const voidFn = () => {}; + +export const uncovered = () => { + ${Array.from({ length: 300 }).map(() => 'voidFn();').join('\n ')} +};`].join('\n')); + // Act - Open sidebar context menu and start focused test await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); @@ -460,7 +462,7 @@ test.describe("component testing", () => { await page.getByLabel("Start Component tests").click(); // Arrange - Wait for tests to finish - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/); + await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); // Assert - Coverage percentage is updated to reflect the new coverage const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); @@ -469,6 +471,8 @@ test.describe("component testing", () => { expect(updatedSbPercentage).toBeGreaterThanOrEqual(0); expect(updatedSbPercentage).toBeLessThan(firstSbPercentage); + // Cleanup - Remove uncovered lines from Button.tsx + await fs.writeFile(BUTTON_COMPONENT_PATH, initialButtonContent); }); }); diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 6aeacc4f54b3..972244bee296 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1853,7 +1853,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.17 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=769cd0&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=0b7853&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/b78c23be02c5622a4ef5afc4229a92cd6cbe0c1bb60b739d7b2d823c6313db6f95642d5581ebee7fbf9b0f4da437cf88d97f5240901c1c5a98890edde6500396 + checksum: 10/a0daef8f8313e217ce54be97eced7e71d7442f876935df137624056202fe3facc2b1502f0540058a80def68abd1a3657ddcdd8a3bfd91e29ef439403a7c306e4 languageName: node linkType: hard From 269f1a2d49c8be6f5adb0e6a66e27969b9ae6f2d Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 21:18:19 +0100 Subject: [PATCH 016/169] fix tests --- .../react/e2e-tests/component-testing.spec.ts | 105 +++++++++--------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts index e326620ef600..6b76638c669c 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts @@ -83,7 +83,7 @@ test.describe("component testing", () => { // Assert discrepancy: CLI pass + Browser fail const failingStoryElement = page.locator( - '[data-item-id="addons-test--mismatch-failure"] [role="status"]' + '[data-item-id="addons-group-test--mismatch-failure"] [role="status"]' ); await expect(failingStoryElement).toHaveAttribute( "aria-label", @@ -96,7 +96,7 @@ test.describe("component testing", () => { // Assert discrepancy: CLI fail + Browser pass await sbPage.navigateToStory("addons/group/test", "Mismatch Success"); const successfulStoryElement = page.locator( - '[data-item-id="addons-test--mismatch-success"] [role="status"]' + '[data-item-id="addons-group-test--mismatch-success"] [role="status"]' ); await expect(successfulStoryElement).toHaveAttribute( "aria-label", @@ -153,7 +153,7 @@ test.describe("component testing", () => { // Assert for expected success const successfulStoryElement = page.locator( - '[data-item-id="addons-test--expected-success"] [role="status"]' + '[data-item-id="addons-group-test--expected-success"] [role="status"]' ); await expect(successfulStoryElement).toHaveAttribute( "aria-label", @@ -162,7 +162,7 @@ test.describe("component testing", () => { // Assert for expected failure const failingStoryElement = page.locator( - '[data-item-id="addons-test--expected-failure"] [role="status"]' + '[data-item-id="addons-group-test--expected-failure"] [role="status"]' ); await expect(failingStoryElement).toHaveAttribute( "aria-label", @@ -175,7 +175,7 @@ test.describe("component testing", () => { const sidebarItems = page.locator( '.sidebar-item[data-ref-id="storybook_internal"][data-nodetype="component"]' ); - await expect(sidebarItems).toHaveCount(1); + await expect(sidebarItems).toHaveCount(2); }); test("should execute watch mode tests via testing module UI", async ({ @@ -210,7 +210,7 @@ test.describe("component testing", () => { // Assert for expected success const successfulStoryElement = page.locator( - '[data-item-id="addons-test--expected-success"] [role="status"]' + '[data-item-id="addons-group-test--expected-success"] [role="status"]' ); await expect(successfulStoryElement).toHaveAttribute( "aria-label", @@ -219,7 +219,7 @@ test.describe("component testing", () => { // Assert for expected failure const failingStoryElement = page.locator( - '[data-item-id="addons-test--expected-failure"] [role="status"]' + '[data-item-id="addons-group-test--expected-failure"] [role="status"]' ); await expect(failingStoryElement).toHaveAttribute( "aria-label", @@ -287,6 +287,8 @@ test.describe("component testing", () => { expect(Math.round(htmlPercentage)).toBe(sbPercentage); // Cleanup - Disable coverage again + await page.goBack(); + await expandButton.click(); await page.getByLabel("Open settings for Component tests").click(); await page.getByLabel("Coverage").click(); await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); @@ -318,7 +320,6 @@ test.describe("component testing", () => { await sidebarContextMenu.getByLabel('Start Component tests').click(); // Assert - Only one test is running and reported - await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/1'); await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test'); await expect(sidebarContextMenu.getByLabel('status: passed')).toHaveCount(1); await page.click('body'); @@ -351,15 +352,14 @@ test.describe("component testing", () => { await sidebarContextMenu.getByLabel('Start Component tests').click(); // Assert - 5 tests are running and reported - await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/5'); - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 5 test'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 6 test'); // Assert - 1 failing test shows as a failed status - await expect(sidebarContextMenu.getByText('1 story with errors')).toBeVisible(); + await expect(sidebarContextMenu.getByText('2 stories with errors')).toBeVisible(); await expect(sidebarContextMenu.getByLabel('status: failed')).toHaveCount(1); await page.click('body'); await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(4); - await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(1); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(2); }); test("should run focused test for a group", async ({ @@ -388,15 +388,14 @@ test.describe("component testing", () => { await sidebarContextMenu.getByLabel('Start Component tests').click(); // Assert - 5 tests are running and reported - await expect(sidebarContextMenu.locator('#testing-module-description')).toHaveText('Testing... 0/7'); - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 7 test'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 8 test', { timeout: 30000 }); // Assert - 1 failing test shows as a failed status - await expect(sidebarContextMenu.getByText('2 story with errors')).toBeVisible(); + await expect(sidebarContextMenu.getByText('3 stories with errors')).toBeVisible(); await expect(sidebarContextMenu.getByLabel('status: failed')).toHaveCount(1); await page.click('body'); await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(4); - await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(1); + await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: error' })).toHaveCount(2); }); test("should run focused tests without coverage, even when enabled", async ({ @@ -436,43 +435,45 @@ test.describe("component testing", () => { // Arrange - Add uncovered lines to Button.tsx to force coverage to drop const initialButtonContent = (await fs.readFile(BUTTON_COMPONENT_PATH)).toString(); - await fs.writeFile(BUTTON_COMPONENT_PATH, [initialButtonContent, - `const voidFn = () => {}; - -export const uncovered = () => { + try { + await fs.writeFile(BUTTON_COMPONENT_PATH, [initialButtonContent, + `const voidFn = () => {}; + + export const uncovered = () => { ${Array.from({ length: 300 }).map(() => 'voidFn();').join('\n ')} -};`].join('\n')); - - // Act - Open sidebar context menu and start focused test - await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); - await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); - const sidebarContextMenu = page.getByTestId('tooltip'); - await sidebarContextMenu.getByLabel('Start Component tests').click(); - - // Arrange - Wait for test to finish and unfocus sidebar context menu - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test'); - await page.click('body'); - - // Assert - Coverage percentage is unchanged - console.log('LOG: firstSbPercentageText', firstSbPercentageText); - console.log('LOG: secondSbPercentageText', await page.getByLabel(/percent coverage$/).textContent()); - expect(await page.getByLabel(/percent coverage$/).textContent()).toEqual(firstSbPercentageText); - - // Act - Run ALL tests again - await page.getByLabel("Start Component tests").click(); - - // Arrange - Wait for tests to finish - await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); - - // Assert - Coverage percentage is updated to reflect the new coverage - const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); - expect(updatedSbPercentageText).toMatch(/^\d+\s%$/); - const updatedSbPercentage = Number.parseInt(updatedSbPercentageText!.replace(' %', '') ?? ''); - expect(updatedSbPercentage).toBeGreaterThanOrEqual(0); - expect(updatedSbPercentage).toBeLessThan(firstSbPercentage); - - // Cleanup - Remove uncovered lines from Button.tsx - await fs.writeFile(BUTTON_COMPONENT_PATH, initialButtonContent); + };`].join('\n')); + + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); + await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Arrange - Wait for test to finish and unfocus sidebar context menu + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 }); + await page.click('body'); + + // Assert - Coverage percentage is unchanged + console.log('LOG: firstSbPercentageText', firstSbPercentageText); + console.log('LOG: secondSbPercentageText', await page.getByLabel(/percent coverage$/).textContent()); + expect(await page.getByLabel(/percent coverage$/).textContent()).toEqual(firstSbPercentageText); + + // Act - Run ALL tests again + await page.getByLabel("Start Component tests").click(); + + // Arrange - Wait for tests to finish + await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); + + // Assert - Coverage percentage is updated to reflect the new coverage + const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); + expect(updatedSbPercentageText).toMatch(/^\d+\s%$/); + const updatedSbPercentage = Number.parseInt(updatedSbPercentageText!.replace(' %', '') ?? ''); + expect(updatedSbPercentage).toBeGreaterThanOrEqual(0); + expect(updatedSbPercentage).toBeLessThan(firstSbPercentage); + } finally { + // Cleanup - Remove uncovered lines from Button.tsx + await fs.writeFile(BUTTON_COMPONENT_PATH, initialButtonContent); + } }); }); From bc5235755602ffc358e5aabf815f7f3025bdacd2 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 21:32:15 +0100 Subject: [PATCH 017/169] fix story types --- .../react/stories/AddonTest.stories.tsx | 21 +++++++++---------- .../react/stories/OtherComponent.stories.tsx | 17 ++++++++------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx index 8a61b2b89f1d..14c5835a11c1 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx @@ -1,7 +1,6 @@ import { expect } from '@storybook/test'; import { Meta, type StoryObj } from '@storybook/react' import { instrument } from '@storybook/instrumenter' -import type { StoryAnnotations } from 'storybook/internal/types'; declare global { // eslint-disable-next-line no-var @@ -23,7 +22,7 @@ const { pass } = instrument({ pass: async () => {}, }, { intercept: true }) -export const ExpectedFailure = { +export const ExpectedFailure: Story = { args: { forceFailure: false, }, @@ -33,30 +32,30 @@ export const ExpectedFailure = { throw new Error('Expected failure'); } } -} satisfies StoryAnnotations; +}; -export const ExpectedSuccess = { +export const ExpectedSuccess: Story = { play: async () => { await pass(); } -} satisfies StoryAnnotations; +}; -export const LongRunning = { +export const LongRunning: Story = { loaders: [async () => new Promise((resolve) => setTimeout(resolve, 800))], -} satisfies StoryAnnotations; +}; // Tests will pass in browser, but fail in CLI -export const MismatchFailure = { +export const MismatchFailure: Story = { play: async () => { await pass(); if(!globalThis.__vitest_browser__) { throw new Error('Expected failure'); } } -} satisfies StoryAnnotations; +}; // Tests will fail in browser, but pass in CLI -export const MismatchSuccess = { +export const MismatchSuccess: Story = { play: async () => { await pass(); if(globalThis.__vitest_browser__) { @@ -64,7 +63,7 @@ export const MismatchSuccess = { } }, tags: ['fail-on-purpose'], -} satisfies StoryAnnotations; +}; export const PreviewHeadTest: Story = { play: async () => { diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx index 98ef7e00065a..e96da836ecd2 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx @@ -1,5 +1,4 @@ -import { Meta } from '@storybook/react' -import type { StoryAnnotations } from 'storybook/internal/types'; +import { Meta, type StoryObj } from '@storybook/react' declare global { // eslint-disable-next-line no-var @@ -8,17 +7,21 @@ declare global { const Component = () => -export default { +const meta = { title: 'Addons/Group/Other', component: Component, } as Meta; -export const Passes = { -} satisfies StoryAnnotations; +export default meta; -export const Fails = { +type Story = StoryObj; + +export const Passes: Story = { +}; + +export const Fails: Story = { play: async () => { throw new Error('Expected failure'); }, tags: ['fail-on-purpose'], -} satisfies StoryAnnotations; +}; From 87fa9ba1d37da326b5988b01b8b75954a83d30f5 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 21:34:00 +0100 Subject: [PATCH 018/169] better comments --- .../react/e2e-tests/component-testing.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts index 6b76638c669c..3af1ed632739 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts @@ -453,7 +453,7 @@ test.describe("component testing", () => { await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 }); await page.click('body'); - // Assert - Coverage percentage is unchanged + // Assert - Coverage percentage is unchanged because Focused Tests shouldn't collect coverage console.log('LOG: firstSbPercentageText', firstSbPercentageText); console.log('LOG: secondSbPercentageText', await page.getByLabel(/percent coverage$/).textContent()); expect(await page.getByLabel(/percent coverage$/).textContent()).toEqual(firstSbPercentageText); @@ -464,7 +464,7 @@ test.describe("component testing", () => { // Arrange - Wait for tests to finish await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); - // Assert - Coverage percentage is updated to reflect the new coverage + // Assert - Coverage percentage is now updated because running all tests automatically re-enables coverage const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); expect(updatedSbPercentageText).toMatch(/^\d+\s%$/); const updatedSbPercentage = Number.parseInt(updatedSbPercentageText!.replace(' %', '') ?? ''); From 23f496718b96275cba25d7f783c007ffb7036f2a Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 5 Dec 2024 21:35:39 +0100 Subject: [PATCH 019/169] add non-failing-vitest to ci --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 550dc9e6b994..f3b36dbc216f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -757,6 +757,10 @@ jobs: name: Run E2E tests command: yarn playwright-e2e working_directory: test-storybooks/portable-stories-kitchen-sink/react + - run: + name: Run Vitest + command: yarn vitest-non-failing-tests + working_directory: test-storybooks/portable-stories-kitchen-sink/react - store_test_results: path: test-results - store_artifacts: From a91b0ba3a6c2f885d8f965e23cbd8c7bfdb42f11 Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Tue, 1 Oct 2024 11:47:43 +0200 Subject: [PATCH 020/169] feat: add code snippet panel to single story view mode --- code/addons/docs/package.json | 13 ++++++- code/addons/docs/src/manager.tsx | 38 +++++++++++++++++++ code/addons/essentials/package.json | 5 +++ code/addons/essentials/src/docs/manager.ts | 2 + code/addons/essentials/src/index.ts | 2 +- .../vue3/src/docs/sourceDecorator.ts | 6 +-- 6 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 code/addons/docs/src/manager.tsx create mode 100644 code/addons/essentials/src/docs/manager.ts diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index f5834a822026..fbfa158c43d1 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -71,7 +71,12 @@ "./angular": "./angular/index.js", "./angular/index.js": "./angular/index.js", "./web-components/index.js": "./web-components/index.js", - "./package.json": "./package.json" + "./package.json": "./package.json", + "./manager": { + "types": "./dist/manager.d.ts", + "import": "./dist/manager.mjs", + "require": "./dist/manager.js" + } }, "main": "dist/index.js", "module": "dist/index.mjs", @@ -129,7 +134,11 @@ "./src/preview.ts", "./src/blocks.ts", "./src/shims/mdx-react-shim.ts", - "./src/mdx-loader.ts" + "./src/mdx-loader.ts", + "./src/manager.tsx" + ], + "managerEntries": [ + "./src/manager.tsx" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx new file mode 100644 index 000000000000..9b8cdafb7799 --- /dev/null +++ b/code/addons/docs/src/manager.tsx @@ -0,0 +1,38 @@ +import React from 'react'; + +import { AddonPanel, type SyntaxHighlighterFormatTypes } from 'storybook/internal/components'; +import { ADDON_ID, PANEL_ID, PARAM_KEY, SNIPPET_RENDERED } from 'storybook/internal/docs-tools'; +import { addons, types, useAddonState, useChannel } from 'storybook/internal/manager-api'; + +import { Source } from '@storybook/blocks'; + +addons.register(ADDON_ID, (api) => { + addons.add(PANEL_ID, { + title: 'Code', + type: types.PANEL, + paramKey: PARAM_KEY, + match: ({ viewMode }) => viewMode === 'story', + render: ({ active }) => { + const [codeSnippet, setSourceCode] = useAddonState<{ + source: string; + format: SyntaxHighlighterFormatTypes; + }>(ADDON_ID, { + source: '', + format: 'html', + }); + + useChannel({ + [SNIPPET_RENDERED]: ({ source, format }) => { + setSourceCode({ source, format: format ?? 'html' }); + console.log('SOURCE CODE CHANGED', codeSnippet.source); + }, + }); + + return ( + + + + ); + }, + }); +}); diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 4f7ad700ec0d..73e1cbcb6f9f 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -40,6 +40,7 @@ }, "./backgrounds/manager": "./dist/backgrounds/manager.js", "./controls/manager": "./dist/controls/manager.js", + "./docs/manager": "./dist/docs/manager.js", "./docs/preview": { "types": "./dist/docs/preview.d.ts", "import": "./dist/docs/preview.mjs", @@ -114,10 +115,14 @@ "./src/docs/preset.ts", "./src/docs/mdx-react-shim.ts" ], + "entries": [ + "./src/docs/manager.ts" + ], "managerEntries": [ "./src/actions/manager.ts", "./src/backgrounds/manager.ts", "./src/controls/manager.ts", + "./src/docs/manager.ts", "./src/measure/manager.ts", "./src/outline/manager.ts", "./src/toolbars/manager.ts", diff --git a/code/addons/essentials/src/docs/manager.ts b/code/addons/essentials/src/docs/manager.ts new file mode 100644 index 000000000000..6101f7d79261 --- /dev/null +++ b/code/addons/essentials/src/docs/manager.ts @@ -0,0 +1,2 @@ +// @ts-expect-error (no types needed for this) +export * from '@storybook/addon-docs/manager'; diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index 5809420bc1b8..a72554227ba2 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -88,9 +88,9 @@ export function addons(options: PresetOptions) { // NOTE: The order of these addons is important. return [ - 'docs', 'controls', 'actions', + 'docs', 'backgrounds', 'viewport', 'toolbars', diff --git a/code/renderers/vue3/src/docs/sourceDecorator.ts b/code/renderers/vue3/src/docs/sourceDecorator.ts index 7eb8734305af..cc2f922f63f1 100644 --- a/code/renderers/vue3/src/docs/sourceDecorator.ts +++ b/code/renderers/vue3/src/docs/sourceDecorator.ts @@ -107,7 +107,6 @@ ${template}`; * Checks if the source code generation should be skipped for the given Story context. Will be true * if one of the following is true: * - * - View mode is not "docs" * - Story is no arg story * - Story has set custom source code via parameters.docs.source.code * - Story has set source type to "code" via parameters.docs.source.type @@ -120,13 +119,10 @@ export const shouldSkipSourceCodeGeneration = (context: StoryContext): boolean = } const isArgsStory = context?.parameters.__isArgsStory; - const isDocsViewMode = context?.viewMode === 'docs'; // never render if the user is forcing the block to render code, or // if the user provides code, or if it's not an args story. - return ( - !isDocsViewMode || !isArgsStory || sourceParams?.code || sourceParams?.type === SourceType.CODE - ); + return !isArgsStory || sourceParams?.code || sourceParams?.type === SourceType.CODE; }; /** From 107c40bf71a437b72f7c1d1755e10da0b7926a04 Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Tue, 1 Oct 2024 12:03:33 +0200 Subject: [PATCH 021/169] remove console log --- code/addons/docs/src/manager.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx index 9b8cdafb7799..ed3823ed4492 100644 --- a/code/addons/docs/src/manager.tsx +++ b/code/addons/docs/src/manager.tsx @@ -24,7 +24,6 @@ addons.register(ADDON_ID, (api) => { useChannel({ [SNIPPET_RENDERED]: ({ source, format }) => { setSourceCode({ source, format: format ?? 'html' }); - console.log('SOURCE CODE CHANGED', codeSnippet.source); }, }); From a283cea33680e379625bbc57dbd8b52c46c9ddcf Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Mon, 25 Nov 2024 10:04:25 +0100 Subject: [PATCH 022/169] use dark theme --- code/addons/docs/src/manager.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx index ed3823ed4492..212956b99ebb 100644 --- a/code/addons/docs/src/manager.tsx +++ b/code/addons/docs/src/manager.tsx @@ -29,7 +29,7 @@ addons.register(ADDON_ID, (api) => { return ( - + ); }, From 1fa0e7da9125544912704155fcea4d8e1b115b0f Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Mon, 25 Nov 2024 11:15:44 +0100 Subject: [PATCH 023/169] feat: support `docs.source.addonPanel` parameter --- code/addons/docs/src/manager.tsx | 37 ++++++++++++++++++++++++++++- code/addons/essentials/src/index.ts | 2 +- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx index 212956b99ebb..09c371be238b 100644 --- a/code/addons/docs/src/manager.tsx +++ b/code/addons/docs/src/manager.tsx @@ -1,12 +1,27 @@ import React from 'react'; import { AddonPanel, type SyntaxHighlighterFormatTypes } from 'storybook/internal/components'; +import { FORCE_RE_RENDER, PRELOAD_ENTRIES } from 'storybook/internal/core-events'; import { ADDON_ID, PANEL_ID, PARAM_KEY, SNIPPET_RENDERED } from 'storybook/internal/docs-tools'; import { addons, types, useAddonState, useChannel } from 'storybook/internal/manager-api'; import { Source } from '@storybook/blocks'; -addons.register(ADDON_ID, (api) => { +addons.register(ADDON_ID, async (api) => { + // at this point, the parameters are not yet defined so we can not check whether the addon panel should + // be added or not. The "PRELOAD_ENTRIES" event seems to be the earliest point in time where the parameters + // are available + const isDisabled = await new Promise((resolve) => { + api.once(PRELOAD_ENTRIES, () => { + const parameter = api.getCurrentParameter(PARAM_KEY); + resolve(shouldDisableAddonPanel(parameter)); + }); + }); + + if (isDisabled) { + return; + } + addons.add(PANEL_ID, { title: 'Code', type: types.PANEL, @@ -34,4 +49,24 @@ addons.register(ADDON_ID, (api) => { ); }, }); + + api.emit(FORCE_RE_RENDER); }); + +const isObject = (value: unknown): value is object => { + return value != null && typeof value === 'object'; +}; + +/** + * Checks whether the addon panel should be disabled by checking the parameter.source.addonPanel + * property. + */ +const shouldDisableAddonPanel = (parameter: unknown) => { + return ( + isObject(parameter) && + 'source' in parameter && + isObject(parameter.source) && + 'addonPanel' in parameter.source && + parameter.source.addonPanel === false + ); +}; diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index a72554227ba2..5809420bc1b8 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -88,9 +88,9 @@ export function addons(options: PresetOptions) { // NOTE: The order of these addons is important. return [ + 'docs', 'controls', 'actions', - 'docs', 'backgrounds', 'viewport', 'toolbars', From 01e11e5bb9f0e8fa8626d1c8a98230210af93670 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 3 Dec 2024 22:25:15 +0800 Subject: [PATCH 024/169] Addon-docs: Fix and document source panel disabling --- MIGRATION.md | 20 ++++++++- code/addons/docs/src/manager.tsx | 42 ++----------------- .../stories/sourcePanel/index.stories.tsx | 15 +++++++ 3 files changed, 38 insertions(+), 39 deletions(-) create mode 100644 code/addons/docs/template/stories/sourcePanel/index.stories.tsx diff --git a/MIGRATION.md b/MIGRATION.md index 2e2e735fb21f..07aecbbe3973 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,5 +1,7 @@

Migration

+- [From version 8.4.x to 8.5.x](#from-version-84x-to-85x) + - [Added source code pnael to docs](#added-source-code-pnael-to-docs) - [From version 8.2.x to 8.3.x](#from-version-82x-to-83x) - [Removed `experimental_SIDEBAR_BOTTOM` and deprecated `experimental_SIDEBAR_TOP` addon types](#removed-experimental_sidebar_bottom-and-deprecated-experimental_sidebar_top-addon-types) - [New parameters format for addon backgrounds](#new-parameters-format-for-addon-backgrounds) @@ -167,7 +169,7 @@ - [Angular: Drop support for calling Storybook directly](#angular-drop-support-for-calling-storybook-directly) - [Angular: Application providers and ModuleWithProviders](#angular-application-providers-and-modulewithproviders) - [Angular: Removed legacy renderer](#angular-removed-legacy-renderer) - - [Angular: initializer functions](#angular-initializer-functions) + - [Angular: Initializer functions](#angular-initializer-functions) - [Next.js: use the `@storybook/nextjs` framework](#nextjs-use-the-storybooknextjs-framework) - [SvelteKit: needs the `@storybook/sveltekit` framework](#sveltekit-needs-the-storybooksveltekit-framework) - [Vue3: replaced app export with setup](#vue3-replaced-app-export-with-setup) @@ -419,6 +421,22 @@ - [Packages renaming](#packages-renaming) - [Deprecated embedded addons](#deprecated-embedded-addons) +## From version 8.4.x to 8.5.x + +### Added source code pnael to docs + +Starting in 8.5, Storybook Docs (`@storybook/addon-docs`) automatically adds a new addon panel to stories that displays a source snippet beneath each story. This works similarly to the existing [source snippet doc block](https://storybook.js.org/docs/writing-docs/doc-blocks#source), but in the story view. It is intended to replace the [Storysource addon](https://storybook.js.org/addons/@storybook/addon-storysource). + +If you wish to disable this panel globally, add the following line to your `.storybook/preview.js` project configuration. You can also selectively disable/enable at the story level. + +```js +export default { + parameters: { + docsSourcePanel: { disable: true }, + }, +}; +``` + ## From version 8.2.x to 8.3.x ### Removed `experimental_SIDEBAR_BOTTOM` and deprecated `experimental_SIDEBAR_TOP` addon types diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx index 09c371be238b..fdbe0375d369 100644 --- a/code/addons/docs/src/manager.tsx +++ b/code/addons/docs/src/manager.tsx @@ -1,31 +1,17 @@ import React from 'react'; import { AddonPanel, type SyntaxHighlighterFormatTypes } from 'storybook/internal/components'; -import { FORCE_RE_RENDER, PRELOAD_ENTRIES } from 'storybook/internal/core-events'; -import { ADDON_ID, PANEL_ID, PARAM_KEY, SNIPPET_RENDERED } from 'storybook/internal/docs-tools'; +import { ADDON_ID, PANEL_ID, SNIPPET_RENDERED } from 'storybook/internal/docs-tools'; import { addons, types, useAddonState, useChannel } from 'storybook/internal/manager-api'; import { Source } from '@storybook/blocks'; -addons.register(ADDON_ID, async (api) => { - // at this point, the parameters are not yet defined so we can not check whether the addon panel should - // be added or not. The "PRELOAD_ENTRIES" event seems to be the earliest point in time where the parameters - // are available - const isDisabled = await new Promise((resolve) => { - api.once(PRELOAD_ENTRIES, () => { - const parameter = api.getCurrentParameter(PARAM_KEY); - resolve(shouldDisableAddonPanel(parameter)); - }); - }); - - if (isDisabled) { - return; - } - +addons.register(ADDON_ID, (api) => { addons.add(PANEL_ID, { title: 'Code', type: types.PANEL, - paramKey: PARAM_KEY, + // disable this with `docsSourcePanel: { disable: true }` + paramKey: 'docsSourcePanel', match: ({ viewMode }) => viewMode === 'story', render: ({ active }) => { const [codeSnippet, setSourceCode] = useAddonState<{ @@ -49,24 +35,4 @@ addons.register(ADDON_ID, async (api) => { ); }, }); - - api.emit(FORCE_RE_RENDER); }); - -const isObject = (value: unknown): value is object => { - return value != null && typeof value === 'object'; -}; - -/** - * Checks whether the addon panel should be disabled by checking the parameter.source.addonPanel - * property. - */ -const shouldDisableAddonPanel = (parameter: unknown) => { - return ( - isObject(parameter) && - 'source' in parameter && - isObject(parameter.source) && - 'addonPanel' in parameter.source && - parameter.source.addonPanel === false - ); -}; diff --git a/code/addons/docs/template/stories/sourcePanel/index.stories.tsx b/code/addons/docs/template/stories/sourcePanel/index.stories.tsx new file mode 100644 index 000000000000..dd4d2208fe6e --- /dev/null +++ b/code/addons/docs/template/stories/sourcePanel/index.stories.tsx @@ -0,0 +1,15 @@ +export default { + component: globalThis.Components.Button, + tags: ['autodocs'], + parameters: { + chromatic: { disable: true }, + docsSourcePanel: { disable: true }, + }, +}; + +export const One = { args: { label: 'One' } }; +export const Two = { args: { label: 'Two' } }; +export const WithSource = { + args: { label: 'Three' }, + parameters: { docsSourcePanel: { disable: false } }, +}; From 2be176923b7a2e00216d26b61142704851e82a92 Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Wed, 4 Dec 2024 08:10:31 +0100 Subject: [PATCH 025/169] fix typos --- MIGRATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 07aecbbe3973..db4d3b2d15c2 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,7 +1,7 @@

Migration

- [From version 8.4.x to 8.5.x](#from-version-84x-to-85x) - - [Added source code pnael to docs](#added-source-code-pnael-to-docs) + - [Added source code panel to docs](#added-source-code-panel-to-docs) - [From version 8.2.x to 8.3.x](#from-version-82x-to-83x) - [Removed `experimental_SIDEBAR_BOTTOM` and deprecated `experimental_SIDEBAR_TOP` addon types](#removed-experimental_sidebar_bottom-and-deprecated-experimental_sidebar_top-addon-types) - [New parameters format for addon backgrounds](#new-parameters-format-for-addon-backgrounds) @@ -423,7 +423,7 @@ ## From version 8.4.x to 8.5.x -### Added source code pnael to docs +### Added source code panel to docs Starting in 8.5, Storybook Docs (`@storybook/addon-docs`) automatically adds a new addon panel to stories that displays a source snippet beneath each story. This works similarly to the existing [source snippet doc block](https://storybook.js.org/docs/writing-docs/doc-blocks#source), but in the story view. It is intended to replace the [Storysource addon](https://storybook.js.org/addons/@storybook/addon-storysource). From 33ce8f93c8e9039c4566cc3e2ce484579282040d Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Wed, 4 Dec 2024 10:18:25 +0100 Subject: [PATCH 026/169] move docs source panel order --- code/addons/essentials/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index 5809420bc1b8..a72554227ba2 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -88,9 +88,9 @@ export function addons(options: PresetOptions) { // NOTE: The order of these addons is important. return [ - 'docs', 'controls', 'actions', + 'docs', 'backgrounds', 'viewport', 'toolbars', From db146c34dcc878e321b167bdd743e1ec6d396ce9 Mon Sep 17 00:00:00 2001 From: Lars Rickert Date: Wed, 4 Dec 2024 10:54:04 +0100 Subject: [PATCH 027/169] fix react code snippet format --- code/addons/docs/src/manager.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/docs/src/manager.tsx b/code/addons/docs/src/manager.tsx index fdbe0375d369..a02fe22f0764 100644 --- a/code/addons/docs/src/manager.tsx +++ b/code/addons/docs/src/manager.tsx @@ -24,7 +24,7 @@ addons.register(ADDON_ID, (api) => { useChannel({ [SNIPPET_RENDERED]: ({ source, format }) => { - setSourceCode({ source, format: format ?? 'html' }); + setSourceCode({ source, format }); }, }); From d1441aadb8f5c249ae9d9cac4e966d6f11504df7 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 6 Dec 2024 12:51:41 +0100 Subject: [PATCH 028/169] fix vitest/ui dep --- .../portable-stories-kitchen-sink/react/package.json | 2 +- .../portable-stories-kitchen-sink/react/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index e7d4dae6cd83..36a84a8515e2 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -111,7 +111,7 @@ "@vitejs/plugin-react": "^4.2.1", "@vitest/browser": "^2.1.6", "@vitest/coverage-v8": "^2.1.6", - "@vitest/ui": "2.1.8", + "@vitest/ui": "^2.1.6", "cypress": "^13.6.4", "eslint": "^8.56.0", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 972244bee296..803ba3f2e727 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1853,7 +1853,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.17 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=0b7853&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=939a10&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/a0daef8f8313e217ce54be97eced7e71d7442f876935df137624056202fe3facc2b1502f0540058a80def68abd1a3657ddcdd8a3bfd91e29ef439403a7c306e4 + checksum: 10/2213e98cd698c288428388880ea3cc04ca3722225ae4c2855621326e7770756982b45f7648007e7319773f322d771293ff56c22cf39f6abd517f2ae6b7e5c746 languageName: node linkType: hard @@ -2846,7 +2846,7 @@ __metadata: languageName: node linkType: hard -"@vitest/ui@npm:2.1.8": +"@vitest/ui@npm:^2.1.6": version: 2.1.8 resolution: "@vitest/ui@npm:2.1.8" dependencies: @@ -7475,7 +7475,7 @@ __metadata: "@vitejs/plugin-react": "npm:^4.2.1" "@vitest/browser": "npm:^2.1.6" "@vitest/coverage-v8": "npm:^2.1.6" - "@vitest/ui": "npm:2.1.8" + "@vitest/ui": "npm:^2.1.6" cypress: "npm:^13.6.4" eslint: "npm:^8.56.0" eslint-plugin-react-hooks: "npm:^4.6.0" From b5b65b071479a8d68cd97b2d93c73d31422f5736 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 6 Dec 2024 13:18:51 +0100 Subject: [PATCH 029/169] simplify coverage+focus test --- .../react/e2e-tests/component-testing.spec.ts | 77 +++++++------------ .../react/yarn.lock | 4 +- 2 files changed, 29 insertions(+), 52 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts index 3af1ed632739..b413a9f3a834 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts @@ -320,7 +320,7 @@ test.describe("component testing", () => { await sidebarContextMenu.getByLabel('Start Component tests').click(); // Assert - Only one test is running and reported - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 }); await expect(sidebarContextMenu.getByLabel('status: passed')).toHaveCount(1); await page.click('body'); await expect(page.locator('#storybook-explorer-menu').getByRole('status', { name: 'Test status: success' })).toHaveCount(1); @@ -352,7 +352,7 @@ test.describe("component testing", () => { await sidebarContextMenu.getByLabel('Start Component tests').click(); // Assert - 5 tests are running and reported - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 6 test'); + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 6 test', { timeout: 30000 }); // Assert - 1 failing test shows as a failed status await expect(sidebarContextMenu.getByText('2 stories with errors')).toBeVisible(); await expect(sidebarContextMenu.getByLabel('status: failed')).toHaveCount(1); @@ -417,7 +417,7 @@ test.describe("component testing", () => { .getByRole("button", { name: "foo" }); await expect(storyElement).toBeVisible({ timeout: 30000 }); - // Act - Enable coverage and run ALL tests + // Act - Enable coverage await page.getByLabel("Open settings for Component tests").click(); await page.getByLabel("Coverage").click(); await expect(page.getByText("Settings updated")).toBeVisible({ timeout: 3000 }); @@ -425,55 +425,32 @@ test.describe("component testing", () => { // Wait for Vitest to have (re)started await page.waitForTimeout(2000); + // Act - Open sidebar context menu and start focused test + await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); + await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); + const sidebarContextMenu = page.getByTestId('tooltip'); + await sidebarContextMenu.getByLabel('Start Component tests').click(); + + // Arrange - Wait for test to finish and unfocus sidebar context menu + await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 }); + await page.click('body'); + + // Assert - Coverage is not shown because Focused Tests shouldn't collect coverage + await expect(page.getByLabel("Open coverage report")).not.toBeVisible(); + + // Act - Run ALL tests await page.getByLabel("Start Component tests").click(); - - // Assert - Coverage report is collected and shown + + // Arrange - Wait for tests to finish + await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); + + // Assert - Coverage percentage is now collected and shown because running all tests automatically re-enables coverage await expect(page.getByLabel("Open coverage report")).toBeVisible({ timeout: 30000 }); - const firstSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); - expect(firstSbPercentageText).toMatch(/^\d+\s%$/); - const firstSbPercentage = Number.parseInt(firstSbPercentageText!.replace(' %', '') ?? ''); - - // Arrange - Add uncovered lines to Button.tsx to force coverage to drop - const initialButtonContent = (await fs.readFile(BUTTON_COMPONENT_PATH)).toString(); - try { - await fs.writeFile(BUTTON_COMPONENT_PATH, [initialButtonContent, - `const voidFn = () => {}; - - export const uncovered = () => { - ${Array.from({ length: 300 }).map(() => 'voidFn();').join('\n ')} - };`].join('\n')); - - // Act - Open sidebar context menu and start focused test - await page.locator('[data-item-id="example-button--csf-3-primary"]').hover(); - await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click(); - const sidebarContextMenu = page.getByTestId('tooltip'); - await sidebarContextMenu.getByLabel('Start Component tests').click(); - - // Arrange - Wait for test to finish and unfocus sidebar context menu - await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 }); - await page.click('body'); - - // Assert - Coverage percentage is unchanged because Focused Tests shouldn't collect coverage - console.log('LOG: firstSbPercentageText', firstSbPercentageText); - console.log('LOG: secondSbPercentageText', await page.getByLabel(/percent coverage$/).textContent()); - expect(await page.getByLabel(/percent coverage$/).textContent()).toEqual(firstSbPercentageText); - - // Act - Run ALL tests again - await page.getByLabel("Start Component tests").click(); - - // Arrange - Wait for tests to finish - await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 }); - - // Assert - Coverage percentage is now updated because running all tests automatically re-enables coverage - const updatedSbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); - expect(updatedSbPercentageText).toMatch(/^\d+\s%$/); - const updatedSbPercentage = Number.parseInt(updatedSbPercentageText!.replace(' %', '') ?? ''); - expect(updatedSbPercentage).toBeGreaterThanOrEqual(0); - expect(updatedSbPercentage).toBeLessThan(firstSbPercentage); - } finally { - // Cleanup - Remove uncovered lines from Button.tsx - await fs.writeFile(BUTTON_COMPONENT_PATH, initialButtonContent); - } + const sbPercentageText = await page.getByLabel(/percent coverage$/).textContent(); + expect(sbPercentageText).toMatch(/^\d+\s%$/); + const sbPercentage = Number.parseInt(sbPercentageText!.replace(' %', '') ?? ''); + expect(sbPercentage).toBeGreaterThanOrEqual(0); + expect(sbPercentage).toBeLessThanOrEqual(100); }); }); diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 803ba3f2e727..4a6ec1318240 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1853,7 +1853,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.17 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=939a10&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=9e5f6a&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/2213e98cd698c288428388880ea3cc04ca3722225ae4c2855621326e7770756982b45f7648007e7319773f322d771293ff56c22cf39f6abd517f2ae6b7e5c746 + checksum: 10/73f733600a22ab37cea12e80aa69d42933ff6f75c36306b4d09e7887ba31aeeb35bc6af1fd37fbbfa1f9003d65d4413ed67f49851d899a5f13e5178260570103 languageName: node linkType: hard From 1b86bf39bfdd92050ce9bc0568756562a66f3d44 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 6 Dec 2024 13:29:05 +0100 Subject: [PATCH 030/169] revert vitest upgrades --- code/addons/test/package.json | 10 +- code/lib/instrumenter/package.json | 4 +- code/lib/test/package.json | 6 +- code/package.json | 10 +- code/yarn.lock | 112 +++++++++++------- scripts/package.json | 5 +- scripts/yarn.lock | 8 ++ .../react/package.json | 9 +- .../react/yarn.lock | 81 ++++++------- 9 files changed, 142 insertions(+), 103 deletions(-) diff --git a/code/addons/test/package.json b/code/addons/test/package.json index 4941f6cc58e1..cd7a737260b7 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.5.0-alpha.17", + "version": "8.5.0-alpha.18", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", @@ -95,15 +95,14 @@ "@types/istanbul-lib-report": "^3.0.3", "@types/node": "^22.0.0", "@types/semver": "^7", - "@vitest/browser": "^2.1.6", - "@vitest/runner": "^2.1.6", + "@vitest/browser": "^2.1.3", + "@vitest/runner": "^2.1.3", "ansi-to-html": "^0.7.2", "boxen": "^8.0.1", "es-toolkit": "^1.22.0", "execa": "^8.0.1", "find-up": "^7.0.0", "formik": "^2.2.9", - "glob": "^10.0.0", "istanbul-lib-report": "^3.0.1", "pathe": "^1.1.2", "picocolors": "^1.1.0", @@ -112,9 +111,10 @@ "semver": "^7.6.3", "slash": "^5.0.0", "strip-ansi": "^7.1.0", + "tinyglobby": "^0.2.10", "ts-dedent": "^2.2.0", "typescript": "^5.3.2", - "vitest": "^2.1.6" + "vitest": "^2.1.3" }, "peerDependencies": { "@vitest/browser": "^2.1.1", diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 612bf908b6d8..a987140baea3 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.5.0-alpha.17", + "version": "8.5.0-alpha.18", "description": "", "keywords": [ "storybook" @@ -44,7 +44,7 @@ }, "dependencies": { "@storybook/global": "^5.0.0", - "@vitest/utils": "^2.1.6" + "@vitest/utils": "^2.1.1" }, "devDependencies": { "typescript": "^5.3.2" diff --git a/code/lib/test/package.json b/code/lib/test/package.json index c0c821e62da7..6d044f1b8708 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.5.0-alpha.17", + "version": "8.5.0-alpha.18", "description": "", "keywords": [ "storybook" @@ -49,8 +49,8 @@ "@testing-library/dom": "10.4.0", "@testing-library/jest-dom": "6.5.0", "@testing-library/user-event": "14.5.2", - "@vitest/expect": "2.1.6", - "@vitest/spy": "2.1.6" + "@vitest/expect": "2.0.5", + "@vitest/spy": "2.0.5" }, "devDependencies": { "chai": "^5.1.1", diff --git a/code/package.json b/code/package.json index e0c603654a65..5cac1d039ea0 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.5.0-alpha.17", + "version": "8.5.0-alpha.18", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -178,9 +178,9 @@ "@typescript-eslint/parser": "^6.18.1", "@vitejs/plugin-react": "^4.3.2", "@vitejs/plugin-vue": "^4.4.0", - "@vitest/browser": "^2.1.6", - "@vitest/coverage-istanbul": "^2.1.6", - "@vitest/coverage-v8": "^2.1.6", + "@vitest/browser": "^2.1.3", + "@vitest/coverage-istanbul": "^2.1.3", + "@vitest/coverage-v8": "^2.1.3", "create-storybook": "workspace:*", "cross-env": "^7.0.3", "danger": "^12.3.3", @@ -221,7 +221,7 @@ "util": "^0.12.4", "vite": "^4.0.0", "vite-plugin-inspect": "^0.8.5", - "vitest": "^2.1.6", + "vitest": "^2.1.3", "wait-on": "^7.0.1" }, "dependenciesMeta": { diff --git a/code/yarn.lock b/code/yarn.lock index 7814cfa6cc79..f9dba44953be 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6613,15 +6613,14 @@ __metadata: "@types/istanbul-lib-report": "npm:^3.0.3" "@types/node": "npm:^22.0.0" "@types/semver": "npm:^7" - "@vitest/browser": "npm:^2.1.6" - "@vitest/runner": "npm:^2.1.6" + "@vitest/browser": "npm:^2.1.3" + "@vitest/runner": "npm:^2.1.3" ansi-to-html: "npm:^0.7.2" boxen: "npm:^8.0.1" es-toolkit: "npm:^1.22.0" execa: "npm:^8.0.1" find-up: "npm:^7.0.0" formik: "npm:^2.2.9" - glob: "npm:^10.0.0" istanbul-lib-report: "npm:^3.0.1" pathe: "npm:^1.1.2" picocolors: "npm:^1.1.0" @@ -6632,9 +6631,10 @@ __metadata: semver: "npm:^7.6.3" slash: "npm:^5.0.0" strip-ansi: "npm:^7.1.0" + tinyglobby: "npm:^0.2.10" ts-dedent: "npm:^2.2.0" typescript: "npm:^5.3.2" - vitest: "npm:^2.1.6" + vitest: "npm:^2.1.3" peerDependencies: "@vitest/browser": ^2.1.1 "@vitest/runner": ^2.1.1 @@ -6756,7 +6756,7 @@ __metadata: resolution: "@storybook/instrumenter@workspace:lib/instrumenter" dependencies: "@storybook/global": "npm:^5.0.0" - "@vitest/utils": "npm:^2.1.6" + "@vitest/utils": "npm:^2.1.1" typescript: "npm:^5.3.2" peerDependencies: storybook: "workspace:^" @@ -7311,9 +7311,9 @@ __metadata: "@typescript-eslint/parser": "npm:^6.18.1" "@vitejs/plugin-react": "npm:^4.3.2" "@vitejs/plugin-vue": "npm:^4.4.0" - "@vitest/browser": "npm:^2.1.6" - "@vitest/coverage-istanbul": "npm:^2.1.6" - "@vitest/coverage-v8": "npm:^2.1.6" + "@vitest/browser": "npm:^2.1.3" + "@vitest/coverage-istanbul": "npm:^2.1.3" + "@vitest/coverage-v8": "npm:^2.1.3" create-storybook: "workspace:*" cross-env: "npm:^7.0.3" danger: "npm:^12.3.3" @@ -7354,7 +7354,7 @@ __metadata: util: "npm:^0.12.4" vite: "npm:^4.0.0" vite-plugin-inspect: "npm:^0.8.5" - vitest: "npm:^2.1.6" + vitest: "npm:^2.1.3" wait-on: "npm:^7.0.1" dependenciesMeta: ejs: @@ -7539,8 +7539,8 @@ __metadata: "@testing-library/dom": "npm:10.4.0" "@testing-library/jest-dom": "npm:6.5.0" "@testing-library/user-event": "npm:14.5.2" - "@vitest/expect": "npm:2.1.6" - "@vitest/spy": "npm:2.1.6" + "@vitest/expect": "npm:2.0.5" + "@vitest/spy": "npm:2.0.5" chai: "npm:^5.1.1" tinyspy: "npm:^3.0.0" ts-dedent: "npm:^2.2.0" @@ -9165,7 +9165,7 @@ __metadata: languageName: node linkType: hard -"@vitest/browser@npm:^2.1.6": +"@vitest/browser@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/browser@npm:2.1.8" dependencies: @@ -9193,7 +9193,7 @@ __metadata: languageName: node linkType: hard -"@vitest/coverage-istanbul@npm:^2.1.6": +"@vitest/coverage-istanbul@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/coverage-istanbul@npm:2.1.8" dependencies: @@ -9213,7 +9213,7 @@ __metadata: languageName: node linkType: hard -"@vitest/coverage-v8@npm:^2.1.6": +"@vitest/coverage-v8@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/coverage-v8@npm:2.1.8" dependencies: @@ -9239,15 +9239,15 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/expect@npm:2.1.6" +"@vitest/expect@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/expect@npm:2.0.5" dependencies: - "@vitest/spy": "npm:2.1.6" - "@vitest/utils": "npm:2.1.6" - chai: "npm:^5.1.2" + "@vitest/spy": "npm:2.0.5" + "@vitest/utils": "npm:2.0.5" + chai: "npm:^5.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/86327692f03b2ec6895486b118f25e1a141749c31ba671d253da4e33cf81db81f40755198ac9b46616155a8b74765d0ab15b8080041dbe139c83a9a0690004a2 + checksum: 10c0/08cb1b0f106d16a5b60db733e3d436fa5eefc68571488eb570dfe4f599f214ab52e4342273b03dbe12331cc6c0cdc325ac6c94f651ad254cd62f3aa0e3d185aa languageName: node linkType: hard @@ -9263,6 +9263,18 @@ __metadata: languageName: node linkType: hard +"@vitest/expect@patch:@vitest/expect@npm%3A2.0.5#~/.yarn/patches/@vitest-expect-npm-2.0.5-8933466cce.patch": + version: 2.0.5 + resolution: "@vitest/expect@patch:@vitest/expect@npm%3A2.0.5#~/.yarn/patches/@vitest-expect-npm-2.0.5-8933466cce.patch::version=2.0.5&hash=368591" + dependencies: + "@vitest/spy": "npm:2.0.5" + "@vitest/utils": "npm:2.0.5" + chai: "npm:^5.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: 10c0/0834adbe2c7094277adf3a45aa20fece84ca3b381fb3fe118fa424d2d490f20d0365c57dcaf845b413e583e36118f2815afa34bd175e305d6169c947e29576c3 + languageName: node + linkType: hard + "@vitest/mocker@npm:2.1.8": version: 2.1.8 resolution: "@vitest/mocker@npm:2.1.8" @@ -9282,12 +9294,12 @@ __metadata: languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/pretty-format@npm:2.1.6" +"@vitest/pretty-format@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/pretty-format@npm:2.0.5" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10c0/5c82496e5816c0c388bbe18a88ed01b39f5492aaa8e0df90868a65a50ee135105da367e58b4a0bed0dc67201c0518c451a32a5d9b81f56665b76b1c75c550686 + checksum: 10c0/236c0798c5170a0b5ad5d4bd06118533738e820b4dd30079d8fbcb15baee949d41c60f42a9f769906c4a5ce366d7ef11279546070646c0efc03128c220c31f37 languageName: node linkType: hard @@ -9300,7 +9312,7 @@ __metadata: languageName: node linkType: hard -"@vitest/runner@npm:2.1.8, @vitest/runner@npm:^2.1.6": +"@vitest/runner@npm:2.1.8, @vitest/runner@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/runner@npm:2.1.8" dependencies: @@ -9321,12 +9333,12 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/spy@npm:2.1.6" +"@vitest/spy@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/spy@npm:2.0.5" dependencies: - tinyspy: "npm:^3.0.2" - checksum: 10c0/4d3e965f9096968125dd4f53a66a8afd7a105852a41bd36865288bef5b6a79f3ec6f2056cc1c7be5a0afb2cd86b3b83e354451f452bf049ddd4516005a748f6f + tinyspy: "npm:^3.0.0" + checksum: 10c0/70634c21921eb271b54d2986c21d7ab6896a31c0f4f1d266940c9bafb8ac36237846d6736638cbf18b958bd98e5261b158a6944352742accfde50b7818ff655e languageName: node linkType: hard @@ -9339,18 +9351,19 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/utils@npm:2.1.6" +"@vitest/utils@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/utils@npm:2.0.5" dependencies: - "@vitest/pretty-format": "npm:2.1.6" - loupe: "npm:^3.1.2" + "@vitest/pretty-format": "npm:2.0.5" + estree-walker: "npm:^3.0.3" + loupe: "npm:^3.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/1ec077b9707ec627075348f1a98687c7bb2fcbf9edf6e73dea6842c328d0d51a33663d22679e2a90a75f45afca9246f8fa3ea452447f474ae9d5f4eca4023b91 + checksum: 10c0/0d1de748298f07a50281e1ba058b05dcd58da3280c14e6f016265e950bd79adab6b97822de8f0ea82d3070f585654801a9b1bcf26db4372e51cf7746bf86d73b languageName: node linkType: hard -"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.6": +"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.1": version: 2.1.8 resolution: "@vitest/utils@npm:2.1.8" dependencies: @@ -15754,7 +15767,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.2.0": +"fdir@npm:^6.2.0, fdir@npm:^6.4.2": version: 6.4.2 resolution: "fdir@npm:6.4.2" peerDependencies: @@ -19853,7 +19866,7 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.2": +"loupe@npm:^3.1.1, loupe@npm:^3.1.2": version: 3.1.2 resolution: "loupe@npm:3.1.2" checksum: 10c0/b13c02e3ddd6a9d5f8bf84133b3242de556512d824dddeea71cce2dbd6579c8f4d672381c4e742d45cf4423d0701765b4a6e5fbc24701def16bc2b40f8daa96a @@ -23203,6 +23216,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: 10c0/7c51f3ad2bb42c776f49ebf964c644958158be30d0a510efd5a395e8d49cb5acfed5b82c0c5b365523ce18e6ab85013c9ebe574f60305892ec3fa8eee8304ccc + languageName: node + linkType: hard + "picoquery@npm:^1.4.0": version: 1.4.0 resolution: "picoquery@npm:1.4.0" @@ -27725,6 +27745,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.10": + version: 0.2.10 + resolution: "tinyglobby@npm:0.2.10" + dependencies: + fdir: "npm:^6.4.2" + picomatch: "npm:^4.0.2" + checksum: 10c0/ce946135d39b8c0e394e488ad59f4092e8c4ecd675ef1bcd4585c47de1b325e61ec6adfbfbe20c3c2bfa6fd674c5b06de2a2e65c433f752ae170aff11793e5ef + languageName: node + linkType: hard + "tinypool@npm:^1.0.1": version: 1.0.2 resolution: "tinypool@npm:1.0.2" @@ -29288,7 +29318,7 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^2.1.6": +"vitest@npm:^2.1.3": version: 2.1.8 resolution: "vitest@npm:2.1.8" dependencies: diff --git a/scripts/package.json b/scripts/package.json index 51c1ac2feac5..ae72fcc9783a 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -94,7 +94,7 @@ "@typescript-eslint/eslint-plugin": "^7.16.0", "@typescript-eslint/experimental-utils": "^5.62.0", "@typescript-eslint/parser": "^7.16.0", - "@vitest/coverage-v8": "^2.1.6", + "@vitest/coverage-v8": "^2.1.3", "ansi-regex": "^6.0.1", "browser-assert": "^1.2.1", "chromatic": "^11.5.5", @@ -105,6 +105,7 @@ "danger": "^12.3.3", "dataloader": "^2.2.2", "detect-port": "^1.6.1", + "diff-match-patch-es": "^0.1.0", "ejs": "^3.1.10", "ejs-lint": "^2.0.0", "es-toolkit": "^1.22.0", @@ -183,7 +184,7 @@ "typescript": "^5.4.5", "util": "^0.12.5", "uuid": "^9.0.1", - "vitest": "^2.1.6", + "vitest": "^2.1.3", "wait-on": "^7.2.0", "window-size": "^1.1.1", "yaml": "^2.4.5", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 015159a4b042..7a65f725641c 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1589,6 +1589,7 @@ __metadata: danger: "npm:^12.3.3" dataloader: "npm:^2.2.2" detect-port: "npm:^1.6.1" + diff-match-patch-es: "npm:^0.1.0" ejs: "npm:^3.1.10" ejs-lint: "npm:^2.0.0" es-toolkit: "npm:^1.22.0" @@ -4828,6 +4829,13 @@ __metadata: languageName: node linkType: hard +"diff-match-patch-es@npm:^0.1.0": + version: 0.1.1 + resolution: "diff-match-patch-es@npm:0.1.1" + checksum: 10c0/8bb602081c7bdefb1e2c5c346e7fb1f476a23a4accf6b6cf8d38ae6ed4f928ba3a87edb54dd517652ec0c813c95768da417ea9eea2c7098381d4e1265d5fecd0 + languageName: node + linkType: hard + "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 36a84a8515e2..e967dc746362 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -11,7 +11,6 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "playwright-ct": "playwright test -c playwright-ct.config.ts", "playwright-e2e": "playwright test -c playwright-e2e.config.ts", - "vitest-non-failing-tests": "SKIP_FAIL_ON_PURPOSE=true vitest run", "preview": "vite preview", "storybook": "storybook dev -p 6006", "vitest": "echo 'not running'" @@ -109,9 +108,9 @@ "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-react": "^4.2.1", - "@vitest/browser": "^2.1.6", - "@vitest/coverage-v8": "^2.1.6", - "@vitest/ui": "^2.1.6", + "@vitest/browser": "^2.1.3", + "@vitest/coverage-v8": "^2.1.3", + "@vitest/ui": "^2.1.3", "cypress": "^13.6.4", "eslint": "^8.56.0", "eslint-plugin-react-hooks": "^4.6.0", @@ -123,6 +122,6 @@ "storybook": "^8.0.0", "typescript": "^5.2.2", "vite": "^5.1.1", - "vitest": "^2.1.6" + "vitest": "^2.1.3" } } diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 4a6ec1318240..5a40e537d339 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1852,8 +1852,8 @@ __metadata: linkType: hard "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.17 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=9e5f6a&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.18 + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=41f89a&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/73f733600a22ab37cea12e80aa69d42933ff6f75c36306b4d09e7887ba31aeeb35bc6af1fd37fbbfa1f9003d65d4413ed67f49851d899a5f13e5178260570103 + checksum: 10/dd243f2534f8e9a00f735f96b6448d3cc26271deac7efef318ab7447cf5241bdbe52dacab13d1f2512827762a7c09258f12919c63f2c32487b0c2b38010247b0 languageName: node linkType: hard @@ -1902,7 +1902,7 @@ __metadata: resolution: "@storybook/instrumenter@portal:../../../code/lib/instrumenter::locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/global": "npm:^5.0.0" - "@vitest/utils": "npm:^2.1.6" + "@vitest/utils": "npm:^2.1.1" peerDependencies: storybook: "workspace:^" languageName: node @@ -1995,8 +1995,8 @@ __metadata: "@testing-library/dom": "npm:10.4.0" "@testing-library/jest-dom": "npm:6.5.0" "@testing-library/user-event": "npm:14.5.2" - "@vitest/expect": "npm:2.1.6" - "@vitest/spy": "npm:2.1.6" + "@vitest/expect": "npm:2.0.5" + "@vitest/spy": "npm:2.0.5" peerDependencies: storybook: "workspace:^" languageName: node @@ -2692,7 +2692,7 @@ __metadata: languageName: node linkType: hard -"@vitest/browser@npm:^2.1.6": +"@vitest/browser@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/browser@npm:2.1.8" dependencies: @@ -2720,7 +2720,7 @@ __metadata: languageName: node linkType: hard -"@vitest/coverage-v8@npm:^2.1.6": +"@vitest/coverage-v8@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/coverage-v8@npm:2.1.8" dependencies: @@ -2746,15 +2746,15 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/expect@npm:2.1.6" +"@vitest/expect@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/expect@npm:2.0.5" dependencies: - "@vitest/spy": "npm:2.1.6" - "@vitest/utils": "npm:2.1.6" - chai: "npm:^5.1.2" + "@vitest/spy": "npm:2.0.5" + "@vitest/utils": "npm:2.0.5" + chai: "npm:^5.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10/78d5c3e9781ec4d4954d4d532612fd3f78321214a86ca50413c2507d5ac36b20ceef3a8a401bfd1aae10d13bb0ef8a0f53f1ce3f212908c2458c4fb855d98612 + checksum: 10/ca9a218f50254b2259fd16166b2d8c9ccc8ee2cc068905e6b3d6281da10967b1590cc7d34b5fa9d429297f97e740450233745583b4cc12272ff11705faf70a37 languageName: node linkType: hard @@ -2789,12 +2789,12 @@ __metadata: languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/pretty-format@npm:2.1.6" +"@vitest/pretty-format@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/pretty-format@npm:2.0.5" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10/be0dea81e14b2e32f9843d96d5c72915acbabe7f06155d396b97f2fc4bef8f88866221ae215820f69674aec58a18ddd43d85aedf6db7d6aa3024ff2813ae1c08 + checksum: 10/70bf452dd0b8525e658795125b3f11110bd6baadfaa38c5bb91ca763bded35ec6dc80e27964ad4e91b91be6544d35e18ea7748c1997693988f975a7283c3e9a0 languageName: node linkType: hard @@ -2828,12 +2828,12 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/spy@npm:2.1.6" +"@vitest/spy@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/spy@npm:2.0.5" dependencies: - tinyspy: "npm:^3.0.2" - checksum: 10/4a926126bfb6ea6f0a2496b2aaa395dd8246de9dcadb5f143aa43bcff310e6eef567f5f05a350ff906b4dcf298790c25ccd961d5a851f47d0c8244f1141dd2b2 + tinyspy: "npm:^3.0.0" + checksum: 10/ed19f4c3bb4d3853241e8070979615138e24403ce4c137fa48c903b3af2c8b3ada2cc26aca9c1aa323bb314a457a8130a29acbb18dafd4e42737deefb2abf1ca languageName: node linkType: hard @@ -2846,7 +2846,7 @@ __metadata: languageName: node linkType: hard -"@vitest/ui@npm:^2.1.6": +"@vitest/ui@npm:^2.1.3": version: 2.1.8 resolution: "@vitest/ui@npm:2.1.8" dependencies: @@ -2863,18 +2863,19 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:2.1.6": - version: 2.1.6 - resolution: "@vitest/utils@npm:2.1.6" +"@vitest/utils@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/utils@npm:2.0.5" dependencies: - "@vitest/pretty-format": "npm:2.1.6" - loupe: "npm:^3.1.2" + "@vitest/pretty-format": "npm:2.0.5" + estree-walker: "npm:^3.0.3" + loupe: "npm:^3.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10/7da93c871f2c0d5242caf65236b40f041e8820cfadddf9b68721e54eda5230c3dd8ed26a43600498930d922ee324dd3a65939e71b6db0906fe81bcf41c4bf040 + checksum: 10/d631d56d29c33bc8de631166b2b6691c470187a345469dfef7048befe6027e1c6ff9552f2ee11c8a247522c325c4a64bfcc73f8f0f0c525da39cb9f190f119f8 languageName: node linkType: hard -"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.6": +"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.1": version: 2.1.8 resolution: "@vitest/utils@npm:2.1.8" dependencies: @@ -3485,7 +3486,7 @@ __metadata: languageName: node linkType: hard -"chai@npm:^5.1.2": +"chai@npm:^5.1.1, chai@npm:^5.1.2": version: 5.1.2 resolution: "chai@npm:5.1.2" dependencies: @@ -6660,7 +6661,7 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.0, loupe@npm:^3.1.2": +"loupe@npm:^3.1.0, loupe@npm:^3.1.1, loupe@npm:^3.1.2": version: 3.1.2 resolution: "loupe@npm:3.1.2" checksum: 10/8f5734e53fb64cd914aa7d986e01b6d4c2e3c6c56dcbd5428d71c2703f0ab46b5ab9f9eeaaf2b485e8a1c43f865bdd16ec08ae1a661c8f55acdbd9f4d59c607a @@ -7473,9 +7474,9 @@ __metadata: "@typescript-eslint/eslint-plugin": "npm:^6.21.0" "@typescript-eslint/parser": "npm:^6.21.0" "@vitejs/plugin-react": "npm:^4.2.1" - "@vitest/browser": "npm:^2.1.6" - "@vitest/coverage-v8": "npm:^2.1.6" - "@vitest/ui": "npm:^2.1.6" + "@vitest/browser": "npm:^2.1.3" + "@vitest/coverage-v8": "npm:^2.1.3" + "@vitest/ui": "npm:^2.1.3" cypress: "npm:^13.6.4" eslint: "npm:^8.56.0" eslint-plugin-react-hooks: "npm:^4.6.0" @@ -7489,7 +7490,7 @@ __metadata: storybook: "npm:^8.0.0" typescript: "npm:^5.2.2" vite: "npm:^5.1.1" - vitest: "npm:^2.1.6" + vitest: "npm:^2.1.3" languageName: unknown linkType: soft @@ -8532,7 +8533,7 @@ __metadata: languageName: node linkType: hard -"tinyspy@npm:^3.0.2": +"tinyspy@npm:^3.0.0, tinyspy@npm:^3.0.2": version: 3.0.2 resolution: "tinyspy@npm:3.0.2" checksum: 10/5db671b2ff5cd309de650c8c4761ca945459d7204afb1776db9a04fb4efa28a75f08517a8620c01ee32a577748802231ad92f7d5b194dc003ee7f987a2a06337 @@ -8934,7 +8935,7 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^2.1.6": +"vitest@npm:^2.1.3": version: 2.1.8 resolution: "vitest@npm:2.1.8" dependencies: From b8c9393fafaad19f4fb8da9f6674d1fb67f84966 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 6 Dec 2024 14:52:46 +0100 Subject: [PATCH 031/169] revert yarn.lock changes. --- code/yarn.lock | 403 +++++++++++++++++++++------------------------- scripts/yarn.lock | 41 ++--- 2 files changed, 203 insertions(+), 241 deletions(-) diff --git a/code/yarn.lock b/code/yarn.lock index f9dba44953be..389084993441 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -927,7 +927,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.26.2 resolution: "@babel/parser@npm:7.26.2" dependencies: @@ -2477,7 +2477,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.25.4, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": +"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": version: 7.26.0 resolution: "@babel/types@npm:7.26.0" dependencies: @@ -2511,12 +2511,12 @@ __metadata: languageName: node linkType: hard -"@bundled-es-modules/cookie@npm:^2.0.1": - version: 2.0.1 - resolution: "@bundled-es-modules/cookie@npm:2.0.1" +"@bundled-es-modules/cookie@npm:^2.0.0": + version: 2.0.0 + resolution: "@bundled-es-modules/cookie@npm:2.0.0" dependencies: - cookie: "npm:^0.7.2" - checksum: 10c0/dfac5e36127e827c5557b8577f17a8aa94c057baff6d38555917927b99da0ecf0b1357e7fedadc8853ecdbd4a8a7fa1f5e64111b2a656612f4a36376f5bdbe8d + cookie: "npm:^0.5.0" + checksum: 10c0/0655dd331b35d7b5b6dd2301c3bcfb7233018c0e3235a40ced1d53f00463ab92dc01f0091f153812867bc0ef0f8e0a157a30acb16e8d7ef149702bf8db9fe7a6 languageName: node linkType: hard @@ -3961,48 +3961,50 @@ __metadata: languageName: node linkType: hard -"@inquirer/confirm@npm:^5.0.0": - version: 5.0.2 - resolution: "@inquirer/confirm@npm:5.0.2" +"@inquirer/confirm@npm:^3.0.0": + version: 3.1.20 + resolution: "@inquirer/confirm@npm:3.1.20" dependencies: - "@inquirer/core": "npm:^10.1.0" - "@inquirer/type": "npm:^3.0.1" - peerDependencies: - "@types/node": ">=18" - checksum: 10c0/c121cfb0557b42dd6570b54dce707a048d85f328481d5230d21fede195902012ede06887aa478875cc83afa064c2e30953eb2cab0744f832195867b418865115 + "@inquirer/core": "npm:^9.0.8" + "@inquirer/type": "npm:^1.5.1" + checksum: 10c0/5cf4c15c194932a6c97c7efa89266e585be70d209993eafdcf0b91a6f1219fe232c7485706b314af3befb0d579051218d9c7f82df6970d9d59b95879dd1abdfd languageName: node linkType: hard -"@inquirer/core@npm:^10.1.0": - version: 10.1.0 - resolution: "@inquirer/core@npm:10.1.0" +"@inquirer/core@npm:^9.0.8": + version: 9.0.8 + resolution: "@inquirer/core@npm:9.0.8" dependencies: - "@inquirer/figures": "npm:^1.0.8" - "@inquirer/type": "npm:^3.0.1" + "@inquirer/figures": "npm:^1.0.5" + "@inquirer/type": "npm:^1.5.1" + "@types/mute-stream": "npm:^0.0.4" + "@types/node": "npm:^22.0.0" + "@types/wrap-ansi": "npm:^3.0.0" ansi-escapes: "npm:^4.3.2" + cli-spinners: "npm:^2.9.2" cli-width: "npm:^4.1.0" - mute-stream: "npm:^2.0.0" + mute-stream: "npm:^1.0.0" signal-exit: "npm:^4.1.0" strip-ansi: "npm:^6.0.1" wrap-ansi: "npm:^6.2.0" yoctocolors-cjs: "npm:^2.1.2" - checksum: 10c0/ffd187edb210426c3e25ed564f7aa8844468c28dd2ba3c53dbe28d3359b519cdfae987b31bf927c1dd2e9f70a914fdefe319abe4c5f384e5e08410d11e0a7ce2 + checksum: 10c0/b38f9c8af932f159501f9ca38c670bd19794400a6f1421f61e08ed42982b44f33ab992237ca81bcf2fb4aa756c683e50067676cd3ef70c691219502df73c0ecf languageName: node linkType: hard -"@inquirer/figures@npm:^1.0.8": - version: 1.0.8 - resolution: "@inquirer/figures@npm:1.0.8" - checksum: 10c0/34d287ff1fd16476c58bbd5b169db315f8319b5ffb09f81a1bb9aabd4165114e7406b1f418d021fd9cd48923008446e3eec274bb818f378ea132a0450bbc91d4 +"@inquirer/figures@npm:^1.0.5": + version: 1.0.5 + resolution: "@inquirer/figures@npm:1.0.5" + checksum: 10c0/ec9ba23db42cb33fa18eb919abf2a18e750e739e64c1883ce4a98345cd5711c60cac12d1faf56a859f52d387deb221c8d3dfe60344ee07955a9a262f8b821fe3 languageName: node linkType: hard -"@inquirer/type@npm:^3.0.1": - version: 3.0.1 - resolution: "@inquirer/type@npm:3.0.1" - peerDependencies: - "@types/node": ">=18" - checksum: 10c0/c8612362d382114a318dbb523de7b1f54dc6bc6d3016c6eaf299b6a32486b92b0dfb1b4cfc6fe9d99496d15fbb721873a1bd66819f796c8bb09853a3b808812d +"@inquirer/type@npm:^1.5.1": + version: 1.5.1 + resolution: "@inquirer/type@npm:1.5.1" + dependencies: + mute-stream: "npm:^1.0.0" + checksum: 10c0/a4fa548179210b55102c05bb7f475bb757385fb5ccbc7f8f20b8020d9f3acb75d544f26292b35ebb8b7b5ebac54ecb503d238058aea4a34f2b47b78c8c63020e languageName: node linkType: hard @@ -4248,9 +4250,9 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.37.0": - version: 0.37.3 - resolution: "@mswjs/interceptors@npm:0.37.3" +"@mswjs/interceptors@npm:^0.35.6": + version: 0.35.6 + resolution: "@mswjs/interceptors@npm:0.35.6" dependencies: "@open-draft/deferred-promise": "npm:^2.2.0" "@open-draft/logger": "npm:^0.3.0" @@ -4258,7 +4260,7 @@ __metadata: is-node-process: "npm:^1.2.0" outvariant: "npm:^1.4.3" strict-event-emitter: "npm:^0.5.1" - checksum: 10c0/5a8d9ab7c491d14dff996f23bda0fa7b7059f68a1d4981b804b6114f1c0c0490bc35860df135ed36da1720984323878b1a9d13dbc80936bbfa67b3d3c3476f6c + checksum: 10c0/9472f640183675869368bf2ccf32354db0dfb320c754bcbfc683059f5380674598c59dde4fa58007f74817e31aa1dbd123787fcd0b1d37d53595aa718d06bfbe languageName: node linkType: hard @@ -8509,6 +8511,15 @@ __metadata: languageName: node linkType: hard +"@types/mute-stream@npm:^0.0.4": + version: 0.0.4 + resolution: "@types/mute-stream@npm:0.0.4" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/944730fd7b398c5078de3c3d4d0afeec8584283bc694da1803fdfca14149ea385e18b1b774326f1601baf53898ce6d121a952c51eb62d188ef6fcc41f725c0dc + languageName: node + linkType: hard + "@types/node@npm:^22.0.0": version: 22.1.0 resolution: "@types/node@npm:22.1.0" @@ -8872,6 +8883,13 @@ __metadata: languageName: node linkType: hard +"@types/wrap-ansi@npm:^3.0.0": + version: 3.0.0 + resolution: "@types/wrap-ansi@npm:3.0.0" + checksum: 10c0/8d8f53363f360f38135301a06b596c295433ad01debd082078c33c6ed98b05a5c8fe8853a88265432126096084f4a135ec1564e3daad631b83296905509f90b3 + languageName: node + linkType: hard + "@types/ws@npm:^8, @types/ws@npm:^8.5.5": version: 8.5.10 resolution: "@types/ws@npm:8.5.10" @@ -9166,21 +9184,21 @@ __metadata: linkType: hard "@vitest/browser@npm:^2.1.3": - version: 2.1.8 - resolution: "@vitest/browser@npm:2.1.8" + version: 2.1.3 + resolution: "@vitest/browser@npm:2.1.3" dependencies: "@testing-library/dom": "npm:^10.4.0" "@testing-library/user-event": "npm:^14.5.2" - "@vitest/mocker": "npm:2.1.8" - "@vitest/utils": "npm:2.1.8" - magic-string: "npm:^0.30.12" - msw: "npm:^2.6.4" - sirv: "npm:^3.0.0" + "@vitest/mocker": "npm:2.1.3" + "@vitest/utils": "npm:2.1.3" + magic-string: "npm:^0.30.11" + msw: "npm:^2.3.5" + sirv: "npm:^2.0.4" tinyrainbow: "npm:^1.2.0" ws: "npm:^8.18.0" peerDependencies: playwright: "*" - vitest: 2.1.8 + vitest: 2.1.3 webdriverio: "*" peerDependenciesMeta: playwright: @@ -9189,53 +9207,53 @@ __metadata: optional: true webdriverio: optional: true - checksum: 10c0/00e89e43064654d42dab85ccae5743e350ae91d441563fe3678c6569362cb7527756dddff154ef33120841cc553caef16a82a7df4ca4569563c52dedacc719e9 + checksum: 10c0/428a8d62ffcc2d637363fc7eb986d6beaeda7681b032d785f2bc475f8d105a14c674610e22a0a0c74e4ee10774b3709b11bc359e0458c6867c3d4acdc3f190a6 languageName: node linkType: hard "@vitest/coverage-istanbul@npm:^2.1.3": - version: 2.1.8 - resolution: "@vitest/coverage-istanbul@npm:2.1.8" + version: 2.1.3 + resolution: "@vitest/coverage-istanbul@npm:2.1.3" dependencies: "@istanbuljs/schema": "npm:^0.1.3" - debug: "npm:^4.3.7" + debug: "npm:^4.3.6" istanbul-lib-coverage: "npm:^3.2.2" istanbul-lib-instrument: "npm:^6.0.3" istanbul-lib-report: "npm:^3.0.1" istanbul-lib-source-maps: "npm:^5.0.6" istanbul-reports: "npm:^3.1.7" - magicast: "npm:^0.3.5" + magicast: "npm:^0.3.4" test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" peerDependencies: - vitest: 2.1.8 - checksum: 10c0/809eeccebaa7fd0e349d89a8d374e449c65a1d626f46b03b080aa507ac93dfb340c90dd491fe9a08dca896d6832e0f3dcffd6fd7ba3d05c1dc95c7a32aabc50c + vitest: 2.1.3 + checksum: 10c0/6b21eb219f45dc0f3bfb35049280658687b6b2f4ba5e17dc2c7e2c221f5d37e60c6962c5cfd77bd5f2848bb56debd26f82e5684b293f5775a8a416a0173f1803 languageName: node linkType: hard "@vitest/coverage-v8@npm:^2.1.3": - version: 2.1.8 - resolution: "@vitest/coverage-v8@npm:2.1.8" + version: 2.1.3 + resolution: "@vitest/coverage-v8@npm:2.1.3" dependencies: "@ampproject/remapping": "npm:^2.3.0" "@bcoe/v8-coverage": "npm:^0.2.3" - debug: "npm:^4.3.7" + debug: "npm:^4.3.6" istanbul-lib-coverage: "npm:^3.2.2" istanbul-lib-report: "npm:^3.0.1" istanbul-lib-source-maps: "npm:^5.0.6" istanbul-reports: "npm:^3.1.7" - magic-string: "npm:^0.30.12" - magicast: "npm:^0.3.5" - std-env: "npm:^3.8.0" + magic-string: "npm:^0.30.11" + magicast: "npm:^0.3.4" + std-env: "npm:^3.7.0" test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" peerDependencies: - "@vitest/browser": 2.1.8 - vitest: 2.1.8 + "@vitest/browser": 2.1.3 + vitest: 2.1.3 peerDependenciesMeta: "@vitest/browser": optional: true - checksum: 10c0/b228a23bbaf0eae07ac939399f968b0def2df786091948a12d614919db3f5b6e46db7a1ab4f9d05d5d7f696afd53133a67abc25915f85480cd032442664ac725 + checksum: 10c0/5fdff9e9dd8b8d2030c00a5273ba2b27441c0cb45d007b6671504745dac6d095c160a01433789e7ed1ca6cd234246f883c1d52c02cfb62f8ae81dda17dd56bc6 languageName: node linkType: hard @@ -9251,15 +9269,15 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:2.1.8": - version: 2.1.8 - resolution: "@vitest/expect@npm:2.1.8" +"@vitest/expect@npm:2.1.3": + version: 2.1.3 + resolution: "@vitest/expect@npm:2.1.3" dependencies: - "@vitest/spy": "npm:2.1.8" - "@vitest/utils": "npm:2.1.8" - chai: "npm:^5.1.2" + "@vitest/spy": "npm:2.1.3" + "@vitest/utils": "npm:2.1.3" + chai: "npm:^5.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/6fbf4abc2360efe4d3671d3425f8bb6012fe2dd932a88720d8b793030b766ba260494822c721d3fc497afe52373515c7e150635a95c25f6e1b567f86155c5408 + checksum: 10c0/0837adcbb938feebcc083664afc5c4d12e42f1f2442b6f1bedc6b5650a8ff2448b1f10713b45afb099c839fb5cf766c971736267fa9b0fe2ac87f3e2d7f782c2 languageName: node linkType: hard @@ -9275,22 +9293,23 @@ __metadata: languageName: node linkType: hard -"@vitest/mocker@npm:2.1.8": - version: 2.1.8 - resolution: "@vitest/mocker@npm:2.1.8" +"@vitest/mocker@npm:2.1.3": + version: 2.1.3 + resolution: "@vitest/mocker@npm:2.1.3" dependencies: - "@vitest/spy": "npm:2.1.8" + "@vitest/spy": "npm:2.1.3" estree-walker: "npm:^3.0.3" - magic-string: "npm:^0.30.12" + magic-string: "npm:^0.30.11" peerDependencies: - msw: ^2.4.9 + "@vitest/spy": 2.1.3 + msw: ^2.3.5 vite: ^5.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - checksum: 10c0/b4113ed8a57c0f60101d02e1b1769357a346ecd55ded499eab384d52106fd4b12d51e9aaa6db98f47de0d56662477be0ed8d46d6dfa84c235f9e1b234709814e + checksum: 10c0/03c80628d092244f21a0ba9041665fc75f987d0d11fab1ae0b7027ec21e503f65057e8c24b936602c5f852d83fbb183da13d05dba117c99785b41b3dafd105ce languageName: node linkType: hard @@ -9303,33 +9322,33 @@ __metadata: languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.8, @vitest/pretty-format@npm:^2.1.8": - version: 2.1.8 - resolution: "@vitest/pretty-format@npm:2.1.8" +"@vitest/pretty-format@npm:2.1.3, @vitest/pretty-format@npm:^2.1.3": + version: 2.1.3 + resolution: "@vitest/pretty-format@npm:2.1.3" dependencies: tinyrainbow: "npm:^1.2.0" - checksum: 10c0/1dc5c9b1c7c7e78e46a2a16033b6b20be05958bbebc5a5b78f29e32718c80252034804fccd23f34db6b3583239db47e68fc5a8e41942c54b8047cc3b4133a052 + checksum: 10c0/5a6ee872a8adf5e2764f2b5b2276d8a2199be4ef14777ab693428caf359481851400af10b59721d4972289c955ffe7277954a662b04cfb10233824574c7074ba languageName: node linkType: hard -"@vitest/runner@npm:2.1.8, @vitest/runner@npm:^2.1.3": - version: 2.1.8 - resolution: "@vitest/runner@npm:2.1.8" +"@vitest/runner@npm:2.1.3, @vitest/runner@npm:^2.1.3": + version: 2.1.3 + resolution: "@vitest/runner@npm:2.1.3" dependencies: - "@vitest/utils": "npm:2.1.8" + "@vitest/utils": "npm:2.1.3" pathe: "npm:^1.1.2" - checksum: 10c0/d0826a71494adeafc8c6478257f584d11655145c83e2d8f94c17301d7059c7463ad768a69379e394c50838a7435abcc9255a6b7d8894f5ee06b153e314683a75 + checksum: 10c0/d5b077643265d10025e22fa64a0e54c3d4fddc23e05f9fcd143dbcc4080851b0df31985986e57890a974577a18d3af624758b6062801d7dd96f9b4f2eaf591f1 languageName: node linkType: hard -"@vitest/snapshot@npm:2.1.8": - version: 2.1.8 - resolution: "@vitest/snapshot@npm:2.1.8" +"@vitest/snapshot@npm:2.1.3": + version: 2.1.3 + resolution: "@vitest/snapshot@npm:2.1.3" dependencies: - "@vitest/pretty-format": "npm:2.1.8" - magic-string: "npm:^0.30.12" + "@vitest/pretty-format": "npm:2.1.3" + magic-string: "npm:^0.30.11" pathe: "npm:^1.1.2" - checksum: 10c0/8d7a77a52e128630ea737ee0a0fe746d1d325cac5848326861dbf042844da4d5c1a5145539ae0ed1a3f0b0363506e98d86f2679fadf114ec4b987f1eb616867b + checksum: 10c0/a3dcea6a5f7581b6a34dc3bf5f7bd42a05e2ccf6e1171d9f1b759688aebe650e6412564d066aeaa45e83ac549d453b6a3edcf774a8ac728c0c639f8dc919039f languageName: node linkType: hard @@ -9342,12 +9361,12 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:2.1.8": - version: 2.1.8 - resolution: "@vitest/spy@npm:2.1.8" +"@vitest/spy@npm:2.1.3": + version: 2.1.3 + resolution: "@vitest/spy@npm:2.1.3" dependencies: - tinyspy: "npm:^3.0.2" - checksum: 10c0/9740f10772ede004ea7f9ffb8a6c3011341d75d9d7f2d4d181b123a701c4691e942f38cf1700684a3bb5eea3c78addf753fd8cdf78c51d8eadc3bada6fadf8f2 + tinyspy: "npm:^3.0.0" + checksum: 10c0/8d85a5c2848c5bd81892af989aebad65d0c7ae74094aa98ad4f35ecf80755259c7a748a8e7bf683b2906fac29a51fc0ffa82f8fc073b36dbd8a0418261fccdba languageName: node linkType: hard @@ -9363,14 +9382,14 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:2.1.8, @vitest/utils@npm:^2.1.1": - version: 2.1.8 - resolution: "@vitest/utils@npm:2.1.8" +"@vitest/utils@npm:2.1.3, @vitest/utils@npm:^2.1.1": + version: 2.1.3 + resolution: "@vitest/utils@npm:2.1.3" dependencies: - "@vitest/pretty-format": "npm:2.1.8" - loupe: "npm:^3.1.2" + "@vitest/pretty-format": "npm:2.1.3" + loupe: "npm:^3.1.1" tinyrainbow: "npm:^1.2.0" - checksum: 10c0/d4a29ecd8f6c24c790e4c009f313a044d89e664e331bc9c3cfb57fe1380fb1d2999706dbbfc291f067d6c489602e76d00435309fbc906197c0d01f831ca17d64 + checksum: 10c0/55a044e43b84c0f8f573d8578107f26440678b6f506c8d9fee88b7ef120d19efd27c9be77985c107113b0f3f3db298dcee57074e1c1c214bee7a097fd08a209b languageName: node linkType: hard @@ -11970,19 +11989,6 @@ __metadata: languageName: node linkType: hard -"chai@npm:^5.1.2": - version: 5.1.2 - resolution: "chai@npm:5.1.2" - dependencies: - assertion-error: "npm:^2.0.1" - check-error: "npm:^2.1.1" - deep-eql: "npm:^5.0.1" - loupe: "npm:^3.1.0" - pathval: "npm:^2.0.0" - checksum: 10c0/6c04ff8495b6e535df9c1b062b6b094828454e9a3c9493393e55b2f4dbff7aa2a29a4645133cad160fb00a16196c4dc03dc9bb37e1f4ba9df3b5f50d7533a736 - languageName: node - linkType: hard - "chalk@npm:5.3.0, chalk@npm:^5.0.0, chalk@npm:^5.2.0, chalk@npm:^5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" @@ -12266,7 +12272,7 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.5.0": +"cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.9.2": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" checksum: 10c0/907a1c227ddf0d7a101e7ab8b300affc742ead4b4ebe920a5bf1bc6d45dce2958fcd195eb28fa25275062fe6fa9b109b93b63bc8033396ed3bcb50297008b3a3 @@ -12756,10 +12762,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.7.2": - version: 0.7.2 - resolution: "cookie@npm:0.7.2" - checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2 +"cookie@npm:^0.5.0": + version: 0.5.0 + resolution: "cookie@npm:0.5.0" + checksum: 10c0/c01ca3ef8d7b8187bae434434582288681273b5a9ed27521d4d7f9f7928fe0c920df0decd9f9d3bbd2d14ac432b8c8cf42b98b3bdd5bfe0e6edddeebebe8b61d languageName: node linkType: hard @@ -13305,7 +13311,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^4.3.7": +"debug@npm:^4.3.6, debug@npm:^4.3.7": version: 4.3.7 resolution: "debug@npm:4.3.7" dependencies: @@ -14509,13 +14515,6 @@ __metadata: languageName: node linkType: hard -"es-module-lexer@npm:^1.5.4": - version: 1.5.4 - resolution: "es-module-lexer@npm:1.5.4" - checksum: 10c0/300a469488c2f22081df1e4c8398c78db92358496e639b0df7f89ac6455462aaf5d8893939087c1a1cbcbf20eed4610c70e0bcb8f3e4b0d80a5d2611c539408c - languageName: node - linkType: hard - "es-object-atoms@npm:^1.0.0": version: 1.0.0 resolution: "es-object-atoms@npm:1.0.0" @@ -15519,13 +15518,6 @@ __metadata: languageName: node linkType: hard -"expect-type@npm:^1.1.0": - version: 1.1.0 - resolution: "expect-type@npm:1.1.0" - checksum: 10c0/5af0febbe8fe18da05a6d51e3677adafd75213512285408156b368ca471252565d5ca6e59e4bddab25121f3cfcbbebc6a5489f8cc9db131cc29e69dcdcc7ae15 - languageName: node - linkType: hard - "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -19857,7 +19849,7 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.0": +"loupe@npm:^3.1.0, loupe@npm:^3.1.1": version: 3.1.1 resolution: "loupe@npm:3.1.1" dependencies: @@ -19866,13 +19858,6 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.1, loupe@npm:^3.1.2": - version: 3.1.2 - resolution: "loupe@npm:3.1.2" - checksum: 10c0/b13c02e3ddd6a9d5f8bf84133b3242de556512d824dddeea71cce2dbd6579c8f4d672381c4e742d45cf4423d0701765b4a6e5fbc24701def16bc2b40f8daa96a - languageName: node - linkType: hard - "lower-case@npm:^2.0.2": version: 2.0.2 resolution: "lower-case@npm:2.0.2" @@ -19992,14 +19977,14 @@ __metadata: languageName: node linkType: hard -"magicast@npm:^0.3.5": - version: 0.3.5 - resolution: "magicast@npm:0.3.5" +"magicast@npm:^0.3.4": + version: 0.3.4 + resolution: "magicast@npm:0.3.4" dependencies: - "@babel/parser": "npm:^7.25.4" - "@babel/types": "npm:^7.25.4" + "@babel/parser": "npm:^7.24.4" + "@babel/types": "npm:^7.24.0" source-map-js: "npm:^1.2.0" - checksum: 10c0/a6cacc0a848af84f03e3f5bda7b0de75e4d0aa9ddce5517fd23ed0f31b5ddd51b2d0ff0b7e09b51f7de0f4053c7a1107117edda6b0732dca3e9e39e6c5a68c64 + checksum: 10c0/7ebaaac397b13c31ca05e6d9649296751d76749b945d10a0800107872119fbdf267acdb604571d25e38ec6fd7ab3568a951b6e76eaef1caba9eaa11778fd9783 languageName: node linkType: hard @@ -21630,16 +21615,15 @@ __metadata: languageName: node linkType: hard -"msw@npm:^2.6.4": - version: 2.6.6 - resolution: "msw@npm:2.6.6" +"msw@npm:^2.3.5": + version: 2.4.8 + resolution: "msw@npm:2.4.8" dependencies: - "@bundled-es-modules/cookie": "npm:^2.0.1" + "@bundled-es-modules/cookie": "npm:^2.0.0" "@bundled-es-modules/statuses": "npm:^1.0.1" "@bundled-es-modules/tough-cookie": "npm:^0.1.6" - "@inquirer/confirm": "npm:^5.0.0" - "@mswjs/interceptors": "npm:^0.37.0" - "@open-draft/deferred-promise": "npm:^2.2.0" + "@inquirer/confirm": "npm:^3.0.0" + "@mswjs/interceptors": "npm:^0.35.6" "@open-draft/until": "npm:^2.1.0" "@types/cookie": "npm:^0.6.0" "@types/statuses": "npm:^2.0.4" @@ -21647,10 +21631,10 @@ __metadata: graphql: "npm:^16.8.1" headers-polyfill: "npm:^4.0.2" is-node-process: "npm:^1.2.0" - outvariant: "npm:^1.4.3" + outvariant: "npm:^1.4.2" path-to-regexp: "npm:^6.3.0" strict-event-emitter: "npm:^0.5.1" - type-fest: "npm:^4.26.1" + type-fest: "npm:^4.9.0" yargs: "npm:^17.7.2" peerDependencies: typescript: ">= 4.8.x" @@ -21659,7 +21643,7 @@ __metadata: optional: true bin: msw: cli/index.js - checksum: 10c0/d7f0e0ea6512cfddda5b7695a0c6c6a0ed43b36b62f25925beee8e12daec12a5ef369d00e0976f9dd76d3af779741fda11a3eae812da11a044b03992e697010c + checksum: 10c0/33a8c5697f7cb003a2af33ff6b259eaf7babf180fadf0697d107d0856ab0d2ff1a80d319e788d9127f289ff091334bee589f348180a1fdd0914bf8c4725830dc languageName: node linkType: hard @@ -21689,20 +21673,13 @@ __metadata: languageName: node linkType: hard -"mute-stream@npm:1.0.0": +"mute-stream@npm:1.0.0, mute-stream@npm:^1.0.0": version: 1.0.0 resolution: "mute-stream@npm:1.0.0" checksum: 10c0/dce2a9ccda171ec979a3b4f869a102b1343dee35e920146776780de182f16eae459644d187e38d59a3d37adf85685e1c17c38cf7bfda7e39a9880f7a1d10a74c languageName: node linkType: hard -"mute-stream@npm:^2.0.0": - version: 2.0.0 - resolution: "mute-stream@npm:2.0.0" - checksum: 10c0/2cf48a2087175c60c8dcdbc619908b49c07f7adcfc37d29236b0c5c612d6204f789104c98cc44d38acab7b3c96f4a3ec2cfdc4934d0738d876dbefa2a12c69f4 - languageName: node - linkType: hard - "nanoid@npm:^3.3.6, nanoid@npm:^3.3.7": version: 3.3.7 resolution: "nanoid@npm:3.3.7" @@ -22609,7 +22586,7 @@ __metadata: languageName: node linkType: hard -"outvariant@npm:^1.4.0, outvariant@npm:^1.4.3": +"outvariant@npm:^1.4.0, outvariant@npm:^1.4.2, outvariant@npm:^1.4.3": version: 1.4.3 resolution: "outvariant@npm:1.4.3" checksum: 10c0/5976ca7740349cb8c71bd3382e2a762b1aeca6f33dc984d9d896acdf3c61f78c3afcf1bfe9cc633a7b3c4b295ec94d292048f83ea2b2594fae4496656eba992c @@ -26457,17 +26434,6 @@ __metadata: languageName: node linkType: hard -"sirv@npm:^3.0.0": - version: 3.0.0 - resolution: "sirv@npm:3.0.0" - dependencies: - "@polka/url": "npm:^1.0.0-next.24" - mrmime: "npm:^2.0.0" - totalist: "npm:^3.0.0" - checksum: 10c0/282c52ee5a93cafa297096ad31aa6c3004a21d4c93abe728b701e51e4329acb887f6e92f07696225414fd6bb4a7782fd64a42d0b6b6467ae0f66bd3fde90b865 - languageName: node - linkType: hard - "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -26894,10 +26860,10 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.8.0": - version: 3.8.0 - resolution: "std-env@npm:3.8.0" - checksum: 10c0/f560a2902fd0fa3d648d7d0acecbd19d664006f7372c1fba197ed4c216b4c9e48db6e2769b5fe1616d42a9333c9f066c5011935035e85c59f45dc4f796272040 +"std-env@npm:^3.7.0": + version: 3.7.0 + resolution: "std-env@npm:3.7.0" + checksum: 10c0/60edf2d130a4feb7002974af3d5a5f3343558d1ccf8d9b9934d225c638606884db4a20d2fe6440a09605bca282af6b042ae8070a10490c0800d69e82e478f41e languageName: node linkType: hard @@ -27738,10 +27704,10 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^0.3.1": - version: 0.3.1 - resolution: "tinyexec@npm:0.3.1" - checksum: 10c0/11e7a7c5d8b3bddf8b5cbe82a9290d70a6fad84d528421d5d18297f165723cb53d2e737d8f58dcce5ca56f2e4aa2d060f02510b1f8971784f97eb3e9aec28f09 +"tinyexec@npm:^0.3.0": + version: 0.3.0 + resolution: "tinyexec@npm:0.3.0" + checksum: 10c0/138a4f4241aea6b6312559508468ab275a31955e66e2f57ed206e0aaabecee622624f208c5740345f0a66e33478fd065e359ed1eb1269eb6fd4fa25d44d0ba3b languageName: node linkType: hard @@ -27755,10 +27721,10 @@ __metadata: languageName: node linkType: hard -"tinypool@npm:^1.0.1": - version: 1.0.2 - resolution: "tinypool@npm:1.0.2" - checksum: 10c0/31ac184c0ff1cf9a074741254fe9ea6de95026749eb2b8ec6fd2b9d8ca94abdccda731f8e102e7f32e72ed3b36d32c6975fd5f5523df3f1b6de6c3d8dfd95e63 +"tinypool@npm:^1.0.0": + version: 1.0.0 + resolution: "tinypool@npm:1.0.0" + checksum: 10c0/71b20b9c54366393831c286a0772380c20f8cad9546d724c484edb47aea3228f274c58e98cf51d28c40869b39f5273209ef3ea94a9d2a23f8b292f4731cd3e4e languageName: node linkType: hard @@ -27783,13 +27749,6 @@ __metadata: languageName: node linkType: hard -"tinyspy@npm:^3.0.2": - version: 3.0.2 - resolution: "tinyspy@npm:3.0.2" - checksum: 10c0/55ffad24e346622b59292e097c2ee30a63919d5acb7ceca87fc0d1c223090089890587b426e20054733f97a58f20af2c349fb7cc193697203868ab7ba00bcea0 - languageName: node - linkType: hard - "tmp@npm:0.0.28": version: 0.0.28 resolution: "tmp@npm:0.0.28" @@ -29167,18 +29126,17 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:2.1.8": - version: 2.1.8 - resolution: "vite-node@npm:2.1.8" +"vite-node@npm:2.1.3": + version: 2.1.3 + resolution: "vite-node@npm:2.1.3" dependencies: cac: "npm:^6.7.14" - debug: "npm:^4.3.7" - es-module-lexer: "npm:^1.5.4" + debug: "npm:^4.3.6" pathe: "npm:^1.1.2" vite: "npm:^5.0.0" bin: vite-node: vite-node.mjs - checksum: 10c0/cb28027a7425ba29780e216164c07d36a4ff9eb60d83afcad3bc222fd5a5f3e36030071c819edd6d910940f502d49e52f7564743617bc1c5875485b0952c72d5 + checksum: 10c0/1b06139880a8170651e025e8c35aa92a917f8ec8f24507cda5bf4be09843f6447e1f494932a8d7eb98124f1c8c9fee02283ef318ddd57e2b861d2d85a409a206 languageName: node linkType: hard @@ -29319,34 +29277,33 @@ __metadata: linkType: hard "vitest@npm:^2.1.3": - version: 2.1.8 - resolution: "vitest@npm:2.1.8" - dependencies: - "@vitest/expect": "npm:2.1.8" - "@vitest/mocker": "npm:2.1.8" - "@vitest/pretty-format": "npm:^2.1.8" - "@vitest/runner": "npm:2.1.8" - "@vitest/snapshot": "npm:2.1.8" - "@vitest/spy": "npm:2.1.8" - "@vitest/utils": "npm:2.1.8" - chai: "npm:^5.1.2" - debug: "npm:^4.3.7" - expect-type: "npm:^1.1.0" - magic-string: "npm:^0.30.12" + version: 2.1.3 + resolution: "vitest@npm:2.1.3" + dependencies: + "@vitest/expect": "npm:2.1.3" + "@vitest/mocker": "npm:2.1.3" + "@vitest/pretty-format": "npm:^2.1.3" + "@vitest/runner": "npm:2.1.3" + "@vitest/snapshot": "npm:2.1.3" + "@vitest/spy": "npm:2.1.3" + "@vitest/utils": "npm:2.1.3" + chai: "npm:^5.1.1" + debug: "npm:^4.3.6" + magic-string: "npm:^0.30.11" pathe: "npm:^1.1.2" - std-env: "npm:^3.8.0" + std-env: "npm:^3.7.0" tinybench: "npm:^2.9.0" - tinyexec: "npm:^0.3.1" - tinypool: "npm:^1.0.1" + tinyexec: "npm:^0.3.0" + tinypool: "npm:^1.0.0" tinyrainbow: "npm:^1.2.0" vite: "npm:^5.0.0" - vite-node: "npm:2.1.8" + vite-node: "npm:2.1.3" why-is-node-running: "npm:^2.3.0" peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": 2.1.8 - "@vitest/ui": 2.1.8 + "@vitest/browser": 2.1.3 + "@vitest/ui": 2.1.3 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -29364,7 +29321,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 10c0/e70631bad5662d6c60c5cf836a4baf58b890db6654fef1f608fe6a86aa49a2b9f078aac74b719d4d3c87c5c781968cc73590a7935277b48f3d8b6fb9c5b4d276 + checksum: 10c0/7688fdce37205e7f3b448039df216e103e3a52994af0201993e22decbb558d129a734001b991f3c3d80bf4a4ef91ca6a5665a7395d5b051249da60a0016eda36 languageName: node linkType: hard diff --git a/scripts/yarn.lock b/scripts/yarn.lock index e4e3dcb16584..3f740c74a6a4 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -83,11 +83,9 @@ __metadata: linkType: hard "@babel/helper-environment-visitor@npm:^7.22.20": - version: 7.24.7 - resolution: "@babel/helper-environment-visitor@npm:7.24.7" - dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10c0/36ece78882b5960e2d26abf13cf15ff5689bf7c325b10a2895a74a499e712de0d305f8d78bb382dd3c05cfba7e47ec98fe28aab5674243e0625cd38438dd0b2d + version: 7.22.20 + resolution: "@babel/helper-environment-visitor@npm:7.22.20" + checksum: 10c0/e762c2d8f5d423af89bd7ae9abe35bd4836d2eb401af868a63bbb63220c513c783e25ef001019418560b3fdc6d9a6fb67e6c0b650bcdeb3a2ac44b5c3d2bdd94 languageName: node linkType: hard @@ -102,20 +100,20 @@ __metadata: linkType: hard "@babel/helper-hoist-variables@npm:^7.22.5": - version: 7.24.7 - resolution: "@babel/helper-hoist-variables@npm:7.24.7" + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10c0/19ee37563bbd1219f9d98991ad0e9abef77803ee5945fd85aa7aa62a67c69efca9a801696a1b58dda27f211e878b3327789e6fd2a6f6c725ccefe36774b5ce95 + "@babel/types": "npm:^7.22.5" + checksum: 10c0/60a3077f756a1cd9f14eb89f0037f487d81ede2b7cfe652ea6869cd4ec4c782b0fb1de01b8494b9a2d2050e3d154d7d5ad3be24806790acfb8cbe2073bf1e208 languageName: node linkType: hard "@babel/helper-split-export-declaration@npm:^7.22.6": - version: 7.24.7 - resolution: "@babel/helper-split-export-declaration@npm:7.24.7" + version: 7.22.6 + resolution: "@babel/helper-split-export-declaration@npm:7.22.6" dependencies: - "@babel/types": "npm:^7.24.7" - checksum: 10c0/0254577d7086bf09b01bbde98f731d4fcf4b7c3fa9634fdb87929801307c1f6202a1352e3faa5492450fa8da4420542d44de604daf540704ff349594a78184f6 + "@babel/types": "npm:^7.22.5" + checksum: 10c0/d83e4b623eaa9622c267d3c83583b72f3aac567dc393dda18e559d79187961cb29ae9c57b2664137fc3d19508370b12ec6a81d28af73a50e0846819cb21c6e44 languageName: node linkType: hard @@ -253,7 +251,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.23.0, @babel/types@npm:^7.8.3": +"@babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.8.3": version: 7.23.9 resolution: "@babel/types@npm:7.23.9" dependencies: @@ -4878,9 +4876,9 @@ __metadata: linkType: hard "diff-match-patch-es@npm:^0.1.0": - version: 0.1.1 - resolution: "diff-match-patch-es@npm:0.1.1" - checksum: 10c0/8bb602081c7bdefb1e2c5c346e7fb1f476a23a4accf6b6cf8d38ae6ed4f928ba3a87edb54dd517652ec0c813c95768da417ea9eea2c7098381d4e1265d5fecd0 + version: 0.1.0 + resolution: "diff-match-patch-es@npm:0.1.0" + checksum: 10c0/c456d10662506f676489c1572af2a48ad52d015a856b74bf16594d39f11c9a352cd763fd66b5a5952c86a18818f4b7de28d55876e7ffd47f5d71282e3a5056a2 languageName: node linkType: hard @@ -8935,7 +8933,14 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": +"lru-cache@npm:^10.0.1": + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 10c0/982dabfb227b9a2daf56d712ae0e72e01115a28c0a2068cd71277bca04568f3417bbf741c6c7941abc5c620fd8059e34f15607f90ebccbfa0a17533322d27a8e + languageName: node + linkType: hard + +"lru-cache@npm:^10.2.0": version: 10.2.2 resolution: "lru-cache@npm:10.2.2" checksum: 10c0/402d31094335851220d0b00985084288136136992979d0e015f0f1697e15d1c86052d7d53ae86b614e5b058425606efffc6969a31a091085d7a2b80a8a1e26d6 From 75f235a4bd67d2db69d98324236b9082992cbe50 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 9 Dec 2024 17:13:12 +0800 Subject: [PATCH 032/169] Fix merge conflict remnants --- MIGRATION.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 2b5ff2bcb9c6..7e46fa5bb1a2 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,10 +1,8 @@

Migration

- [From version 8.4.x to 8.5.x](#from-version-84x-to-85x) - <<<<<<< HEAD - - # [Added source code panel to docs](#added-source-code-panel-to-docs) + - [Added source code panel to docs](#added-source-code-panel-to-docs) - [Indexing behavior of @storybook/experimental-addon-test is changed](#indexing-behavior-of-storybookexperimental-addon-test-is-changed) - > > > > > > > next - [From version 8.2.x to 8.3.x](#from-version-82x-to-83x) - [Removed `experimental_SIDEBAR_BOTTOM` and deprecated `experimental_SIDEBAR_TOP` addon types](#removed-experimental_sidebar_bottom-and-deprecated-experimental_sidebar_top-addon-types) - [New parameters format for addon backgrounds](#new-parameters-format-for-addon-backgrounds) From f47acc5f023aef9c58c5b5678d2387c340b2577f Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 9 Dec 2024 11:24:35 +0100 Subject: [PATCH 033/169] add staticDirs test --- .../react/.storybook/main.ts | 1 + .../.storybook/test-static-dirs/static.js | 3 ++ .../react/stories/AddonTest.stories.tsx | 8 ++++++ .../react/yarn.lock | 28 +++++++++---------- 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 test-storybooks/portable-stories-kitchen-sink/react/.storybook/test-static-dirs/static.js diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts index 99ed3c65c752..44f0176bd4ab 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts @@ -19,5 +19,6 @@ const config: StorybookConfig = { border: 1px solid red; } `, + staticDirs: [{ from: './test-static-dirs', to:'test-static-dirs' }], }; export default config; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/test-static-dirs/static.js b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/test-static-dirs/static.js new file mode 100644 index 000000000000..56ff9f9c7ad4 --- /dev/null +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/test-static-dirs/static.js @@ -0,0 +1,3 @@ +// This file is used to test that staticDirs are correctly loaded in Vitest + +export const staticFunction = () => true; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx index 14c5835a11c1..73ebacd24561 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx @@ -74,3 +74,11 @@ export const PreviewHeadTest: Story = { expect(styles.borderColor).toBe('rgb(255, 0, 0)'); } }; + +export const StaticDirTest: Story = { + play: async () => { + const path = '/test-static-dirs/static.js'; + const { staticFunction } = await import(/* @vite-ignore */path); + expect(staticFunction()).toBe(true); + } +} diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 5a40e537d339..772af2e30b2e 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1792,11 +1792,11 @@ __metadata: linkType: soft "@storybook/components@file:../../../code/deprecated/components::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.17 - resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=88319a&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.18 + resolution: "@storybook/components@file:../../../code/deprecated/components#../../../code/deprecated/components::hash=aad2fe&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/d3e6ae03a1f331ae8e67e593d9f18f40fb2e3a8be4d8c8c495826ccb7b052775f68824371c514daaa87484182685007a636de76796ac1e5c26009407a7e6a64d + checksum: 10/44d4a8a54fd32d94b03dc9f29e2d68ca3c37156b56055b94493f5f626786a02349c195859c48b4f8fa25e209ce12f385305d601135f7e63bdc4541fa0645cae5 languageName: node linkType: hard @@ -1853,7 +1853,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.18 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=41f89a&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=981221&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -1876,7 +1876,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/dd243f2534f8e9a00f735f96b6448d3cc26271deac7efef318ab7447cf5241bdbe52dacab13d1f2512827762a7c09258f12919c63f2c32487b0c2b38010247b0 + checksum: 10/709f00e00e983596d59d024237264533f88a491d573dc50dbc5b6b774956a30c744e7bc4402d3101e89a2b8c188d271c3cb193e2febcd0dd5d39d9463c665673 languageName: node linkType: hard @@ -1909,20 +1909,20 @@ __metadata: linkType: soft "@storybook/manager-api@file:../../../code/deprecated/manager-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.17 - resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=98fa43&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.18 + resolution: "@storybook/manager-api@file:../../../code/deprecated/manager-api#../../../code/deprecated/manager-api::hash=c1892e&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/7276107e58c3598282d0359fce675b0eb95dd11792d2ec944caffcd5eb254b32b61d1900a74fd318ecc158959347aabae2642a3be6715f2ddcc9290a6468c05f + checksum: 10/405745f48728bfa4d8340fe2403bca0d60f803ed346c12d20a63ab9472ba1d8d1021aa12ee0fd36a6b41aec42d8c2a657acffeb9c8663aa32edcda490882e7f5 languageName: node linkType: hard "@storybook/preview-api@file:../../../code/deprecated/preview-api::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.17 - resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=a9de97&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.18 + resolution: "@storybook/preview-api@file:../../../code/deprecated/preview-api#../../../code/deprecated/preview-api::hash=0085a8&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/ac50a70d12304ab0661fdfdf7591d31d1dd943ac79f59cd554cff31f8dcc93de817256dabfff8f6d81db404d7ffcc46453e0cd2ef1983152f2668da618ebc4c9 + checksum: 10/29c5f7134b4300bac03c42f57c3138e24315516b23515893cfb4a144786327fb6e0a90d5470d951eb22e055466769fc9ad4577658afc7da43b60870c0d06e767 languageName: node linkType: hard @@ -2003,11 +2003,11 @@ __metadata: linkType: soft "@storybook/theming@file:../../../code/deprecated/theming::locator=portable-stories-react%40workspace%3A.": - version: 8.5.0-alpha.17 - resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=6cb022&locator=portable-stories-react%40workspace%3A." + version: 8.5.0-alpha.18 + resolution: "@storybook/theming@file:../../../code/deprecated/theming#../../../code/deprecated/theming::hash=dd5360&locator=portable-stories-react%40workspace%3A." peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 - checksum: 10/4b59447f28ca2682e24ab2cf62976fdaaea63c1aa97e687ec6da9e7865716d13439b8ea259aa742c8a0ede23f52025f57c7562f9acf794cddbe7c9a054bea069 + checksum: 10/8f8ecbd709ff4a8e0bafa19642497aad0d6ee40f2e613793a4248cb3825765783dd40eb57d180cb6cc4ad1f8acbd4e4a1a1b3448245b89e28581e25289c88c86 languageName: node linkType: hard From 0a5a607a6a4edc26bc0c60a08c7638ef6f3b1341 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 10 Dec 2024 08:46:45 +0100 Subject: [PATCH 034/169] add test for vitefinal --- .../react/.storybook/aliased.ts | 4 ++++ .../react/.storybook/main.ts | 13 +++++++++++++ .../react/stories/AddonTest.stories.tsx | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 test-storybooks/portable-stories-kitchen-sink/react/.storybook/aliased.ts diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/aliased.ts b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/aliased.ts new file mode 100644 index 000000000000..030574bfd2a6 --- /dev/null +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/aliased.ts @@ -0,0 +1,4 @@ +// This file is used to test that viteFinal is correctly loaded in Vitest +// main.ts defines this file as a resolve alias, which is used in the ViteFinalTest story + +export const aliasedFunction = () => true; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts index 44f0176bd4ab..513aed4aa06e 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/.storybook/main.ts @@ -1,4 +1,5 @@ import type { StorybookConfig } from "@storybook/react-vite"; +import { join } from 'path'; const config: StorybookConfig = { stories: ["../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"], @@ -20,5 +21,17 @@ const config: StorybookConfig = { } `, staticDirs: [{ from: './test-static-dirs', to:'test-static-dirs' }], + viteFinal: (config) => { + return { + ...config, + resolve: { + ...config.resolve, + alias: { + ...config.resolve?.alias, + 'test-alias': join(__dirname, 'aliased.ts'), + }, + } + }; + }, }; export default config; diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx index 73ebacd24561..650b091b33cb 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/AddonTest.stories.tsx @@ -82,3 +82,11 @@ export const StaticDirTest: Story = { expect(staticFunction()).toBe(true); } } + +export const ViteFinalTest: Story = { + play: async () => { + // @ts-expect-error TS doesn't know about the alias + const { aliasedFunction } = await import('test-alias'); + expect(aliasedFunction()).toBe(true); + } +} From 871eec73eb6ac9faf7722cb9ebc57668fca3f5c7 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 10 Dec 2024 08:56:33 +0100 Subject: [PATCH 035/169] Addon Onboarding: Prebundle react-confetti --- code/addons/onboarding/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 0fc9ef53a4ef..2265aa3ceff4 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -44,15 +44,13 @@ "check": "jiti ../../../scripts/prepare/check.ts", "prep": "jiti ../../../scripts/prepare/addon-bundle.ts" }, - "dependencies": { - "react-confetti": "^6.1.0" - }, "devDependencies": { "@radix-ui/react-dialog": "^1.0.5", "@storybook/icons": "^1.2.12", "@storybook/react": "workspace:*", "framer-motion": "^11.0.3", "react": "^18.2.0", + "react-confetti": "^6.1.0", "react-dom": "^18.2.0", "react-joyride": "^2.8.2", "react-use-measure": "^2.1.1", From 17a01ee3e4eb0291b534309052630c525cce6f1c Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 10 Dec 2024 13:36:45 +0100 Subject: [PATCH 036/169] cleanup --- .circleci/config.yml | 2 +- code/addons/test/src/vitest-plugin/index.ts | 1 - .../portable-stories-kitchen-sink/react/package.json | 3 ++- test-storybooks/portable-stories-kitchen-sink/react/yarn.lock | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e02ece3a5a2b..35c122f6c1ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -759,7 +759,7 @@ jobs: working_directory: test-storybooks/portable-stories-kitchen-sink/react - run: name: Run Vitest - command: yarn vitest-non-failing-tests + command: yarn vitest-skip-fail-on-purpose working_directory: test-storybooks/portable-stories-kitchen-sink/react - store_test_results: path: test-results diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index e517364d5aaa..eadadb4440e5 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -51,7 +51,6 @@ const getStoryGlobsAndFiles = async ( const stories = await presets.apply('stories', []); const docs = await presets.apply('docs', {}); const indexers = await presets.apply('experimental_indexers', []); - console.log('LOG: ', { docs }); const generator = new StoryIndexGenerator(normalizeStories(stories, directories), { ...directories, indexers, diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 9eca3e697aec..7b87c70aaabb 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -13,7 +13,8 @@ "playwright-e2e": "playwright test -c playwright-e2e.config.ts", "preview": "vite preview", "storybook": "storybook dev -p 6006", - "vitest": "echo 'not running'" + "vitest": "echo 'not running'", + "vitest-skip-fail-on-purpose": "SKIP_FAIL_ON_PURPOSE=true vitest run" }, "resolutions": { "@playwright/test": "1.48.1", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock index 74f18e5bf3cc..3a2b684b6bdd 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock +++ b/test-storybooks/portable-stories-kitchen-sink/react/yarn.lock @@ -1866,7 +1866,7 @@ __metadata: "@storybook/experimental-addon-test@file:../../../code/addons/test::locator=portable-stories-react%40workspace%3A.": version: 8.5.0-alpha.19 - resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=ddcffb&locator=portable-stories-react%40workspace%3A." + resolution: "@storybook/experimental-addon-test@file:../../../code/addons/test#../../../code/addons/test::hash=23a556&locator=portable-stories-react%40workspace%3A." dependencies: "@storybook/csf": "npm:0.1.12" "@storybook/global": "npm:^5.0.0" @@ -1889,7 +1889,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10/49c5969a6a4571df4aa7758b1d8f9335cc8b74bf410c5a151c3a64ea69faa5129c8b3122bc50fe2f1b32c12ea0be45c7de2422b54bcfe8cb0e34668ef79bfa86 + checksum: 10/5f3656017435bf80f6e50ee40991424321e723f21692ddaaa1aea408054106eb0f69ceed2dc55d9fc2c2bf2c1f9bd2574827b37c42e580af436fd535657103c1 languageName: node linkType: hard From 11a25dcb387736f50cf77ffe378fa1da7ecd4656 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 10 Dec 2024 14:03:27 +0100 Subject: [PATCH 037/169] cleanup --- .../react/stories/OtherComponent.stories.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx index e96da836ecd2..dd410fe9c748 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/OtherComponent.stories.tsx @@ -1,10 +1,5 @@ import { Meta, type StoryObj } from '@storybook/react' -declare global { - // eslint-disable-next-line no-var - var __vitest_browser__: boolean; -} - const Component = () => const meta = { From 4591ef9fee58f4c8d6fed5d8b3fc66479e1663e2 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Tue, 10 Dec 2024 14:31:45 +0100 Subject: [PATCH 038/169] Wait for 2 seconds before showing result mismatch warning --- code/addons/test/src/components/Panel.tsx | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/code/addons/test/src/components/Panel.tsx b/code/addons/test/src/components/Panel.tsx index 584872bad8c3..e18e26f2461d 100644 --- a/code/addons/test/src/components/Panel.tsx +++ b/code/addons/test/src/components/Panel.tsx @@ -114,6 +114,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId // local state const [scrollTarget, setScrollTarget] = useState(undefined); const [collapsed, setCollapsed] = useState>(new Set()); + const [hasResultMismatch, setResultMismatch] = useState(false); const { controlStates = INITIAL_CONTROL_STATES, @@ -252,22 +253,29 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId interactions.some((v) => v.status === CallStates.ERROR); const storyStatus = storyStatuses[storyId]?.[TEST_PROVIDER_ID]; + const storyTestStatus = storyStatus?.status; - const browserTestStatus = React.useMemo(() => { + const browserTestStatus = useMemo(() => { if (!isPlaying && (interactions.length > 0 || hasException)) { return hasException ? CallStates.ERROR : CallStates.DONE; } return isPlaying ? CallStates.ACTIVE : null; }, [isPlaying, interactions, hasException]); - const hasResultMismatch = React.useMemo(() => { - return ( - browserTestStatus !== null && - browserTestStatus !== CallStates.ACTIVE && - storyStatus?.status !== undefined && - statusMap[browserTestStatus] !== storyStatus.status - ); - }, [browserTestStatus, storyStatus]); + useEffect(() => { + const isMismatch = + browserTestStatus && + storyTestStatus && + storyTestStatus !== 'pending' && + storyTestStatus !== statusMap[browserTestStatus]; + + if (isMismatch) { + const timeout = setTimeout(() => setResultMismatch(true), 2000); + return () => clearTimeout(timeout); + } else { + setResultMismatch(false); + } + }, [browserTestStatus, storyTestStatus]); if (isErrored) { return ; From 23b983433e96014d44f1d01ee1c81aabeda2e0a4 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 10 Dec 2024 15:25:14 +0100 Subject: [PATCH 039/169] Core: Fix bundling of React --- code/core/assets/server/addon.tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/core/assets/server/addon.tsconfig.json b/code/core/assets/server/addon.tsconfig.json index 9161d5ff8254..97efabb3d68b 100644 --- a/code/core/assets/server/addon.tsconfig.json +++ b/code/core/assets/server/addon.tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "jsx": "react-jsx", + "jsx": "react", "jsxImportSource": "react" } -} +} \ No newline at end of file From 11628b25e879a28eab285b80eff6891cd87d23b0 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 10 Dec 2024 15:37:41 +0100 Subject: [PATCH 040/169] Run the a11y automigration on postInstall --- code/addons/a11y/package.json | 6 +++++- code/addons/a11y/src/postinstall.ts | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 code/addons/a11y/src/postinstall.ts diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index e1985c0961d7..87fcf78de2b0 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -38,7 +38,8 @@ }, "./manager": "./dist/manager.js", "./register": "./dist/manager.js", - "./package.json": "./package.json" + "./package.json": "./package.json", + "./postinstall": "./dist/postinstall.js" }, "main": "dist/index.js", "module": "dist/index.mjs", @@ -87,6 +88,9 @@ ], "previewEntries": [ "./src/preview.tsx" + ], + "nodeEntries": [ + "./src/postinstall.ts" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts new file mode 100644 index 000000000000..068e75e67505 --- /dev/null +++ b/code/addons/a11y/src/postinstall.ts @@ -0,0 +1,14 @@ +import { JsPackageManagerFactory } from 'storybook/internal/common'; + +import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add'; + +export default async function postInstall(options: PostinstallOptions) { + const packageManager = JsPackageManagerFactory.getPackageManager({ + force: options.packageManager, + }); + + await packageManager.executeCommand({ + command: 'npx', + args: ['storybook', 'automigrate', 'addonA11yAddonTest'], + }); +} From ba51dda03d3a95530160e1223a8fc5af570528f1 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 10 Dec 2024 15:48:07 +0100 Subject: [PATCH 041/169] Add typesVersions support for TypeScript definitions in a11y package --- code/addons/a11y/package.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 08d64b7d4f40..028e22000e59 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -43,6 +43,16 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", From dc094300e38f26e8788c4e3e6fd783b5b1c69044 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 10 Dec 2024 16:52:47 +0100 Subject: [PATCH 042/169] Use spawn instead --- code/addons/a11y/src/postinstall.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts index 068e75e67505..b0fbbfac8678 100644 --- a/code/addons/a11y/src/postinstall.ts +++ b/code/addons/a11y/src/postinstall.ts @@ -1,14 +1,12 @@ -import { JsPackageManagerFactory } from 'storybook/internal/common'; +import { spawn } from 'child_process'; -import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add'; - -export default async function postInstall(options: PostinstallOptions) { - const packageManager = JsPackageManagerFactory.getPackageManager({ - force: options.packageManager, - }); - - await packageManager.executeCommand({ - command: 'npx', - args: ['storybook', 'automigrate', 'addonA11yAddonTest'], +export default async function postInstall() { + await new Promise((resolve) => { + const child = spawn('npx', ['storybook', 'automigrate', 'addonA11yAddonTest'], { + stdio: 'inherit', + }); + child.on('close', (code) => { + resolve(); + }); }); } From cb1ba8e60db1a6a5c784e22f02e270b1bc0ff6b1 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Wed, 11 Dec 2024 09:39:40 +0100 Subject: [PATCH 043/169] Use textMutedColor rather than barTextColor where this is contextually more appropriate --- code/addons/test/src/components/ContextMenuItem.tsx | 2 +- code/addons/test/src/components/Description.tsx | 2 +- code/core/src/components/components/Loader/Loader.tsx | 2 +- code/core/src/components/components/tooltip/ListItem.tsx | 2 +- code/core/src/manager/components/sidebar/LegacyRender.tsx | 2 +- code/core/src/manager/components/sidebar/SearchResults.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/addons/test/src/components/ContextMenuItem.tsx b/code/addons/test/src/components/ContextMenuItem.tsx index 52c3b98061f9..229a396b5388 100644 --- a/code/addons/test/src/components/ContextMenuItem.tsx +++ b/code/addons/test/src/components/ContextMenuItem.tsx @@ -67,7 +67,7 @@ export const ContextMenuItem: FC<{ padding="small" disabled={state.crashed || isDisabled} > - + } /> diff --git a/code/addons/test/src/components/Description.tsx b/code/addons/test/src/components/Description.tsx index a94b775b5c95..dea5ec322b9f 100644 --- a/code/addons/test/src/components/Description.tsx +++ b/code/addons/test/src/components/Description.tsx @@ -12,7 +12,7 @@ export const Wrapper = styled.div(({ theme }) => ({ whiteSpace: 'nowrap', textOverflow: 'ellipsis', fontSize: theme.typography.size.s1, - color: theme.barTextColor, + color: theme.textMutedColor, })); const PositiveText = styled.span(({ theme }) => ({ diff --git a/code/core/src/components/components/Loader/Loader.tsx b/code/core/src/components/components/Loader/Loader.tsx index 26d01ad3f05d..dace42a9b351 100644 --- a/code/core/src/components/components/Loader/Loader.tsx +++ b/code/core/src/components/components/Loader/Loader.tsx @@ -63,7 +63,7 @@ const ProgressBar = styled.div(({ theme }) => ({ const ProgressMessage = styled.div(({ theme }) => ({ minHeight: '2em', fontSize: `${theme.typography.size.s1}px`, - color: theme.barTextColor, + color: theme.textMutedColor, })); const ErrorIcon = styled(LightningOffIcon)(({ theme }) => ({ diff --git a/code/core/src/components/components/tooltip/ListItem.tsx b/code/core/src/components/components/tooltip/ListItem.tsx index 2a93287af503..10e513cc1b6b 100644 --- a/code/core/src/components/components/tooltip/ListItem.tsx +++ b/code/core/src/components/components/tooltip/ListItem.tsx @@ -40,7 +40,7 @@ const Title = styled(({ active, loading, disabled, ...rest }: TitleProps) => disabled ? { - color: transparentize(0.7, theme.color.defaultText), + color: theme.textMutedColor, } : {} ); diff --git a/code/core/src/manager/components/sidebar/LegacyRender.tsx b/code/core/src/manager/components/sidebar/LegacyRender.tsx index 82bc83bd1b34..f8afa4317f7f 100644 --- a/code/core/src/manager/components/sidebar/LegacyRender.tsx +++ b/code/core/src/manager/components/sidebar/LegacyRender.tsx @@ -32,7 +32,7 @@ const TitleWrapper = styled.div<{ crashed?: boolean }>(({ crashed, theme }) => ( const DescriptionWrapper = styled.div(({ theme }) => ({ fontSize: theme.typography.size.s1, - color: theme.barTextColor, + color: theme.textMutedColor, })); const Progress = styled(ProgressSpinner)({ diff --git a/code/core/src/manager/components/sidebar/SearchResults.tsx b/code/core/src/manager/components/sidebar/SearchResults.tsx index 7573befe34a1..b7689b7d64d0 100644 --- a/code/core/src/manager/components/sidebar/SearchResults.tsx +++ b/code/core/src/manager/components/sidebar/SearchResults.tsx @@ -70,7 +70,7 @@ const NoResults = styled.div(({ theme }) => ({ lineHeight: `18px`, color: theme.color.defaultText, small: { - color: theme.barTextColor, + color: theme.textMutedColor, fontSize: `${theme.typography.size.s1}px`, }, })); From 212f83ae0ad980500601819218abc314be2a06c8 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Wed, 11 Dec 2024 09:48:34 +0100 Subject: [PATCH 044/169] Indicate when an option is disabled using color and a suffix --- .../src/components/TestProviderRender.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/code/addons/test/src/components/TestProviderRender.tsx b/code/addons/test/src/components/TestProviderRender.tsx index 017ecc2cf27f..6878c37e3f06 100644 --- a/code/addons/test/src/components/TestProviderRender.tsx +++ b/code/addons/test/src/components/TestProviderRender.tsx @@ -76,6 +76,16 @@ const StopIcon = styled(StopAltIcon)({ width: 10, }); +const ItemTitle = styled.span<{ enabled?: boolean }>( + ({ enabled, theme }) => + !enabled && { + color: theme.textMutedColor, + '&:after': { + content: '" (disabled)"', + }, + } +); + const statusOrder: TestStatus[] = ['failed', 'warning', 'pending', 'passed', 'skipped']; const statusMap: Record['status']> = { failed: 'negative', @@ -233,7 +243,7 @@ export const TestProviderRender: FC< /> Coverage} icon={} right={ Accessibility} icon={} right={ {coverageSummary ? ( Coverage} href={'/coverage/index.html'} // @ts-expect-error ListItem doesn't include all anchor attributes in types, but it is an achor element target="_blank" @@ -300,13 +310,13 @@ export const TestProviderRender: FC< /> ) : ( Coverage} icon={} /> )} {isA11yAddon && ( Accessibility} onClick={ (a11yStatus === 'negative' || a11yStatus === 'warning') && a11yResults.length ? () => { From 4711d6b85d012fed1e5587341851144e73ea2302 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 11 Dec 2024 10:52:52 +0100 Subject: [PATCH 045/169] Build: Improve task command and error message --- scripts/task.ts | 39 +++++++++++++++++++++------------------ scripts/tasks/sandbox.ts | 24 ++++++++++++++++++++---- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/scripts/task.ts b/scripts/task.ts index 69c949254b32..be856bafb3ea 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -3,6 +3,7 @@ import { outputFile, pathExists, readFile } from 'fs-extra'; import type { TestCase } from 'junit-xml'; import { getJunitXml } from 'junit-xml'; import { join, resolve } from 'path'; +import picocolors from 'picocolors'; import { prompt } from 'prompts'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; @@ -101,7 +102,7 @@ export const tasks = { bench, 'vitest-integration': vitestTests, }; -type TaskKey = keyof typeof tasks; +export type TaskKey = keyof typeof tasks; function isSandboxTask(taskKey: TaskKey) { return !['install', 'compile', 'publish', 'run-registry', 'check', 'sync-docs'].includes(taskKey); @@ -179,7 +180,7 @@ export const options = createOptions({ }, }); -export type PassedOptionValues = Omit, 'task' | 'startFrom' | 'junit'>; +export type PassedOptionValues = Omit, 'startFrom' | 'junit'>; const logger = console; @@ -347,7 +348,8 @@ async function run() { const allOptionValues = await getOptionsOrPrompt('yarn task', options); - const { task: taskKey, startFrom, junit, ...optionValues } = allOptionValues; + const { junit, startFrom, ...optionValues } = allOptionValues; + const taskKey = optionValues.task; const finalTask = tasks[taskKey]; const { template: templateKey } = optionValues; @@ -363,7 +365,6 @@ async function run() { builtSandboxDir: templateKey && join(templateSandboxDir, 'storybook-static'), junitFilename: junit && getJunitFilename(taskKey), }; - const { sortedTasks, tasksThatDepend } = getTaskList(finalTask, details, optionValues); const sortedTasksReady = await Promise.all( sortedTasks.map((t) => t.ready(details, optionValues)) @@ -482,27 +483,29 @@ async function run() { } } catch (err) { invariant(err instanceof Error); - logger.error(`Error running task ${getTaskKey(task)}:`); + logger.error( + `Error running task ${picocolors.bold(getTaskKey(task))} for ${picocolors.bgMagenta(picocolors.bold(details.key))}:` + ); logger.error(JSON.stringify(err, null, 2)); if (process.env.CI) { - logger.error( - dedent` - To reproduce this error locally, run: + const separator = '\n--------------------------------------------\n'; + const reproduceMessage = dedent` + To reproduce this error locally, run: - ${getCommand('yarn task', options, { + ${picocolors.bold( + getCommand('yarn task', options, { ...allOptionValues, link: true, startFrom: 'auto', - })} - - Note this uses locally linking which in rare cases behaves differently to CI. For a closer match, run: - - ${getCommand('yarn task', options, { - ...allOptionValues, - startFrom: 'auto', - })}` - ); + }) + )} + + Note this uses locally linking which in rare cases behaves differently to CI. + For a closer match, add ${picocolors.bold('--no-link')} to the command above. + `; + + err.message += `\n${separator}${reproduceMessage}${separator}\n`; } controllers.forEach((controller) => { diff --git a/scripts/tasks/sandbox.ts b/scripts/tasks/sandbox.ts index 80b0a2bf1045..cbf8856e0373 100644 --- a/scripts/tasks/sandbox.ts +++ b/scripts/tasks/sandbox.ts @@ -5,7 +5,7 @@ import { join } from 'path'; import { promisify } from 'util'; import { now, saveBench } from '../bench/utils'; -import type { Task } from '../task'; +import type { Task, TaskKey } from '../task'; const logger = console; @@ -22,8 +22,24 @@ export const sandbox: Task = { return ['run-registry']; }, - async ready({ sandboxDir }) { - return pathExists(sandboxDir); + async ready({ sandboxDir }, { task: selectedTask }) { + // If the selected task requires the sandbox to exist, we check it. Else we always assume it needs to be created + // This avoids issues where you want to overwrite a sandbox and it will stop because it already exists + const tasksAfterSandbox: TaskKey[] = [ + 'vitest-integration', + 'test-runner', + 'test-runner-dev', + 'e2e-tests', + 'e2e-tests-dev', + 'smoke-test', + 'dev', + 'build', + 'serve', + 'chromatic', + 'bench', + ]; + const isSelectedTaskAfterSandboxCreation = tasksAfterSandbox.includes(selectedTask); + return isSelectedTaskAfterSandboxCreation && pathExists(sandboxDir); }, async run(details, options) { if (options.link && details.template.inDevelopment) { @@ -33,7 +49,7 @@ export const sandbox: Task = { options.link = false; } - if (await this.ready(details)) { + if (await this.ready(details, options)) { logger.info('🗑 Removing old sandbox dir'); await remove(details.sandboxDir); } From f6bdeee8fdb938300c5fc29f23aea0e37d29f953 Mon Sep 17 00:00:00 2001 From: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:07:19 +0100 Subject: [PATCH 046/169] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 123b5d5bbeac..88924927c8af 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,6 +8,6 @@ In the event of a high-risk vulnerability, we may backport the security fixes to ## Reporting a Vulnerability -To report a vulnerability, you can reach out to the maintainers directly on Twitter: https://twitter.com/storybookjs +To report a vulnerability, you can reach out to the maintainers directly on Twitter: https://twitter.com/storybookjs or Blueksky: https://bsky.app/profile/storybook.js.org When we fix a security issue, we will post a security advisory on Github/NPM, describe the change in the [release notes](https://github.com/storybookjs/storybook/releases), and also announce notify the community on [our Discord](https://discord.gg/storybook). From b24ab4831731a9f573becd8017a0f776845da0ef Mon Sep 17 00:00:00 2001 From: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:09:01 +0100 Subject: [PATCH 047/169] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 88924927c8af..ac75ea2100ff 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,6 +8,6 @@ In the event of a high-risk vulnerability, we may backport the security fixes to ## Reporting a Vulnerability -To report a vulnerability, you can reach out to the maintainers directly on Twitter: https://twitter.com/storybookjs or Blueksky: https://bsky.app/profile/storybook.js.org +To report a vulnerability, you can reach out to the maintainers directly on Twitter: https://twitter.com/storybookjs or Bluesky: https://bsky.app/profile/storybook.js.org When we fix a security issue, we will post a security advisory on Github/NPM, describe the change in the [release notes](https://github.com/storybookjs/storybook/releases), and also announce notify the community on [our Discord](https://discord.gg/storybook). From 21d7c3d2945f9bd58beaf6f9ebc644076fb990ed Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 11 Dec 2024 12:02:25 +0100 Subject: [PATCH 048/169] Use execa --- code/addons/a11y/package.json | 1 + code/addons/a11y/src/postinstall.ts | 19 +++-- code/yarn.lock | 124 +++++++++++++++++++++++++++- 3 files changed, 134 insertions(+), 10 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 87fcf78de2b0..a23849bc7ae1 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -65,6 +65,7 @@ "@storybook/global": "^5.0.0", "@storybook/icons": "^1.2.12", "@testing-library/react": "^14.0.0", + "execa": "^9.5.2", "picocolors": "^1.1.0", "pretty-format": "^29.7.0", "react": "^18.2.0", diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts index b0fbbfac8678..73597186338c 100644 --- a/code/addons/a11y/src/postinstall.ts +++ b/code/addons/a11y/src/postinstall.ts @@ -1,12 +1,13 @@ -import { spawn } from 'child_process'; +// eslint-disable-next-line depend/ban-dependencies +import { execa } from 'execa'; + +const $ = execa({ + preferLocal: true, + stdio: 'inherit', + // we stream the stderr to the console + reject: false, +}); export default async function postInstall() { - await new Promise((resolve) => { - const child = spawn('npx', ['storybook', 'automigrate', 'addonA11yAddonTest'], { - stdio: 'inherit', - }); - child.on('close', (code) => { - resolve(); - }); - }); + await $`storybook automigrate addonA11yAddonTest`; } diff --git a/code/yarn.lock b/code/yarn.lock index f0862ce5333e..129156cf23f6 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5403,6 +5403,13 @@ __metadata: languageName: node linkType: hard +"@sec-ant/readable-stream@npm:^0.4.1": + version: 0.4.1 + resolution: "@sec-ant/readable-stream@npm:0.4.1" + checksum: 10c0/64e9e9cf161e848067a5bf60cdc04d18495dc28bb63a8d9f8993e4dd99b91ad34e4b563c85de17d91ffb177ec17a0664991d2e115f6543e73236a906068987af + languageName: node + linkType: hard + "@sideway/address@npm:^4.1.3": version: 4.1.4 resolution: "@sideway/address@npm:4.1.4" @@ -5496,6 +5503,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/merge-streams@npm:^4.0.0": + version: 4.0.0 + resolution: "@sindresorhus/merge-streams@npm:4.0.0" + checksum: 10c0/482ee543629aa1933b332f811a1ae805a213681ecdd98c042b1c1b89387df63e7812248bb4df3910b02b3cc5589d3d73e4393f30e197c9dde18046ccd471fc6b + languageName: node + linkType: hard + "@storybook/addon-a11y@workspace:*, @storybook/addon-a11y@workspace:addons/a11y": version: 0.0.0-use.local resolution: "@storybook/addon-a11y@workspace:addons/a11y" @@ -5506,6 +5520,7 @@ __metadata: "@storybook/test": "workspace:*" "@testing-library/react": "npm:^14.0.0" axe-core: "npm:^4.2.0" + execa: "npm:^9.5.2" picocolors: "npm:^1.1.0" pretty-format: "npm:^29.7.0" react: "npm:^18.2.0" @@ -15392,6 +15407,26 @@ __metadata: languageName: node linkType: hard +"execa@npm:^9.5.2": + version: 9.5.2 + resolution: "execa@npm:9.5.2" + dependencies: + "@sindresorhus/merge-streams": "npm:^4.0.0" + cross-spawn: "npm:^7.0.3" + figures: "npm:^6.1.0" + get-stream: "npm:^9.0.0" + human-signals: "npm:^8.0.0" + is-plain-obj: "npm:^4.1.0" + is-stream: "npm:^4.0.1" + npm-run-path: "npm:^6.0.0" + pretty-ms: "npm:^9.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^4.0.0" + yoctocolors: "npm:^2.0.0" + checksum: 10c0/94782a6282e03253224406c29068d18f9095cc251a45d1f19ac3d8f2a9db2cbe32fb8ceb039db1451d8fce3531135a6c0c559f76d634f85416268fc4a6995365 + languageName: node + linkType: hard + "exectimer@npm:^2.2.2": version: 2.2.2 resolution: "exectimer@npm:2.2.2" @@ -15702,6 +15737,15 @@ __metadata: languageName: node linkType: hard +"figures@npm:^6.1.0": + version: 6.1.0 + resolution: "figures@npm:6.1.0" + dependencies: + is-unicode-supported: "npm:^2.0.0" + checksum: 10c0/9159df4264d62ef447a3931537de92f5012210cf5135c35c010df50a2169377581378149abfe1eb238bd6acbba1c0d547b1f18e0af6eee49e30363cedaffcfe4 + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -16556,6 +16600,16 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^9.0.0": + version: 9.0.1 + resolution: "get-stream@npm:9.0.1" + dependencies: + "@sec-ant/readable-stream": "npm:^0.4.1" + is-stream: "npm:^4.0.1" + checksum: 10c0/d70e73857f2eea1826ac570c3a912757dcfbe8a718a033fa0c23e12ac8e7d633195b01710e0559af574cbb5af101009b42df7b6f6b29ceec8dbdf7291931b948 + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.2": version: 1.0.2 resolution: "get-symbol-description@npm:1.0.2" @@ -17592,6 +17646,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^8.0.0": + version: 8.0.0 + resolution: "human-signals@npm:8.0.0" + checksum: 10c0/e4dac4f7d3eb791ed04129fc6a85bd454a9102d3e3b76c911d0db7057ebd60b2956b435b5b5712aec18960488ede3c21ef7c56e42cdd70760c0d84d3c05cd92e + languageName: node + linkType: hard + "humanize-ms@npm:^1.2.1": version: 1.2.1 resolution: "humanize-ms@npm:1.2.1" @@ -18372,7 +18433,7 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^4.0.0": +"is-plain-obj@npm:^4.0.0, is-plain-obj@npm:^4.1.0": version: 4.1.0 resolution: "is-plain-obj@npm:4.1.0" checksum: 10c0/32130d651d71d9564dc88ba7e6fda0e91a1010a3694648e9f4f47bb6080438140696d3e3e15c741411d712e47ac9edc1a8a9de1fe76f3487b0d90be06ac9975e @@ -18458,6 +18519,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^4.0.1": + version: 4.0.1 + resolution: "is-stream@npm:4.0.1" + checksum: 10c0/2706c7f19b851327ba374687bc4a3940805e14ca496dc672b9629e744d143b1ad9c6f1b162dece81c7bfbc0f83b32b61ccc19ad2e05aad2dd7af347408f60c7f + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -18492,6 +18560,13 @@ __metadata: languageName: node linkType: hard +"is-unicode-supported@npm:^2.0.0": + version: 2.1.0 + resolution: "is-unicode-supported@npm:2.1.0" + checksum: 10c0/a0f53e9a7c1fdbcf2d2ef6e40d4736fdffff1c9f8944c75e15425118ff3610172c87bf7bc6c34d3903b04be59790bb2212ddbe21ee65b5a97030fc50370545a5 + languageName: node + linkType: hard + "is-weakmap@npm:^2.0.1": version: 2.0.1 resolution: "is-weakmap@npm:2.0.1" @@ -22103,6 +22178,16 @@ __metadata: languageName: node linkType: hard +"npm-run-path@npm:^6.0.0": + version: 6.0.0 + resolution: "npm-run-path@npm:6.0.0" + dependencies: + path-key: "npm:^4.0.0" + unicorn-magic: "npm:^0.3.0" + checksum: 10c0/b223c8a0dcd608abf95363ea5c3c0ccc3cd877daf0102eaf1b0f2390d6858d8337fbb7c443af2403b067a7d2c116d10691ecd22ab3c5273c44da1ff8d07753bd + languageName: node + linkType: hard + "npmlog@npm:^6.0.0": version: 6.0.2 resolution: "npmlog@npm:6.0.2" @@ -22847,6 +22932,13 @@ __metadata: languageName: node linkType: hard +"parse-ms@npm:^4.0.0": + version: 4.0.0 + resolution: "parse-ms@npm:4.0.0" + checksum: 10c0/a7900f4f1ebac24cbf5e9708c16fb2fd482517fad353aecd7aefb8c2ba2f85ce017913ccb8925d231770404780df46244ea6fec598b3bde6490882358b4d2d16 + languageName: node + linkType: hard + "parse-node-version@npm:^1.0.1": version: 1.0.1 resolution: "parse-node-version@npm:1.0.1" @@ -23689,6 +23781,15 @@ __metadata: languageName: node linkType: hard +"pretty-ms@npm:^9.0.0": + version: 9.2.0 + resolution: "pretty-ms@npm:9.2.0" + dependencies: + parse-ms: "npm:^4.0.0" + checksum: 10c0/ab6d066f90e9f77020426986e1b018369f41575674544c539aabec2e63a20fec01166d8cf6571d0e165ad11cfe5a8134a2a48a36d42ab291c59c6deca5264cbb + languageName: node + linkType: hard + "prettyjson@npm:^1.2.1": version: 1.2.5 resolution: "prettyjson@npm:1.2.5" @@ -27003,6 +27104,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^4.0.0": + version: 4.0.0 + resolution: "strip-final-newline@npm:4.0.0" + checksum: 10c0/b0cf2b62d597a1b0e3ebc42b88767f0a0d45601f89fd379a928a1812c8779440c81abba708082c946445af1d6b62d5f16e2a7cf4f30d9d6587b89425fae801ff + languageName: node + linkType: hard + "strip-indent@npm:^3.0.0": version: 3.0.0 resolution: "strip-indent@npm:3.0.0" @@ -28216,6 +28324,13 @@ __metadata: languageName: node linkType: hard +"unicorn-magic@npm:^0.3.0": + version: 0.3.0 + resolution: "unicorn-magic@npm:0.3.0" + checksum: 10c0/0a32a997d6c15f1c2a077a15b1c4ca6f268d574cf5b8975e778bb98e6f8db4ef4e86dfcae4e158cd4c7e38fb4dd383b93b13eefddc7f178dea13d3ac8a603271 + languageName: node + linkType: hard + "unified-args@npm:^11.0.0": version: 11.0.1 resolution: "unified-args@npm:11.0.1" @@ -30220,6 +30335,13 @@ __metadata: languageName: node linkType: hard +"yoctocolors@npm:^2.0.0": + version: 2.1.1 + resolution: "yoctocolors@npm:2.1.1" + checksum: 10c0/85903f7fa96f1c70badee94789fade709f9d83dab2ec92753d612d84fcea6d34c772337a9f8914c6bed2f5fc03a428ac5d893e76fab636da5f1236ab725486d0 + languageName: node + linkType: hard + "zimmerframe@npm:^1.1.2": version: 1.1.2 resolution: "zimmerframe@npm:1.1.2" From b1cc74dac1d86c517cdc50d2bb3bd83c8554bcaa Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 11 Dec 2024 12:25:50 +0100 Subject: [PATCH 049/169] Use local storybook binary instead --- code/addons/test/src/postinstall.ts | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index 55f97eb6b0da..bb22c7517127 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -16,7 +16,7 @@ import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; import { colors, logger } from 'storybook/internal/node-logger'; // eslint-disable-next-line depend/ban-dependencies -import { execa } from 'execa'; +import { $ } from 'execa'; import { findUp } from 'find-up'; import { dirname, extname, join, relative, resolve } from 'pathe'; import picocolors from 'picocolors'; @@ -227,22 +227,9 @@ export default async function postInstall(options: PostinstallOptions) { } if (shouldUninstall) { - await execa( - packageManager.getRemoteRunCommand(), - [ - 'storybook', - 'remove', - addonInteractionsName, - '--package-manager', - options.packageManager, - '--config-dir', - options.configDir, - ], - { - shell: true, - stdio: 'inherit', - } - ); + await $({ + stdio: 'inherit', + })`storybook remove ${addonInteractionsName} --package-manager ${options.packageManager} --config-dir ${options.configDir}`; } } From 41f52fab6044fbdee4a7f5ad66ace9cf05b2015c Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Wed, 11 Dec 2024 12:37:13 +0100 Subject: [PATCH 050/169] Refactor environment variable handling for Vitest integration --- code/addons/a11y/src/utils.ts | 24 +++++++-------------- code/addons/test/src/vitest-plugin/index.ts | 12 +++++------ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/code/addons/a11y/src/utils.ts b/code/addons/a11y/src/utils.ts index 0864a2e3b2f7..f0612d5dfc73 100644 --- a/code/addons/a11y/src/utils.ts +++ b/code/addons/a11y/src/utils.ts @@ -1,25 +1,17 @@ export function getIsVitestStandaloneRun() { try { - return process.env.VITEST_STORYBOOK === 'false'; - } catch { - try { - // @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. - return import.meta.env.VITEST_STORYBOOK === 'false'; - } catch (e) { - return false; - } + // @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. + return import.meta.env.VITEST_STORYBOOK === 'false'; + } catch (e) { + return false; } } export function getIsVitestRunning() { try { - return process?.env.MODE === 'test'; - } catch { - try { - // @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. - return import.meta.env.MODE === 'test'; - } catch (e) { - return false; - } + // @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. + return import.meta.env.MODE === 'test'; + } catch (e) { + return false; } } diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index eadadb4440e5..f7274cd9dc22 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -23,7 +23,6 @@ import sirv from 'sirv'; import { convertPathToPattern } from 'tinyglobby'; import { dedent } from 'ts-dedent'; -import { TestManager } from '../node/test-manager'; import type { InternalOptions, UserOptions } from './types'; const WORKING_DIR = process.cwd(); @@ -143,6 +142,10 @@ export const storybookTest = async (options?: UserOptions): Promise => { // plugin.name?.startsWith('vitest:browser') // ) + // We signal the test runner that we are not running it via Storybook + // We are overriding the environment variable to 'true' if vitest runs via @storybook/addon-test's backend + const vitestStorybook = process.env.VITEST_STORYBOOK ?? 'false'; + const baseConfig: Omit = { test: { setupFiles: [ @@ -162,9 +165,8 @@ export const storybookTest = async (options?: UserOptions): Promise => { ...storybookEnv, // To be accessed by the setup file __STORYBOOK_URL__: finalOptions.storybookUrl, - // We signal the test runner that we are not running it via Storybook - // We are overriding the environment variable to 'true' if vitest runs via @storybook/addon-test's backend - VITEST_STORYBOOK: 'false', + + VITEST_STORYBOOK: vitestStorybook, __VITEST_INCLUDE_TAGS__: finalOptions.tags.include.join(','), __VITEST_EXCLUDE_TAGS__: finalOptions.tags.exclude.join(','), __VITEST_SKIP_TAGS__: finalOptions.tags.skip.join(','), @@ -239,8 +241,6 @@ export const storybookTest = async (options?: UserOptions): Promise => { }, define: { - // polyfilling process.env.VITEST_STORYBOOK to 'false' in the browser - 'process.env.VITEST_STORYBOOK': JSON.stringify('false'), ...(frameworkName?.includes('vue3') ? { __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false' } : {}), From 36fab90e707f40dab05a42cf300d55d4fe44aa74 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 11 Dec 2024 12:49:21 +0100 Subject: [PATCH 051/169] Forward the yes flag --- code/addons/a11y/src/postinstall.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts index 73597186338c..9faaf6990b36 100644 --- a/code/addons/a11y/src/postinstall.ts +++ b/code/addons/a11y/src/postinstall.ts @@ -1,4 +1,5 @@ -// eslint-disable-next-line depend/ban-dependencies +import type { PostinstallOptions } from '@storybook/cli/src/add'; + import { execa } from 'execa'; const $ = execa({ @@ -8,6 +9,6 @@ const $ = execa({ reject: false, }); -export default async function postInstall() { - await $`storybook automigrate addonA11yAddonTest`; +export default async function postinstall(options: PostinstallOptions) { + await $`storybook automigrate addonA11yAddonTest ${options.yes ? '--yes' : ''}`; } From 750a57f27bc007f8b3e71f7a75b2dbdac6bd16a9 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 11 Dec 2024 13:10:50 +0100 Subject: [PATCH 052/169] fix: update error logging colors for task details --- scripts/task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/task.ts b/scripts/task.ts index be856bafb3ea..d35e1350d653 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -484,7 +484,7 @@ async function run() { } catch (err) { invariant(err instanceof Error); logger.error( - `Error running task ${picocolors.bold(getTaskKey(task))} for ${picocolors.bgMagenta(picocolors.bold(details.key))}:` + `Error running task ${picocolors.bold(getTaskKey(task))} for ${picocolors.bgCyan(picocolors.white(details.key))}:` ); logger.error(JSON.stringify(err, null, 2)); From 805e18ab5b3e1c01992d39f4a71a23c23186307b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 11 Dec 2024 13:24:12 +0100 Subject: [PATCH 053/169] fix #29785 --- code/addons/test/src/node/vitest-manager.ts | 5 ++++- code/addons/test/src/vitest-plugin/index.ts | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/addons/test/src/node/vitest-manager.ts b/code/addons/test/src/node/vitest-manager.ts index 7267f3dcea38..e7debf2c3fab 100644 --- a/code/addons/test/src/node/vitest-manager.ts +++ b/code/addons/test/src/node/vitest-manager.ts @@ -1,4 +1,5 @@ import { existsSync } from 'node:fs'; +import { dirname, join } from 'node:path'; import type { CoverageOptions, @@ -29,6 +30,8 @@ type TagsFilter = { skip: string[]; }; +const packageDir = dirname(require.resolve('@storybook/experimental-addon-test/package.json')); + export class VitestManager { vitest: Vitest | null = null; @@ -44,7 +47,7 @@ export class VitestManager { const { createVitest } = await import('vitest/node'); const storybookCoverageReporter: [string, StorybookCoverageReporterOptions] = [ - '@storybook/experimental-addon-test/internal/coverage-reporter', + join(packageDir, 'dist/node/coverage-reporter.js'), { testManager: this.testManager, coverageOptions: this.vitest?.config?.coverage as ResolvedCoverageOptions<'v8'>, diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index eadadb4440e5..b442d3afe797 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -1,4 +1,6 @@ /* eslint-disable no-underscore-dangle */ +import { dirname } from 'node:path'; + import type { Plugin } from 'vitest/config'; import { mergeConfig } from 'vitest/config'; import type { ViteUserConfig } from 'vitest/config'; @@ -63,6 +65,8 @@ const getStoryGlobsAndFiles = async ( }; }; +const packageDir = dirname(require.resolve('@storybook/experimental-addon-test/package.json')); + export const storybookTest = async (options?: UserOptions): Promise => { const finalOptions = { ...defaultOptions, @@ -146,15 +150,15 @@ export const storybookTest = async (options?: UserOptions): Promise => { const baseConfig: Omit = { test: { setupFiles: [ - '@storybook/experimental-addon-test/internal/setup-file', + join(packageDir, 'dist/vitest-plugin/setup-file.mjs'), // if the existing setupFiles is a string, we have to include it otherwise we're overwriting it typeof inputConfig_DoNotMutate.test?.setupFiles === 'string' && inputConfig_DoNotMutate.test?.setupFiles, - ].filter(Boolean), + ].filter(Boolean) as string[], ...(finalOptions.storybookScript ? { - globalSetup: ['@storybook/experimental-addon-test/internal/global-setup'], + globalSetup: [join(packageDir, './dist/vitest-plugin/global-setup.mjs')], } : {}), From 67bf4f6e1ae0cf9db94c4965aa99639f4e47fd81 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Wed, 11 Dec 2024 13:26:00 +0100 Subject: [PATCH 054/169] Addon A11y: Update accessibility status handling in TestProviderRender --- .../test/src/components/TestProviderRender.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/addons/test/src/components/TestProviderRender.tsx b/code/addons/test/src/components/TestProviderRender.tsx index 017ecc2cf27f..d84ea249cdd6 100644 --- a/code/addons/test/src/components/TestProviderRender.tsx +++ b/code/addons/test/src/components/TestProviderRender.tsx @@ -118,6 +118,10 @@ export const TestProviderRender: FC< }, [isA11yAddon, state.details?.testResults, entryId]); const a11yStatus = useMemo<'positive' | 'warning' | 'negative' | 'unknown'>(() => { + if (state.running) { + return 'unknown'; + } + if (!isA11yAddon || config.a11y === false) { return 'unknown'; } @@ -136,7 +140,7 @@ export const TestProviderRender: FC< } return 'positive'; - }, [a11yResults, isA11yAddon, config.a11y]); + }, [state.running, isA11yAddon, config.a11y, a11yResults]); const a11yNotPassedAmount = a11yResults?.filter( (result) => result?.status === 'failed' || result?.status === 'warning' @@ -154,7 +158,11 @@ export const TestProviderRender: FC< }) .sort((a, b) => statusOrder.indexOf(a.status) - statusOrder.indexOf(b.status)); - const status = (state.failed ? 'failed' : results[0]?.status) || 'unknown'; + const status = state.running + ? 'unknown' + : state.failed + ? 'failed' + : (results[0]?.status ?? 'unknown'); const openPanel = (id: string, panelId: string) => { api.selectStory(id); From 69bcbaad18700c1459d8a6691ac20c676a498a83 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Wed, 11 Dec 2024 13:46:06 +0100 Subject: [PATCH 055/169] Handle telemetry where we determine the test discrepancy, not in the UI --- .../components/InteractionsPanel.stories.tsx | 1 - .../test/src/components/InteractionsPanel.tsx | 12 +------ code/addons/test/src/components/Panel.tsx | 31 ++++++++++++++----- .../TestDiscrepancyMessage.stories.tsx | 3 -- .../src/components/TestDiscrepancyMessage.tsx | 30 +++++------------- 5 files changed, 32 insertions(+), 45 deletions(-) diff --git a/code/addons/test/src/components/InteractionsPanel.stories.tsx b/code/addons/test/src/components/InteractionsPanel.stories.tsx index 24eefed2028c..f8cabbe24d53 100644 --- a/code/addons/test/src/components/InteractionsPanel.stories.tsx +++ b/code/addons/test/src/components/InteractionsPanel.stories.tsx @@ -58,7 +58,6 @@ const meta = { endRef: null, // prop for the AddonPanel used as wrapper of Panel active: true, - storyId: 'story-id', }, } as Meta; diff --git a/code/addons/test/src/components/InteractionsPanel.tsx b/code/addons/test/src/components/InteractionsPanel.tsx index 164e28b782fb..896350b926c7 100644 --- a/code/addons/test/src/components/InteractionsPanel.tsx +++ b/code/addons/test/src/components/InteractionsPanel.tsx @@ -44,8 +44,6 @@ interface InteractionsPanelProps { onScrollToEnd?: () => void; hasResultMismatch?: boolean; browserTestStatus?: CallStates; - storyId: StoryId; - testRunId: string; } const Container = styled.div(({ theme }) => ({ @@ -105,20 +103,12 @@ export const InteractionsPanel: React.FC = React.memo( endRef, hasResultMismatch, browserTestStatus, - storyId, - testRunId, }) { const filter = useAnsiToHtmlFilter(); return ( - {hasResultMismatch && ( - - )} + {hasResultMismatch && } {(interactions.length > 0 || hasException) && ( (function PanelMemoized({ storyId interactionsCount: list.filter(({ method }) => method !== 'step').length, }; }); - }, [collapsed]); + }, [set, collapsed]); const controls = useMemo( () => ({ @@ -240,7 +240,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId emit(FORCE_REMOUNT, { storyId }); }, }), - [storyId] + [emit, storyId] ); const storyFilePath = useParameter('fileName', ''); @@ -262,6 +262,8 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId return isPlaying ? CallStates.ACTIVE : null; }, [isPlaying, interactions, hasException]); + const { testRunId } = storyStatus?.data || {}; + useEffect(() => { const isMismatch = browserTestStatus && @@ -270,12 +272,29 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId storyTestStatus !== statusMap[browserTestStatus]; if (isMismatch) { - const timeout = setTimeout(() => setResultMismatch(true), 2000); + const timeout = setTimeout( + () => + setResultMismatch((currentValue) => { + if (!currentValue) { + emit(STORYBOOK_ADDON_TEST_CHANNEL, { + type: 'test-discrepancy', + payload: { + browserStatus: browserTestStatus === CallStates.DONE ? 'PASS' : 'FAIL', + cliStatus: browserTestStatus === CallStates.DONE ? 'FAIL' : 'PASS', + storyId, + testRunId, + }, + }); + } + return true; + }), + 2000 + ); return () => clearTimeout(timeout); } else { setResultMismatch(false); } - }, [browserTestStatus, storyTestStatus]); + }, [emit, browserTestStatus, storyTestStatus, storyId, testRunId]); if (isErrored) { return ; @@ -298,8 +317,6 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId pausedAt={pausedAt} endRef={endRef} onScrollToEnd={scrollTarget && scrollToTarget} - storyId={storyId} - testRunId={storyStatus?.data?.testRunId} /> ); diff --git a/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx b/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx index 840c08cdf3d3..81553cdc5a32 100644 --- a/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx +++ b/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx @@ -23,9 +23,6 @@ export default { parameters: { layout: 'fullscreen', }, - args: { - storyId: 'story-id', - }, decorators: [ (storyFn) => ( {storyFn()} diff --git a/code/addons/test/src/components/TestDiscrepancyMessage.tsx b/code/addons/test/src/components/TestDiscrepancyMessage.tsx index bbdf74e36a65..b23af4a7be6a 100644 --- a/code/addons/test/src/components/TestDiscrepancyMessage.tsx +++ b/code/addons/test/src/components/TestDiscrepancyMessage.tsx @@ -33,39 +33,23 @@ const Wrapper = styled.div(({ theme: { color, typography, background } }) => ({ interface TestDiscrepancyMessageProps { browserTestStatus: CallStates; - storyId: StoryId; - testRunId: string; } -export const TestDiscrepancyMessage = ({ - browserTestStatus, - storyId, - testRunId, -}: TestDiscrepancyMessageProps) => { + +export const TestDiscrepancyMessage = ({ browserTestStatus }: TestDiscrepancyMessageProps) => { const api = useStorybookApi(); const docsUrl = api.getDocsUrl({ subpath: DOCUMENTATION_DISCREPANCY_LINK, versioned: true, renderer: true, }); - const message = `This component test passed in ${browserTestStatus === CallStates.DONE ? 'this browser' : 'CLI'}, but the tests failed in ${browserTestStatus === CallStates.ERROR ? 'this browser' : 'CLI'}.`; - - useEffect( - () => - api.emit(STORYBOOK_ADDON_TEST_CHANNEL, { - type: 'test-discrepancy', - payload: { - browserStatus: browserTestStatus === CallStates.DONE ? 'PASS' : 'FAIL', - cliStatus: browserTestStatus === CallStates.DONE ? 'FAIL' : 'PASS', - storyId, - testRunId, - }, - }), - [api, browserTestStatus, storyId, testRunId] - ); + const [passed, failed] = + browserTestStatus === CallStates.ERROR + ? ['the CLI', 'this browser'] + : ['this browser', 'the CLI']; return ( - {message}{' '} + This component test passed in {passed}, but the tests failed in {failed}.{' '} Learn what could cause this From b83343b1732df76a32883586d8258da1514ddf5b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 11 Dec 2024 14:01:34 +0100 Subject: [PATCH 056/169] Fix eslint --- code/addons/a11y/src/postinstall.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts index 9faaf6990b36..9a64796f5e1b 100644 --- a/code/addons/a11y/src/postinstall.ts +++ b/code/addons/a11y/src/postinstall.ts @@ -1,5 +1,6 @@ import type { PostinstallOptions } from '@storybook/cli/src/add'; +// eslint-disable-next-line depend/ban-dependencies import { execa } from 'execa'; const $ = execa({ From aa75a9877380a60d30c057886639675f69596bdd Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 11 Dec 2024 14:20:10 +0100 Subject: [PATCH 057/169] remove existing test.include config --- code/addons/test/src/vitest-plugin/index.ts | 31 ++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index eadadb4440e5..84dbbadd20c0 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -124,7 +124,7 @@ export const storybookTest = async (options?: UserOptions): Promise => { .replace('', `${headHtmlSnippet ?? ''}`) .replace('', `${bodyHtmlSnippet ?? ''}`); }, - async config(inputConfig_DoNotMutate) { + async config(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED) { // ! We're not mutating the input config, instead we're returning a new partial config // ! see https://vite.dev/guide/api-plugin.html#config try { @@ -148,8 +148,9 @@ export const storybookTest = async (options?: UserOptions): Promise => { setupFiles: [ '@storybook/experimental-addon-test/internal/setup-file', // if the existing setupFiles is a string, we have to include it otherwise we're overwriting it - typeof inputConfig_DoNotMutate.test?.setupFiles === 'string' && - inputConfig_DoNotMutate.test?.setupFiles, + typeof inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test + ?.setupFiles === 'string' && + inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.setupFiles, ].filter(Boolean), ...(finalOptions.storybookScript @@ -175,7 +176,8 @@ export const storybookTest = async (options?: UserOptions): Promise => { .map((path) => convertPathToPattern(path)), // if the existing deps.inline is true, we keep it as-is, because it will inline everything - ...(inputConfig_DoNotMutate.test?.server?.deps?.inline !== true + ...(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.server?.deps + ?.inline !== true ? { server: { deps: { @@ -186,7 +188,7 @@ export const storybookTest = async (options?: UserOptions): Promise => { : {}), browser: { - ...inputConfig_DoNotMutate.test?.browser, + ...inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.browser, commands: { getInitialGlobals: () => { const envConfig = JSON.parse(process.env.VITEST_STORYBOOK_CONFIG ?? '{}'); @@ -203,8 +205,9 @@ export const storybookTest = async (options?: UserOptions): Promise => { }, }, // if there is a test.browser config AND test.browser.screenshotFailures is not explicitly set, we set it to false - ...(inputConfig_DoNotMutate.test?.browser && - inputConfig_DoNotMutate.test.browser.screenshotFailures === undefined + ...(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.browser && + inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test.browser + .screenshotFailures === undefined ? { screenshotFailures: false, } @@ -213,7 +216,11 @@ export const storybookTest = async (options?: UserOptions): Promise => { }, envPrefix: Array.from( - new Set([...(inputConfig_DoNotMutate.envPrefix || []), 'STORYBOOK_', 'VITE_']) + new Set([ + ...(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.envPrefix || []), + 'STORYBOOK_', + 'VITE_', + ]) ), resolve: { @@ -254,8 +261,12 @@ export const storybookTest = async (options?: UserOptions): Promise => { ); // alert the user of problems - if (inputConfig_DoNotMutate.test.include?.length > 0) { - console.warn( + if ( + inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test.include?.length > 0 + ) { + // remove the user's existing include, because we're replacing it with our own heuristic based on main.ts#stories + inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test.include = []; + console.log( picocolors.yellow(dedent` Warning: Starting in Storybook 8.5.0-alpha.18, the "test.include" option in Vitest is discouraged in favor of just using the "stories" field in your Storybook configuration. From 9a680a3166672b182c36d288d1277a6cfbb79c9a Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 11 Dec 2024 14:25:13 +0100 Subject: [PATCH 058/169] remove unnecessary test.include in test kitchen sink --- .../portable-stories-kitchen-sink/react/vitest.workspace.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts b/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts index f1657f3acddd..041918fb126d 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts +++ b/test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts @@ -10,9 +10,6 @@ export default defineWorkspace([ test: { name: "storybook", pool: "threads", - include: [ - "stories/AddonTest.stories.?(c|m)[jt]s?(x)", - ], deps: { optimizer: { web: { @@ -30,4 +27,4 @@ export default defineWorkspace([ environment: "happy-dom", }, }, -]); \ No newline at end of file +]); From 63ddc885a15aedddc062235f586144cd7397a682 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 11 Dec 2024 15:09:35 +0100 Subject: [PATCH 059/169] Update code/addons/test/src/vitest-plugin/index.ts --- code/addons/test/src/vitest-plugin/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/test/src/vitest-plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts index b442d3afe797..c95f4b26269e 100644 --- a/code/addons/test/src/vitest-plugin/index.ts +++ b/code/addons/test/src/vitest-plugin/index.ts @@ -158,7 +158,7 @@ export const storybookTest = async (options?: UserOptions): Promise => { ...(finalOptions.storybookScript ? { - globalSetup: [join(packageDir, './dist/vitest-plugin/global-setup.mjs')], + globalSetup: [join(packageDir, 'dist/vitest-plugin/global-setup.mjs')], } : {}), From 5cfb8329a0bced77a7473c012c0e1f6143506195 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 11 Dec 2024 15:21:58 +0100 Subject: [PATCH 060/169] change to use pathe Co-authored-by: Jeppe Reinhold Co-authored-by: Jeppe Reinhold --- code/addons/test/src/node/vitest-manager.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/addons/test/src/node/vitest-manager.ts b/code/addons/test/src/node/vitest-manager.ts index e7debf2c3fab..10700b97f71b 100644 --- a/code/addons/test/src/node/vitest-manager.ts +++ b/code/addons/test/src/node/vitest-manager.ts @@ -1,5 +1,4 @@ import { existsSync } from 'node:fs'; -import { dirname, join } from 'node:path'; import type { CoverageOptions, @@ -15,7 +14,7 @@ import type { TestingModuleRunRequestPayload } from 'storybook/internal/core-eve import type { DocsIndexEntry, StoryIndex, StoryIndexEntry } from '@storybook/types'; -import path, { normalize } from 'pathe'; +import path, { dirname, join, normalize } from 'pathe'; import slash from 'slash'; import { COVERAGE_DIRECTORY, type Config } from '../constants'; From 6fb17c9ab97ced368a5e6ef22195567ea15f43a6 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Wed, 11 Dec 2024 23:30:25 -0700 Subject: [PATCH 061/169] Docs updates for Storybook Test - Focused tests - Coverage - A11y - Remove `test.include` & `test.isolate` from example Vitest configs - Streamline Test addon introduction - Address feedback from EAP --- MIGRATION.md | 8 +- .../vitest-plugin-vitest-config-alias.md | 2 + docs/_snippets/vitest-plugin-vitest-config.md | 24 +- .../vitest-plugin-vitest-workspace.md | 18 -- docs/writing-tests/accessibility-testing.mdx | 82 ++++-- docs/writing-tests/test-addon.mdx | 93 +++++-- docs/writing-tests/test-coverage.mdx | 240 +++++++++++++++++- 7 files changed, 368 insertions(+), 99 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index fd3ce9e10be5..58b42f10c0aa 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -427,12 +427,14 @@ ### Addon-a11y: Component test integration -In Storybook 8.4, we introduced a new addon called [addon test](https://storybook.js.org/docs/writing-tests/test-addon). Powered by Vitest under the hood, this addon lets you watch, run, and debug your component tests directly in Storybook. +In Storybook 8.4, we introduced the [Test addon](https://storybook.js.org/docs/writing-tests/test-addon) (`@storybook/experimental-addon-test`). Powered by Vitest under the hood, this addon lets you watch, run, and debug your component tests directly in Storybook. -In Storybook 8.5, we revamped the Accessibility addon (`@storybook/addon-a11y`) to integrate it with the component tests feature. This means you can now extend your component tests to include accessibility tests. If you upgrade to Storybook 8.5 via `npx storybook@latest upgrade`, the Accessibility addon will be automatically configured to work with the component tests. However, if you're upgrading manually and you have the [addon test](https://storybook.js.org/docs/writing-tests/test-addon) installed, adjust your configuration as follows: +In Storybook 8.5, we revamped the [Accessibility addon](https://storybook.js.org/docs/writing-tests/accessibility-testing) (`@storybook/addon-a11y`) to integrate it with the component tests feature. This means you can now extend your component tests to include accessibility tests. + +If you upgrade to Storybook 8.5 via `npx storybook@latest upgrade`, the Accessibility addon will be automatically configured to work with the component tests. However, if you're upgrading manually and you have the Test addon installed, adjust your configuration as follows: ```diff -// .storybook/vitest.config.ts +// .storybook/vitest.setup.ts ... +import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview'; diff --git a/docs/_snippets/vitest-plugin-vitest-config-alias.md b/docs/_snippets/vitest-plugin-vitest-config-alias.md index 5777c37f2616..ac1f59857c72 100644 --- a/docs/_snippets/vitest-plugin-vitest-config-alias.md +++ b/docs/_snippets/vitest-plugin-vitest-config-alias.md @@ -17,6 +17,8 @@ export default { ``` ```js filename="vitest.config.ts" renderer="common" tabTitle="After" +import { defineConfig } from 'vitest/config'; + export default defineConfig({ // ... resolve: { diff --git a/docs/_snippets/vitest-plugin-vitest-config.md b/docs/_snippets/vitest-plugin-vitest-config.md index 4cd240e86a44..b3f271a6e636 100644 --- a/docs/_snippets/vitest-plugin-vitest-config.md +++ b/docs/_snippets/vitest-plugin-vitest-config.md @@ -18,8 +18,6 @@ export default mergeConfig( // storybookNextJsPlugin(), ], test: { - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -28,13 +26,9 @@ export default mergeConfig( provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, - }), + }) ); ``` @@ -57,8 +51,6 @@ export default mergeConfig( storybookVuePlugin(), ], test: { - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -67,13 +59,9 @@ export default mergeConfig( provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, - }), + }) ); ``` @@ -97,8 +85,6 @@ export default mergeConfig( // storybookSveltekitPlugin(), ], test: { - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -107,12 +93,8 @@ export default mergeConfig( provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, - }), + }) ); ``` diff --git a/docs/_snippets/vitest-plugin-vitest-workspace.md b/docs/_snippets/vitest-plugin-vitest-workspace.md index b4e9ba800211..46b5a3e22edd 100644 --- a/docs/_snippets/vitest-plugin-vitest-workspace.md +++ b/docs/_snippets/vitest-plugin-vitest-workspace.md @@ -20,8 +20,6 @@ export default defineWorkspace([ ], test: { name: 'storybook', - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -30,10 +28,6 @@ export default defineWorkspace([ provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, }, @@ -63,8 +57,6 @@ export default defineWorkspace([ ], test: { name: 'storybook', - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -73,10 +65,6 @@ export default defineWorkspace([ provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, }, @@ -107,8 +95,6 @@ export default defineWorkspace([ ], test: { name: 'storybook', - // Glob pattern to find story files - include: ['src/**/*.stories.?(m)[jt]s?(x)'], // Enable browser mode browser: { enabled: true, @@ -117,10 +103,6 @@ export default defineWorkspace([ provider: 'playwright', headless: true, }, - // Speed up tests and better match how they run in Storybook itself - // https://vitest.dev/config/#isolate - // Consider removing this if you have flaky tests - isolate: false, setupFiles: ['./.storybook/vitest.setup.ts'], }, }, diff --git a/docs/writing-tests/accessibility-testing.mdx b/docs/writing-tests/accessibility-testing.mdx index 7072edb154ad..a0eb50683630 100644 --- a/docs/writing-tests/accessibility-testing.mdx +++ b/docs/writing-tests/accessibility-testing.mdx @@ -67,17 +67,17 @@ If you need to dismiss an accessibility rule or modify its settings across all s #### Component-level a11y configuration - + - You can also customize your own set of rules for all stories of a component. If you're using Svelte CSF with the native templating syntax, you can update the `defineMeta` function or the default export of the CSF story and provide the required configuration: + You can also customize your own set of rules for all stories of a component. If you're using Svelte CSF with the native templating syntax, you can update the `defineMeta` function. If you're using regular CSF, you can update the default export of the story file. - + - + - You can also customize your own set of rules for all stories of a component. Update your story's default export and add parameters and globals with the required configuration: + You can also customize your own set of rules for all stories of a component. Update the story file's default export and add parameters and globals with the required configuration: - + {/* prettier-ignore-start */} @@ -97,17 +97,17 @@ Customize the a11y ruleset at the story level by updating your story to include #### Turn off automated a11y tests - + - If you are using Svelte CSF, you can turn off automated accessibility testing for stories or components by adding globals to your story or adjusting the defineMeta function with the required configuration. With a regular CSF story, you can add the following to your story's export or component's default export: + If you are using Svelte CSF, you can turn off automated accessibility testing for stories or components by adding globals to your story or adjusting the `defineMeta` function with the required configuration. With a regular CSF story, you can add the following to your story's export or component's default export: - + - + - Disable automated accessibility testing for stories or components by adding the following globals to your story’s export or component’s default export respectively: + Disable automated accessibility testing for stories or components by adding the following globals to your story’s export or component’s default export: - + {/* prettier-ignore-start */} @@ -120,43 +120,69 @@ Customize the a11y ruleset at the story level by updating your story to include ## Test addon integration -The accessibility addon provides seamless integration with Storybook's [test addon](./test-addon.mdx), enabling you to run automated accessibility checks for all your tests in the background while you run component tests. If there are any violations, the test will fail, and you will see the results in the sidebar without any additional setup. +The accessibility addon provides seamless integration with the [Test addon](./test-addon.mdx), enabling you to run automated accessibility checks for all your tests in the background while you run component tests. If there are any violations, the test will fail, and you will see the results in the sidebar without any additional setup. {/* TODO: add asset of the changed UI here */} ### Manual upgrade -If you enabled the addon and you're manually upgrading to Storybook 8.5 or later, you'll need to adjust your existing configuration (i.e., `.storybook/vitest.config.ts`) to enable the integration as follows: +If you enabled the addon and you're manually upgrading to Storybook 8.5 or later, you'll need to adjust your existing configuration (i.e., `.storybook/vitest.setup.ts`) to enable the integration as follows: -### Override accessibility violation levels +### Configure accessibility tests with the test addon -By default, when the accessibility addon runs with the test addon enabled, it interprets all violations as errors. This means that if a story has a minor accessibility violation, the test will fail. However, you can override this behavior by setting the `warnings` parameter in the `a11y` configuration object to define an array of impact levels that should be considered warnings. +Like the Test addon, the accessibility addon also supports [tags](../writing-stories/tags.mdx) to filter the tests you want to run. By default, the addon applies the `a11ytest` tag to all stories. If you need to exclude a story from being accessibility tested, you can remove that tag by applying the `!a11ytest` tag to the story. This also works at the project (in `.storybook/preview.js|ts`) or component level (default export in the story file). -{/* prettier-ignore-start */} +You can use tags to progressively work toward a more accessible UI by enabling accessibility tests for a subset of stories and gradually increasing the coverage. For example, a typical workflow might look like this: - +1. Run accessibility tests for your entire project. +1. Find that many stories have accessibility issues (and maybe feel a bit overwhelmed!). +1. Temporarily exclude all stories from accessibility tests. -{/* prettier-ignore-end */} + ```ts title=".storybook/preview.ts" + // Replace your-renderer with the renderer you are using (e.g., react, vue3) + import { Preview } from '@storybook/your-renderer'; + + const preview: Preview = { + // ... + // 👇 Temporarily remove the a11ytest tag from all stories + tags: ['!a11ytest'], + }; + + export default preview; + ``` + +1. Pick a good starting point (we recommend something like Button, for its simplicity and likelihood of being used within other components) and re-include it in the accessibility tests. + + ```ts title="Button.stories.ts" + // Replace your-renderer with the renderer you are using (e.g., react, vue3) + import { Meta } from '@storybook/your-renderer'; + + import { Button } from './Button'; + + const meta = { + component: Button, + // 👇 Re-apply the a11ytest tag for this component's stories + tags: ['a11ytest'], + }; + + export default preview; + ``` -In the example above, we configured all the `minor` or `moderate` accessibility violations to be considered warnings. All other levels (i.e., `serious` or `critical`) will continue to be considered errors, fail the test, and report the results accordingly in the Storybook UI or Vitest. +1. Pick another component and repeat the process until you've covered all your components and you're an accessibility hero! -### Configure accessibility tests with the test addon +### Override accessibility violation levels -If you want to run accessibility tests only for a subset of your stories, you can use the [tags](../writing-stories/tags.mdx) mechanism to filter the tests you want to run with the test addon. For example, to turn off accessibility tests for a specific story, add the `!a11ytest` tag to the story's meta or directly to the story's `tags` configuration option. For example: +By default, when the accessibility addon runs with the test addon enabled, it interprets all violations as errors. This means that if a story has a minor accessibility violation, the test will fail. However, you can override this behavior by setting the `warnings` parameter in the `a11y` configuration object to define an array of impact levels that should be considered warnings. {/* prettier-ignore-start */} - + {/* prettier-ignore-end */} - - - Tags can be applied at the project, component (meta), or story levels. Read our [documentation](../writing-stories/tags.mdx) for more information on configuring tags. - - +In the example above, we configured all the `minor` or `moderate` accessibility violations to be considered warnings. All other levels (i.e., `serious` or `critical`) will continue to be considered errors, fail the test, and report the results accordingly in the Storybook UI or CLI output. diff --git a/docs/writing-tests/test-addon.mdx b/docs/writing-tests/test-addon.mdx index fbf331c69dd8..550e634401b0 100644 --- a/docs/writing-tests/test-addon.mdx +++ b/docs/writing-tests/test-addon.mdx @@ -7,9 +7,9 @@ sidebar: - The Test addon, powered by [Vitest](https://vitest.dev/), is currently only supported in [React](?renderer=react), [Vue](?renderer=vue) and [Svelte](?renderer=svelte) projects, which use the [Vite builder](../builders/vite.mdx) (or the [Next.js framework](../get-started/frameworks/nextjs.mdx)). + The Test addon is currently only supported in [React](?renderer=react), [Vue](?renderer=vue) and [Svelte](?renderer=svelte) projects, which use the [Vite builder](../builders/vite.mdx) (or the [Next.js framework with Vite](../get-started/frameworks/nextjs.mdx#with-vite)). - If you are using a different renderer, you can use the [Storyboook test runner](./test-runner.mdx) to test your stories. + If you are using a different renderer (such as Angular) or the Webpack builder, you can use the [Storyboook test runner](./test-runner.mdx) to test your stories. {/* End non-supported renderers */} @@ -23,11 +23,11 @@ sidebar: While this addon is experimental, it is published as the `@storybook/experimental-addon-test` package and the API may change in future releases. We welcome feedback and contributions to help improve this feature. -Storybook's Test addon allows you to test your components directly inside Storybook. It does this by using a Vitest plugin to transform your [stories](../writing-stories/index.mdx) into [Vitest](https://vitest.dev) tests using [portable stories](../api/portable-stories/portable-stories-vitest.mdx). +Storybook's Test addon allows you to test your components directly inside Storybook. On its own, it transforms your [stories](../writing-stories/index.mdx) into [component tests](./component-testing.mdx), which test the rendering and behavior of your components in a real browser environment. It can also calculate project [coverage](./test-coverage.mdx) provided by your stories. -Stories are tested in two ways: a smoke test to ensure it renders and, if a [play function](../writing-tests/component-testing#write-a-component-test) is defined, that function is run and any [assertions made](../writing-tests/component-testing.mdx#assert-tests-with-vitests-apis) within it are validated. +If your project is using other testing addons, such as the [Visual tests addon](./visual-testing.mdx) or the [Accessibility addon](./accessibility-testing.mdx), you can run those tests alongside your component tests. -If a test fails, it will be marked as such in the sidebar and you can click on the story to see the failure. You can also run tests in watch mode, which will automatically re-run tests when you make changes to your components or stories. +When tests are run for a story, the status is shown in the sidebar. You can filter it down to only show failures and failing status indicators open a menu to debug the failure. You can also run tests in watch mode, which will automatically re-run tests when you make changes to your components or stories. From bc8181defde4804b7af60f2bbbab9dc4a7987546 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 12 Dec 2024 16:15:44 +0100 Subject: [PATCH 076/169] Show errors of axe properly --- code/addons/a11y/src/components/A11YPanel.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/addons/a11y/src/components/A11YPanel.tsx b/code/addons/a11y/src/components/A11YPanel.tsx index dc048d97b941..61ea9a663af4 100644 --- a/code/addons/a11y/src/components/A11YPanel.tsx +++ b/code/addons/a11y/src/components/A11YPanel.tsx @@ -133,7 +133,11 @@ export const A11YPanel: React.FC = () => { <> The accessibility scan encountered an error.
- {typeof error === 'string' ? error : JSON.stringify(error)} + {typeof error === 'string' + ? error + : error instanceof Error + ? error.toString() + : JSON.stringify(error)} )} From 25a3a33ba51a77650a0fb66d4223d8ff12fd277f Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 12 Dec 2024 16:28:11 +0100 Subject: [PATCH 077/169] Fix status to be failed --- code/addons/a11y/src/preview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/a11y/src/preview.tsx b/code/addons/a11y/src/preview.tsx index d4bec863b015..e496894cb113 100644 --- a/code/addons/a11y/src/preview.tsx +++ b/code/addons/a11y/src/preview.tsx @@ -41,7 +41,7 @@ export const experimental_afterEach: AfterEach = async ({ type: 'a11y', version: 1, result: result, - status: hasViolations ? 'warning' : 'passed', + status: hasViolations ? 'failed' : 'passed', }); /** From 808b493447602b7df0f89067ca817431a2cb085f Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Thu, 12 Dec 2024 10:33:49 -0700 Subject: [PATCH 078/169] Apply suggestions from code review Co-authored-by: jonniebigodes --- docs/writing-tests/test-addon.mdx | 2 +- docs/writing-tests/test-coverage.mdx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/writing-tests/test-addon.mdx b/docs/writing-tests/test-addon.mdx index 550e634401b0..520ec0a648ab 100644 --- a/docs/writing-tests/test-addon.mdx +++ b/docs/writing-tests/test-addon.mdx @@ -342,7 +342,7 @@ When you run tests in the [Storybook UI](#storybook-ui), the addon runs Vitest i ## Configuring tests -The tests run by the addon can be configured in two ways. You can toggle which test types are run, and you can include, exclude, or skip stories from being tested. +The tests run by the addon can be configured in two ways. You can toggle which test types are run and include, exclude, or skip stories from being tested. ### Toggling test types diff --git a/docs/writing-tests/test-coverage.mdx b/docs/writing-tests/test-coverage.mdx index 02b592d13dfa..1221b382336d 100644 --- a/docs/writing-tests/test-coverage.mdx +++ b/docs/writing-tests/test-coverage.mdx @@ -38,7 +38,7 @@ npm i -D @vitest/coverage-istanbul ### Usage -Because coverage is built-in to Storybook Test, you can use it everywhere you run your tests. +Because coverage is built into the Test addon, you can use it everywhere you run your tests. #### Storybook UI @@ -51,7 +51,7 @@ Additionally, the full coverage report will be served at the `/coverage/index.ht It's important to understand that the coverage reported in the Storybook UI has three important limitations: 1. Coverage is calculated using the stories you've written, not the entire codebase. In other words, it will not include any other Vitest tests. -2. Coverage can only be calculated for all stories in your project, not an individual story or a group of stories. +2. Coverage can only be calculated for all stories in your project, not for an individual story or a group of stories. 3. Coverage is not calculated while watch mode is activated. When coverage is enabled, enabling watch mode will disable coverage. @@ -193,7 +193,7 @@ When calculating coverage in the Storybook UI, the following options are always ### Troubleshooting -#### Excluding stories from coverage report +#### Excluding stories from the coverage report Until Vitest 2.2.0 is released, the generated coverage report will include the stories files themselves. This is misleading and they should be excluded. To do this, you can add the following to your Vitest config: From 17652624def3c8e3e4f39ff4aaee7bae3f0399dc Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 12 Dec 2024 20:29:41 +0100 Subject: [PATCH 079/169] add fail-on-purpose tag to Button story --- .../react/stories/Button.stories.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.stories.tsx b/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.stories.tsx index 9d2cf8230964..2c976b43cc43 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.stories.tsx +++ b/test-storybooks/portable-stories-kitchen-sink/react/stories/Button.stories.tsx @@ -67,6 +67,8 @@ export const CSF3Primary: CSF3Story = { size: 'large', primary: true, }, + // Accessibility is failing for the Button + tags: ['fail-on-purpose'], }; export const CSF3Button: CSF3Story = { From c3df3f5a00fc8f47479360df43e911848ad465f6 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Thu, 12 Dec 2024 12:20:00 -0700 Subject: [PATCH 080/169] Address feedback --- docs/_snippets/addon-a11y-meta-tag.md | 236 ++++++++++++++++++ ...lugin-install-coverage-support-packages.md | 23 ++ .../vitest-plugin-run-with-coverage.md | 11 + docs/writing-tests/accessibility-testing.mdx | 17 +- docs/writing-tests/test-addon.mdx | 50 ++-- docs/writing-tests/test-coverage.mdx | 32 +-- 6 files changed, 311 insertions(+), 58 deletions(-) create mode 100644 docs/_snippets/addon-a11y-meta-tag.md create mode 100644 docs/_snippets/vitest-plugin-install-coverage-support-packages.md create mode 100644 docs/_snippets/vitest-plugin-run-with-coverage.md diff --git a/docs/_snippets/addon-a11y-meta-tag.md b/docs/_snippets/addon-a11y-meta-tag.md new file mode 100644 index 000000000000..3ef18124964e --- /dev/null +++ b/docs/_snippets/addon-a11y-meta-tag.md @@ -0,0 +1,236 @@ +```ts filename="Button.stories.ts" renderer="angular" language="ts" +import type { Meta } from '@storybook/angular/'; + +import { Button } from './button.component'; + +const meta: Meta