From 645c7cd335a8a771bceaa18166ee189725d50c9c Mon Sep 17 00:00:00 2001 From: Bruno Bufolin Date: Sun, 23 Apr 2023 18:06:44 -0300 Subject: [PATCH 001/171] fix: adjust tree node alignment when using a different font --- .../src/components/sidebar/TreeNode.tsx | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/code/ui/manager/src/components/sidebar/TreeNode.tsx b/code/ui/manager/src/components/sidebar/TreeNode.tsx index f71c7c0e920..f869fb53ba6 100644 --- a/code/ui/manager/src/components/sidebar/TreeNode.tsx +++ b/code/ui/manager/src/components/sidebar/TreeNode.tsx @@ -9,7 +9,6 @@ export const CollapseIcon = styled.span<{ isExpanded: boolean }>(({ theme, isExp display: 'inline-block', width: 0, height: 0, - marginTop: 6, marginLeft: 8, marginRight: 5, color: transparentize(0.4, theme.textMutedColor), @@ -41,8 +40,6 @@ const TypeIcon = styled(Icons)<{ docsMode?: boolean }>( { width: 12, height: 12, - padding: 1, - marginTop: 3, marginRight: 5, flex: '0 0 auto', }, @@ -145,6 +142,26 @@ export const RootNode = styled.div(({ theme }) => ({ color: theme.textMutedColor, })); +const Wrapper = styled.div({ + display: 'flex', + alignItems: 'center', +}); + +const InvisibleText = styled.p({ + margin: 0, + width: 0, +}); + +// Make the content have a min-height equal to one line of text +export const IconsWrapper: FunctionComponent<{ children?: React.ReactNode }> = ({ children }) => { + return ( + +   + {children} + + ); +}; + export const GroupNode: FunctionComponent< ComponentProps & { isExpanded?: boolean; isExpandable?: boolean } > = React.memo(function GroupNode({ @@ -155,8 +172,10 @@ export const GroupNode: FunctionComponent< }) { return ( - {isExpandable ? : null} - + + {isExpandable ? : null} + + {children} ); @@ -166,8 +185,10 @@ export const ComponentNode: FunctionComponent> function ComponentNode({ theme, children, isExpanded, isExpandable, isSelected, ...props }) { return ( - {isExpandable && } - + + {isExpandable && } + + {children} ); @@ -179,7 +200,9 @@ export const DocumentNode: FunctionComponent< > = React.memo(function DocumentNode({ theme, children, docsMode, ...props }) { return ( - + + + {children} ); @@ -189,7 +212,9 @@ export const StoryNode: FunctionComponent> = Rea function StoryNode({ theme, children, ...props }) { return ( - + + + {children} ); From acb8076e88eb7d6e1cb32cbf29af527dcdbeb0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nuno=20Mota?= Date: Mon, 1 May 2023 17:29:05 +0100 Subject: [PATCH 002/171] Log stdout and stderr from npm-check-updates separately Prevents commas from being logged on the terminal Adds newline between stdout and stderr --- code/lib/cli/src/upgrade.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/lib/cli/src/upgrade.ts b/code/lib/cli/src/upgrade.ts index 6d25ed46c13..5585d4e0d10 100644 --- a/code/lib/cli/src/upgrade.ts +++ b/code/lib/cli/src/upgrade.ts @@ -193,14 +193,16 @@ export const doUpgrade = async ({ const check = spawnSync('npx', ['npm-check-updates@latest', '/storybook/', ...flags], { stdio: 'pipe', shell: true, - }).output.toString(); - logger.info(check); + }); + logger.info(check.stdout.toString()); + logger.info(check.stderr.toString()); const checkSb = spawnSync('npx', ['npm-check-updates@latest', 'sb', ...flags], { stdio: 'pipe', shell: true, - }).output.toString(); - logger.info(checkSb); + }); + logger.info(checkSb.stdout.toString()); + logger.info(checkSb.stderr.toString()); if (!dryRun) { commandLog(`Installing upgrades`); From 8e477597c522c2d808dc31ec9b0d237ddfa8f36d Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 9 May 2023 09:05:16 +0200 Subject: [PATCH 003/171] make sandbox names consistent --- code/lib/cli/src/sandbox-templates.ts | 58 +++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 6b3bc9b9666..c0072ff0f37 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -66,7 +66,7 @@ export type Template = { const baseTemplates = { 'cra/default-js': { - name: 'Create React App (Javascript)', + name: 'Create React App (JavaScript)', script: 'npx create-react-app .', expected: { // TODO: change this to @storybook/cra once that package is created @@ -77,7 +77,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'cra/default-ts': { - name: 'Create React App (Typescript)', + name: 'Create React App (TypeScript)', script: 'npx create-react-app . --template typescript', // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed. skipTasks: ['smoke-test'], @@ -120,7 +120,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-vite/default-js': { - name: 'React Vite (JS)', + name: 'React Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template react', expected: { framework: '@storybook/react-vite', @@ -130,7 +130,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-vite/default-ts': { - name: 'React Vite (TS)', + name: 'React Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template react-ts', expected: { framework: '@storybook/react-vite', @@ -139,7 +139,7 @@ const baseTemplates = { }, }, 'react-webpack/18-ts': { - name: 'React 18 Webpack5 (TS)', + name: 'React Webpack (TypeScript)', script: 'yarn create webpack5-react .', expected: { framework: '@storybook/react-webpack5', @@ -149,7 +149,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-webpack/17-ts': { - name: 'React 17 Webpack5 (TS)', + name: 'React v17 Webpack (TypeScript)', script: 'yarn create webpack5-react . --version-react="17" --version-react-dom="17"', expected: { framework: '@storybook/react-webpack5', @@ -159,7 +159,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'solid-vite/default-js': { - name: 'SolidJS Vite (JS)', + name: 'SolidJS Vite (JavaScript)', script: 'npx degit solidjs/templates/js .', expected: { framework: 'storybook-solidjs-vite', @@ -171,7 +171,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'solid-vite/default-ts': { - name: 'SolidJS Vite (TS)', + name: 'SolidJS Vite (TypeScript)', script: 'npx degit solidjs/templates/ts .', expected: { framework: 'storybook-solidjs-vite', @@ -183,7 +183,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue3-vite/default-js': { - name: 'Vue3 Vite (JS)', + name: 'Vue v3 Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template vue', expected: { framework: '@storybook/vue3-vite', @@ -193,7 +193,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue3-vite/default-ts': { - name: 'Vue3 Vite (TS)', + name: 'Vue v3 Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template vue-ts', expected: { framework: '@storybook/vue3-vite', @@ -203,7 +203,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue2-vite/2.7-js': { - name: 'Vue2 Vite (vue 2.7 JS)', + name: 'Vue v2 Vite (JavaScript)', script: 'npx create-vue@2 {{beforeDir}} --default', expected: { framework: '@storybook/vue-vite', @@ -214,7 +214,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'html-webpack/default': { - name: 'HTML Webpack5', + name: 'HTML Webpack', script: 'yarn create webpack5-html .', expected: { framework: '@storybook/html-webpack5', @@ -224,7 +224,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'html-vite/default-js': { - name: 'HTML Vite JS', + name: 'HTML Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template vanilla && echo "export default {}" > vite.config.js', expected: { @@ -235,7 +235,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'html-vite/default-ts': { - name: 'HTML Vite TS', + name: 'HTML Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template vanilla-ts && echo "export default {}" > vite.config.js', expected: { @@ -246,7 +246,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-vite/default-js': { - name: 'Svelte Vite (JS)', + name: 'Svelte Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template svelte', expected: { framework: '@storybook/svelte-vite', @@ -256,7 +256,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-vite/default-ts': { - name: 'Svelte Vite (TS)', + name: 'Svelte Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template svelte-ts', expected: { framework: '@storybook/svelte-vite', @@ -278,7 +278,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'angular-cli/default-ts': { - name: 'Angular CLI (latest)', + name: 'Angular CLI', script: 'npx -p @angular/cli ng new angular-latest --directory . --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -289,7 +289,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'angular-cli/14-ts': { - name: 'Angular CLI (Version 14)', + name: 'Angular CLI v14', script: 'npx -p @angular/cli@14 ng new angular-v14 --directory . --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -300,7 +300,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-kit/skeleton-js': { - name: 'Svelte Kit (JS)', + name: 'SvelteKit (JavaScript)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -311,7 +311,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-kit/skeleton-ts': { - name: 'Svelte Kit (TS)', + name: 'SvelteKit (TypeScript)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -322,7 +322,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'lit-vite/default-js': { - name: 'Lit Vite (JS)', + name: 'Lit Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template lit && echo "export default {}" > vite.config.js', expected: { @@ -334,7 +334,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'lit-vite/default-ts': { - name: 'Lit Vite (TS)', + name: 'Lit Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template lit-ts && echo "export default {}" > vite.config.js', expected: { @@ -346,7 +346,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'vue-cli/default-js': { - name: 'Vue-CLI (Default JS)', + name: 'Vue v3 CLI (JavaScript)', script: 'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge', expected: { framework: '@storybook/vue3-webpack5', @@ -357,7 +357,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'vue-cli/vue2-default-js': { - name: 'Vue-CLI (Vue2 JS)', + name: 'Vue v2 CLI (JavaScript)', script: 'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge --preset="Default (Vue 2)"', expected: { @@ -369,7 +369,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'preact-webpack5/default-js': { - name: 'Preact CLI (Default JS)', + name: 'Preact CLI (JavaScript)', script: 'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install', expected: { framework: '@storybook/preact-webpack5', @@ -379,7 +379,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-webpack5/default-ts': { - name: 'Preact CLI (Default TS)', + name: 'Preact CLI (TypeScript)', script: 'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install', expected: { framework: '@storybook/preact-webpack5', @@ -389,7 +389,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-vite/default-js': { - name: 'Preact Vite (JS)', + name: 'Preact Vite (JavaScript)', script: 'npm create vite@latest --yes . -- --template preact', expected: { framework: '@storybook/preact-vite', @@ -399,7 +399,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-vite/default-ts': { - name: 'Preact Vite (TS)', + name: 'Preact Vite (TypeScript)', script: 'npm create vite@latest --yes . -- --template preact-ts', expected: { framework: '@storybook/preact-vite', @@ -409,7 +409,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'qwik-vite/default-ts': { - name: 'Qwik CLI (Default TS)', + name: 'Qwik CLI (TypeScript)', script: 'yarn create qwik basic {{beforeDir}} --no-install', // TODO: The community template does not provide standard stories, which is required for e2e tests. Reenable once it does. inDevelopment: true, From 9e9458cc02a4da8fbdf03e821c2f918444ce17eb Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 10 May 2023 13:37:11 +0200 Subject: [PATCH 004/171] other sandbox naming scheme --- code/lib/cli/src/sandbox-templates.ts | 69 ++++++++++++++------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index c0072ff0f37..ae7be781c76 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -13,6 +13,11 @@ export type Cadence = keyof typeof templatesByCadence; export type Template = { /** * Readable name for the template, which will be used for feedback and the status page + * Follows the naming scheme when it makes sense: + * [- ] (JS|TS) + * React Latest - Webpack (TS) + * Next.js v12 (JS) + * Angular CLI Prerelease */ name: string; /** @@ -66,7 +71,7 @@ export type Template = { const baseTemplates = { 'cra/default-js': { - name: 'Create React App (JavaScript)', + name: 'Create React App Latest (JS)', script: 'npx create-react-app .', expected: { // TODO: change this to @storybook/cra once that package is created @@ -77,7 +82,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'cra/default-ts': { - name: 'Create React App (TypeScript)', + name: 'Create React App Latest (TS)', script: 'npx create-react-app . --template typescript', // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed. skipTasks: ['smoke-test'], @@ -89,7 +94,7 @@ const baseTemplates = { }, }, 'nextjs/12-js': { - name: 'Next.js v12 (JavaScript)', + name: 'Next.js v12 (JS)', script: 'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-12-3-2/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^12.2.0" && yarn && git add . && git commit --amend --no-edit && cd ..', expected: { @@ -100,7 +105,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'nextjs/default-js': { - name: 'Next.js (JavaScript)', + name: 'Next.js Latest (JS)', script: 'yarn create next-app {{beforeDir}} --javascript --eslint', expected: { framework: '@storybook/nextjs', @@ -110,7 +115,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'nextjs/default-ts': { - name: 'Next.js (TypeScript)', + name: 'Next.js Latest (TS)', script: 'yarn create next-app {{beforeDir}} --typescript --eslint', expected: { framework: '@storybook/nextjs', @@ -120,7 +125,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-vite/default-js': { - name: 'React Vite (JavaScript)', + name: 'React Vite (JS)', script: 'npm create vite@latest --yes . -- --template react', expected: { framework: '@storybook/react-vite', @@ -130,7 +135,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-vite/default-ts': { - name: 'React Vite (TypeScript)', + name: 'React Latest - Vite (TS)', script: 'npm create vite@latest --yes . -- --template react-ts', expected: { framework: '@storybook/react-vite', @@ -139,7 +144,7 @@ const baseTemplates = { }, }, 'react-webpack/18-ts': { - name: 'React Webpack (TypeScript)', + name: 'React Latest - Webpack (TS)', script: 'yarn create webpack5-react .', expected: { framework: '@storybook/react-webpack5', @@ -149,7 +154,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'react-webpack/17-ts': { - name: 'React v17 Webpack (TypeScript)', + name: 'React v17 - Webpack (TS)', script: 'yarn create webpack5-react . --version-react="17" --version-react-dom="17"', expected: { framework: '@storybook/react-webpack5', @@ -159,7 +164,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'solid-vite/default-js': { - name: 'SolidJS Vite (JavaScript)', + name: 'SolidJS Latest - Vite (JS)', script: 'npx degit solidjs/templates/js .', expected: { framework: 'storybook-solidjs-vite', @@ -171,7 +176,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'solid-vite/default-ts': { - name: 'SolidJS Vite (TypeScript)', + name: 'SolidJS Latest - Vite (TS)', script: 'npx degit solidjs/templates/ts .', expected: { framework: 'storybook-solidjs-vite', @@ -183,7 +188,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue3-vite/default-js': { - name: 'Vue v3 Vite (JavaScript)', + name: 'Vue v3 - Vite (JS)', script: 'npm create vite@latest --yes . -- --template vue', expected: { framework: '@storybook/vue3-vite', @@ -193,7 +198,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue3-vite/default-ts': { - name: 'Vue v3 Vite (TypeScript)', + name: 'Vue v3 - Vite (TS)', script: 'npm create vite@latest --yes . -- --template vue-ts', expected: { framework: '@storybook/vue3-vite', @@ -203,7 +208,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'vue2-vite/2.7-js': { - name: 'Vue v2 Vite (JavaScript)', + name: 'Vue v2 - Vite (JS)', script: 'npx create-vue@2 {{beforeDir}} --default', expected: { framework: '@storybook/vue-vite', @@ -214,7 +219,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'html-webpack/default': { - name: 'HTML Webpack', + name: 'HTML - Webpack', script: 'yarn create webpack5-html .', expected: { framework: '@storybook/html-webpack5', @@ -224,7 +229,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'html-vite/default-js': { - name: 'HTML Vite (JavaScript)', + name: 'HTML - Vite (JS)', script: 'npm create vite@latest --yes . -- --template vanilla && echo "export default {}" > vite.config.js', expected: { @@ -235,7 +240,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'html-vite/default-ts': { - name: 'HTML Vite (TypeScript)', + name: 'HTML - Vite (TS)', script: 'npm create vite@latest --yes . -- --template vanilla-ts && echo "export default {}" > vite.config.js', expected: { @@ -246,7 +251,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-vite/default-js': { - name: 'Svelte Vite (JavaScript)', + name: 'Svelte Latest - Vite (JS)', script: 'npm create vite@latest --yes . -- --template svelte', expected: { framework: '@storybook/svelte-vite', @@ -256,7 +261,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-vite/default-ts': { - name: 'Svelte Vite (TypeScript)', + name: 'Svelte Latest - Vite (TS)', script: 'npm create vite@latest --yes . -- --template svelte-ts', expected: { framework: '@storybook/svelte-vite', @@ -267,7 +272,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'angular-cli/prerelease': { - name: 'Angular CLI (Prerelease)', + name: 'Angular CLI Prerelease', script: 'npx -p @angular/cli@next ng new angular-v16 --directory . --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -278,7 +283,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'angular-cli/default-ts': { - name: 'Angular CLI', + name: 'Angular CLI Latest', script: 'npx -p @angular/cli ng new angular-latest --directory . --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -300,7 +305,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-kit/skeleton-js': { - name: 'SvelteKit (JavaScript)', + name: 'SvelteKit Latest (JS)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -311,7 +316,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'svelte-kit/skeleton-ts': { - name: 'SvelteKit (TypeScript)', + name: 'SvelteKit Latest (TS)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -322,7 +327,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'lit-vite/default-js': { - name: 'Lit Vite (JavaScript)', + name: 'Lit Latest - Vite (JS)', script: 'npm create vite@latest --yes . -- --template lit && echo "export default {}" > vite.config.js', expected: { @@ -334,7 +339,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'lit-vite/default-ts': { - name: 'Lit Vite (TypeScript)', + name: 'Lit Latest - Vite (TS)', script: 'npm create vite@latest --yes . -- --template lit-ts && echo "export default {}" > vite.config.js', expected: { @@ -346,7 +351,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'vue-cli/default-js': { - name: 'Vue v3 CLI (JavaScript)', + name: 'Vue v3 CLI (JS)', script: 'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge', expected: { framework: '@storybook/vue3-webpack5', @@ -357,7 +362,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'vue-cli/vue2-default-js': { - name: 'Vue v2 CLI (JavaScript)', + name: 'Vue v2 CLI (JS)', script: 'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge --preset="Default (Vue 2)"', expected: { @@ -369,7 +374,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev'], }, 'preact-webpack5/default-js': { - name: 'Preact CLI (JavaScript)', + name: 'Preact Latest CLI (JS)', script: 'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install', expected: { framework: '@storybook/preact-webpack5', @@ -379,7 +384,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-webpack5/default-ts': { - name: 'Preact CLI (TypeScript)', + name: 'Preact Latest CLI (TS)', script: 'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install', expected: { framework: '@storybook/preact-webpack5', @@ -389,7 +394,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-vite/default-js': { - name: 'Preact Vite (JavaScript)', + name: 'Preact Latest - Vite (JS)', script: 'npm create vite@latest --yes . -- --template preact', expected: { framework: '@storybook/preact-vite', @@ -399,7 +404,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'preact-vite/default-ts': { - name: 'Preact Vite (TypeScript)', + name: 'Preact Latest - Vite (TS)', script: 'npm create vite@latest --yes . -- --template preact-ts', expected: { framework: '@storybook/preact-vite', @@ -409,7 +414,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev'], }, 'qwik-vite/default-ts': { - name: 'Qwik CLI (TypeScript)', + name: 'Qwik Latest CLI (TS)', script: 'yarn create qwik basic {{beforeDir}} --no-install', // TODO: The community template does not provide standard stories, which is required for e2e tests. Reenable once it does. inDevelopment: true, From 578cbbff4ba2926d08ffecd1d80055eb8dde6578 Mon Sep 17 00:00:00 2001 From: sook Date: Mon, 22 May 2023 20:25:56 +0900 Subject: [PATCH 005/171] fix: sandbox package.json when pre-existing NODE_OPTIONS value contains whitespaces --- scripts/tasks/sandbox-parts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index e32ce51214b..63b4285c5e8 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -131,7 +131,7 @@ export const install: Task['run'] = async ( } const nodeOptionsString = nodeOptions.join(' '); - const prefix = `NODE_OPTIONS="${nodeOptionsString}" STORYBOOK_TELEMETRY_URL="http://localhost:6007/event-log"`; + const prefix = `NODE_OPTIONS='${nodeOptionsString}' STORYBOOK_TELEMETRY_URL="http://localhost:6007/event-log"`; await updatePackageScripts({ cwd, From 183ab1bcb69b4c92aff6351c00918fc7d4ebf76c Mon Sep 17 00:00:00 2001 From: Josanghyeon <05lazy.dev@gmail.com> Date: Sat, 27 May 2023 12:37:05 +0900 Subject: [PATCH 006/171] getting started add install cli yarn --- docs/get-started/install.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/get-started/install.md b/docs/get-started/install.md index 15861bb4636..94a53d5ab4e 100644 --- a/docs/get-started/install.md +++ b/docs/get-started/install.md @@ -9,6 +9,7 @@ Use the Storybook CLI to install it in a single command. Run this inside your _e From f5621205dc714499563f9cb9061f421756a1d632 Mon Sep 17 00:00:00 2001 From: Bruno Bufolin Date: Sun, 25 Jun 2023 22:52:03 -0300 Subject: [PATCH 007/171] refactor: change FunctionComponent for FC to type components --- code/ui/manager/src/components/sidebar/TreeNode.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/ui/manager/src/components/sidebar/TreeNode.tsx b/code/ui/manager/src/components/sidebar/TreeNode.tsx index f869fb53ba6..e6a60d0e200 100644 --- a/code/ui/manager/src/components/sidebar/TreeNode.tsx +++ b/code/ui/manager/src/components/sidebar/TreeNode.tsx @@ -2,7 +2,7 @@ import { styled } from '@storybook/theming'; import type { Color, Theme } from '@storybook/theming'; import { Icons } from '@storybook/components'; import { transparentize } from 'polished'; -import type { FunctionComponent, ComponentProps } from 'react'; +import type { FC, ComponentProps } from 'react'; import React from 'react'; export const CollapseIcon = styled.span<{ isExpanded: boolean }>(({ theme, isExpanded }) => ({ @@ -153,7 +153,7 @@ const InvisibleText = styled.p({ }); // Make the content have a min-height equal to one line of text -export const IconsWrapper: FunctionComponent<{ children?: React.ReactNode }> = ({ children }) => { +export const IconsWrapper: FC<{ children?: React.ReactNode }> = ({ children }) => { return (   @@ -162,7 +162,7 @@ export const IconsWrapper: FunctionComponent<{ children?: React.ReactNode }> = ( ); }; -export const GroupNode: FunctionComponent< +export const GroupNode: FC< ComponentProps & { isExpanded?: boolean; isExpandable?: boolean } > = React.memo(function GroupNode({ children, @@ -181,7 +181,7 @@ export const GroupNode: FunctionComponent< ); }); -export const ComponentNode: FunctionComponent> = React.memo( +export const ComponentNode: FC> = React.memo( function ComponentNode({ theme, children, isExpanded, isExpandable, isSelected, ...props }) { return ( @@ -195,7 +195,7 @@ export const ComponentNode: FunctionComponent> } ); -export const DocumentNode: FunctionComponent< +export const DocumentNode: FC< ComponentProps & { docsMode: boolean } > = React.memo(function DocumentNode({ theme, children, docsMode, ...props }) { return ( @@ -208,7 +208,7 @@ export const DocumentNode: FunctionComponent< ); }); -export const StoryNode: FunctionComponent> = React.memo( +export const StoryNode: FC> = React.memo( function StoryNode({ theme, children, ...props }) { return ( From 1de752eb9ea27986500c56a83e92177cb88aa0ea Mon Sep 17 00:00:00 2001 From: Bruno Bufolin Date: Thu, 29 Jun 2023 23:14:56 -0300 Subject: [PATCH 008/171] refactor: format file --- .../src/components/sidebar/TreeNode.tsx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/code/ui/manager/src/components/sidebar/TreeNode.tsx b/code/ui/manager/src/components/sidebar/TreeNode.tsx index e6a60d0e200..879b8077852 100644 --- a/code/ui/manager/src/components/sidebar/TreeNode.tsx +++ b/code/ui/manager/src/components/sidebar/TreeNode.tsx @@ -195,28 +195,30 @@ export const ComponentNode: FC> = React.memo( } ); -export const DocumentNode: FC< - ComponentProps & { docsMode: boolean } -> = React.memo(function DocumentNode({ theme, children, docsMode, ...props }) { - return ( - - - - - {children} - - ); -}); - -export const StoryNode: FC> = React.memo( - function StoryNode({ theme, children, ...props }) { +export const DocumentNode: FC & { docsMode: boolean }> = React.memo( + function DocumentNode({ theme, children, docsMode, ...props }) { return ( - + {children} ); } ); + +export const StoryNode: FC> = React.memo(function StoryNode({ + theme, + children, + ...props +}) { + return ( + + + + + {children} + + ); +}); From 5adcfc9867683ab51e3e7df76cff297bb8704511 Mon Sep 17 00:00:00 2001 From: iqbal <111554475+noobcoder6602@users.noreply.github.com> Date: Sat, 8 Jul 2023 15:18:23 +0530 Subject: [PATCH 009/171] issue#22910 fixed ts error No title prop defined: --- code/ui/blocks/src/blocks/Meta.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ui/blocks/src/blocks/Meta.tsx b/code/ui/blocks/src/blocks/Meta.tsx index c651bc06f87..3c5e10db54c 100644 --- a/code/ui/blocks/src/blocks/Meta.tsx +++ b/code/ui/blocks/src/blocks/Meta.tsx @@ -5,13 +5,13 @@ import type { BaseAnnotations, ModuleExports } from '@storybook/types'; import { Anchor } from './Anchor'; import { DocsContext } from './DocsContext'; -type MetaProps = BaseAnnotations & { of?: ModuleExports }; +type MetaProps = BaseAnnotations & { of?: ModuleExports; title?: string }; /** * This component is used to declare component metadata in docs * and gets transformed into a default export underneath the hood. */ -export const Meta: FC = ({ of }) => { +export const Meta: FC = ({ of, title }) => { const context = useContext(DocsContext); if (of) { context.referenceMeta(of, true); From 82f81c87fb2746ba2b966383b9cab89c1389d4cb Mon Sep 17 00:00:00 2001 From: Steffen Wilking Date: Tue, 11 Jul 2023 17:40:10 +0200 Subject: [PATCH 010/171] Execute preventDefault only if keyboard shortcuts are enabled Otherwise the shortcuts will be blocked for browser plugins or own components --- code/lib/manager-api/src/modules/shortcuts.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/lib/manager-api/src/modules/shortcuts.ts b/code/lib/manager-api/src/modules/shortcuts.ts index 8dcf942f4bc..4c5fc9cb630 100644 --- a/code/lib/manager-api/src/modules/shortcuts.ts +++ b/code/lib/manager-api/src/modules/shortcuts.ts @@ -82,8 +82,9 @@ export interface SubAPI { /** * Handles a shortcut feature. * @param feature The feature to handle. + * @param event The event to handle. */ - handleShortcutFeature(feature: API_Action): void; + handleShortcutFeature(feature: API_Action, event: KeyboardEventLike): void; } export type API_KeyCollection = string[]; @@ -218,14 +219,12 @@ export const init: ModuleFn = ({ store, fullAPI }) => { shortcutMatchesShortcut(shortcut, shortcuts[feature]) ); if (matchedFeature) { - // Event.prototype.preventDefault is missing when received from the MessageChannel. - if (event?.preventDefault) event.preventDefault(); - api.handleShortcutFeature(matchedFeature); + api.handleShortcutFeature(matchedFeature, event); } }, // warning: event might not have a full prototype chain because it may originate from the channel - handleShortcutFeature(feature) { + handleShortcutFeature(feature, event) { const { layout: { isFullscreen, showNav, showPanel }, ui: { enableShortcuts }, @@ -234,6 +233,8 @@ export const init: ModuleFn = ({ store, fullAPI }) => { if (!enableShortcuts) { return; } + // Event.prototype.preventDefault is missing when received from the MessageChannel. + if (event?.preventDefault) event.preventDefault(); switch (feature) { case 'escape': { if (isFullscreen) { From 31cfea10347f8e692687a9adecde7d16a0165c26 Mon Sep 17 00:00:00 2001 From: iqbal <111554475+iqbalcodes6602@users.noreply.github.com> Date: Wed, 12 Jul 2023 09:09:27 +0530 Subject: [PATCH 011/171] Update Meta.tsx, removed the destructuring of title --- code/ui/blocks/src/blocks/Meta.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ui/blocks/src/blocks/Meta.tsx b/code/ui/blocks/src/blocks/Meta.tsx index 3c5e10db54c..a5402316038 100644 --- a/code/ui/blocks/src/blocks/Meta.tsx +++ b/code/ui/blocks/src/blocks/Meta.tsx @@ -11,7 +11,7 @@ type MetaProps = BaseAnnotations & { of?: ModuleExports; title?: string }; * This component is used to declare component metadata in docs * and gets transformed into a default export underneath the hood. */ -export const Meta: FC = ({ of, title }) => { +export const Meta: FC = ({ of }) => { const context = useContext(DocsContext); if (of) { context.referenceMeta(of, true); From 16d0156fa17306ecfc94938dc425d75917ad9944 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 14 Jul 2023 11:42:28 +0200 Subject: [PATCH 012/171] search label for attribute doesn't match id of input (fixes #23463) The for attribute value was not set to match the hardcoded value used for the search input id. --- code/ui/manager/src/components/sidebar/Search.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/ui/manager/src/components/sidebar/Search.tsx b/code/ui/manager/src/components/sidebar/Search.tsx index 9bd4b683995..675351ddc55 100644 --- a/code/ui/manager/src/components/sidebar/Search.tsx +++ b/code/ui/manager/src/components/sidebar/Search.tsx @@ -345,9 +345,13 @@ export const Search = React.memo<{ onBlur: () => setPlaceholder('Find components'), }); + const labelProps = getLabelProps({ + htmlFor: 'storybook-explorer-searchfield', + }); + return ( <> - Search for components + Search for components Date: Fri, 18 Aug 2023 15:15:30 -0400 Subject: [PATCH 013/171] Update error message to be useful when google fonts fail to load Helpful for debugging which fonts need to be mocked related: https://github.com/storybookjs/storybook/issues/23332 --- .../font/webpack/loader/google/get-font-face-declarations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts index 9526072fe0b..3f45a5d085e 100644 --- a/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts +++ b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts @@ -33,7 +33,7 @@ export async function getFontFaceDeclarations(options: LoaderOptions) { cssCache.delete(url); } if (fontFaceCSS === null) { - throw Error(`Failed to fetch \`${fontFamily}\` from Google Fonts.`); + throw Error(`Failed to fetch \`${fontFamily}\` from Google Fonts. URL: \`${url}\``); } return { @@ -45,6 +45,6 @@ export async function getFontFaceDeclarations(options: LoaderOptions) { variable, }; } catch (error) { - throw new Error("Google Fonts couldn't be loaded."); + throw new Error("Google Fonts couldn't be loaded.", {cause: error}); } } From 1f5b00b9b5c2b8e0a37cd2037f6d772539950b21 Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:29:57 -0400 Subject: [PATCH 014/171] basic docs (will add code references in a moment) --- .../build-pages-with-storybook.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 4307a31020f..90e0508a8a9 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -394,3 +394,24 @@ If you’ve set up `GlobalContainerContext`, you’ll need to set up a decorator /> + +### Mocking fonts + +If your application uses fonts from a Google, occasionally fetching these fonts may fail as part of your storybook build. It is highly recommended to mock these requests, as those failures can cause your pipeline to fail as well. + +#### Mocking fonts in Next.js + +Next.js [supports](https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36)https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36 mocking fonts via a javascript module located where the env var `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` references. + + + + + + From 9fb47bd45d06ba68d6fe840445581f3b48f23068 Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:42:00 -0400 Subject: [PATCH 015/171] Update docs --- docs/sharing/publish-storybook.md | 6 ++++ ...hromatic-github-action-with-mocking.js.mdx | 10 +++++++ .../common/mocked-google-fonts.js.mdx | 29 +++++++++++++++++++ .../build-pages-with-storybook.md | 6 ++-- 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 docs/snippets/common/chromatic-github-action-with-mocking.js.mdx create mode 100644 docs/snippets/common/mocked-google-fonts.js.mdx diff --git a/docs/sharing/publish-storybook.md b/docs/sharing/publish-storybook.md index 0c89b697865..ad011fc3b7a 100644 --- a/docs/sharing/publish-storybook.md +++ b/docs/sharing/publish-storybook.md @@ -109,6 +109,12 @@ In your project's root directory, add a new file called `chromatic.yml` inside t +
+ +💡 External font resources may occasionally fail to load at build timefor a variety of reasons. If you have issues with them, a good way to get around that problem is to [mock the fonts](../writing-stories/build-pages-with-storybook.md#mocking-fonts) your application requires + +
+ Commit and push the file. Congratulations, you've successfully automated publishing your Storybook. Now whenever you open a PR you’ll get a handy link to your published Storybook in your PR checks. ![PR check publish](./prbadge-publish.png) diff --git a/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx b/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx new file mode 100644 index 00000000000..2b4ae573a5e --- /dev/null +++ b/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx @@ -0,0 +1,10 @@ +```shell + - uses: chromaui/action@v1 + env: + #👇 the location of mocked fonts to use + NEXT_FONT_GOOGLE_MOCKED_RESPONSES: ${{ github.workspace }}/mocked-google-fonts.js + with: + #👇 Chromatic projectToken, + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} +``` diff --git a/docs/snippets/common/mocked-google-fonts.js.mdx b/docs/snippets/common/mocked-google-fonts.js.mdx new file mode 100644 index 00000000000..ccc04bd0efa --- /dev/null +++ b/docs/snippets/common/mocked-google-fonts.js.mdx @@ -0,0 +1,29 @@ +```js +// mocked-google-fonts.js + +//👇 Mocked responses of google fonts +// If you run into errors during your build, easiest is to fetch them yourself and drop them in here +// so the URL requested explicitly matches the mocks rather than trying to determine it yourself. +module.exports = { + "https://fonts.googleapis.com/css?family=Inter:wght@400;500;600;800&display=block": ` + /* cyrillic-ext */ + @font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZJhiJ-Ek-_EeAmM.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; + } + /* more font declarations go here */ + /* latin */ + @font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + }`, +} +``` diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 90e0508a8a9..6553d19cdf1 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -407,10 +407,8 @@ Next.js [supports](https://github.com/vercel/next.js/blob/725ddc7371f80cca273779 From 6405f3646ca2935ff9eb882a6d6e131cceed3452 Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:44:34 -0400 Subject: [PATCH 016/171] add missing space --- docs/sharing/publish-storybook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sharing/publish-storybook.md b/docs/sharing/publish-storybook.md index ad011fc3b7a..1e3b4145ff2 100644 --- a/docs/sharing/publish-storybook.md +++ b/docs/sharing/publish-storybook.md @@ -111,7 +111,7 @@ In your project's root directory, add a new file called `chromatic.yml` inside t
-💡 External font resources may occasionally fail to load at build timefor a variety of reasons. If you have issues with them, a good way to get around that problem is to [mock the fonts](../writing-stories/build-pages-with-storybook.md#mocking-fonts) your application requires +💡 External font resources may occasionally fail to load at build time for a variety of reasons. If you have issues with them, a good way to get around that problem is to [mock the fonts](../writing-stories/build-pages-with-storybook.md#mocking-fonts) your application requires
From 9d84f42bca9e03b435da00d9bde5f4e18447a3c7 Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:48:22 -0400 Subject: [PATCH 017/171] remove extra word --- docs/writing-stories/build-pages-with-storybook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 6553d19cdf1..53f1de9efb9 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -397,7 +397,7 @@ If you’ve set up `GlobalContainerContext`, you’ll need to set up a decorator ### Mocking fonts -If your application uses fonts from a Google, occasionally fetching these fonts may fail as part of your storybook build. It is highly recommended to mock these requests, as those failures can cause your pipeline to fail as well. +If your application uses fonts from Google, occasionally fetching these fonts may fail as part of your storybook build. It is highly recommended to mock these requests, as those failures can cause your pipeline to fail as well. #### Mocking fonts in Next.js From 6b00ed9263ed94ca79146bf3ce56c4a0276b1def Mon Sep 17 00:00:00 2001 From: Martin Nabhan <7613182+martinnabhan@users.noreply.github.com> Date: Sun, 20 Aug 2023 11:30:42 +0900 Subject: [PATCH 018/171] Make sure the Next.js Image Context is reused instead of recreated when imported --- code/frameworks/nextjs/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 14ec26a0492..3d1f45e1718 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -141,12 +141,15 @@ "./src/preview.tsx", "./src/next-image-loader-stub.ts", "./src/images/context.ts", + "./src/images/decorator.tsx", "./src/images/next-future-image.tsx", "./src/images/next-legacy-image.tsx", "./src/images/next-image.tsx", "./src/font/webpack/loader/storybook-nextjs-font-loader.ts" ], "externals": [ + "./context", + "./images/decorator", "sb-original/next/image", "sb-original/next/future/image", "sb-original/next/legacy/image" From 13a729ca5501d4297e52dbf64c98eb7eef74964b Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:51:58 -0400 Subject: [PATCH 019/171] linting --- .../font/webpack/loader/google/get-font-face-declarations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts index 3f45a5d085e..8da5b6acf83 100644 --- a/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts +++ b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts @@ -45,6 +45,6 @@ export async function getFontFaceDeclarations(options: LoaderOptions) { variable, }; } catch (error) { - throw new Error("Google Fonts couldn't be loaded.", {cause: error}); + throw new Error("Google Fonts couldn't be loaded.", { cause: error }); } } From abf551fa1037b8d2eca81b2ea723964019a09588 Mon Sep 17 00:00:00 2001 From: Nathan Heaps Date: Mon, 21 Aug 2023 09:59:52 -0400 Subject: [PATCH 020/171] prettier linting --- docs/snippets/common/mocked-google-fonts.js.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/snippets/common/mocked-google-fonts.js.mdx b/docs/snippets/common/mocked-google-fonts.js.mdx index ccc04bd0efa..a56429147f1 100644 --- a/docs/snippets/common/mocked-google-fonts.js.mdx +++ b/docs/snippets/common/mocked-google-fonts.js.mdx @@ -5,7 +5,7 @@ // If you run into errors during your build, easiest is to fetch them yourself and drop them in here // so the URL requested explicitly matches the mocks rather than trying to determine it yourself. module.exports = { - "https://fonts.googleapis.com/css?family=Inter:wght@400;500;600;800&display=block": ` + 'https://fonts.googleapis.com/css?family=Inter:wght@400;500;600;800&display=block': ` /* cyrillic-ext */ @font-face { font-family: 'Inter'; @@ -25,5 +25,5 @@ module.exports = { src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }`, -} +}; ``` From abbec4e44b9f68e7388b23008c029505abe9ed67 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Fri, 25 Aug 2023 14:59:57 +0000 Subject: [PATCH 021/171] Write changelog for 7.4.0-alpha.2 --- CHANGELOG.prerelease.md | 14 ++++++++++++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 039c76a3445..c0ecfbb4122 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,17 @@ +## 7.4.0-alpha.2 + +- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)! +- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)! +- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)! +- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)! +- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)! +- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)! +- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)! +- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)! + ## 7.4.0-alpha.1 - Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)! diff --git a/code/package.json b/code/package.json index e7e8f58081c..3a3fba278a5 100644 --- a/code/package.json +++ b/code/package.json @@ -327,5 +327,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "7.4.0-alpha.2" } diff --git a/docs/versions/next.json b/docs/versions/next.json index 1c94da1365b..b44395b7379 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"7.4.0-alpha.1","info":{"plain":"- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)!\n- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)!\n- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Revert \"WebpackBuilder: Remove need for `react` as peerDependency\" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)!\n- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)!\n- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)!\n- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)!\n- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)!\n- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)!"}} +{"version":"7.4.0-alpha.2","info":{"plain":"- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!"}} From d5ca2f42838c9f5a3e556a5e819e58f0deff522e Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Fri, 25 Aug 2023 15:52:37 +0000 Subject: [PATCH 022/171] Bump version from "7.4.0-alpha.1" to "7.4.0-alpha.2" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storyshots-core/package.json | 2 +- code/addons/storyshots-puppeteer/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-manager/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/deprecated/addons/package.json | 2 +- .../channel-postmessage/package.json | 2 +- .../deprecated/channel-websocket/package.json | 2 +- code/deprecated/client-api/package.json | 2 +- code/deprecated/core-client/package.json | 2 +- code/deprecated/manager-api-shim/package.json | 2 +- code/deprecated/preview-web/package.json | 2 +- code/deprecated/store/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue-vite/package.json | 2 +- code/frameworks/vue-webpack5/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/channels/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/cli/src/versions.ts | 188 +++++++++--------- code/lib/client-logger/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-common/package.json | 2 +- code/lib/core-events/package.json | 2 +- code/lib/core-server/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/csf-tools/package.json | 2 +- code/lib/docs-tools/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/manager-api/package.json | 2 +- code/lib/manager-api/src/version.ts | 2 +- code/lib/node-logger/package.json | 2 +- code/lib/postinstall/package.json | 2 +- code/lib/preview-api/package.json | 2 +- code/lib/preview/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/router/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/telemetry/package.json | 2 +- code/lib/theming/package.json | 2 +- code/lib/types/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- .../web-components-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- code/ui/blocks/package.json | 2 +- code/ui/components/package.json | 2 +- code/ui/manager/package.json | 2 +- 97 files changed, 191 insertions(+), 192 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index fdfd1ddb2f0..e37bb3fbd7a 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index ff6dd88d9b7..f04f164a3fe 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index acbd9cd96e4..4b27406819d 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 7f672e2e221..d7603cb7caf 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index b4438a2dbe8..27e8936644d 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 017c2094e64..eb3509db2aa 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index f6bb45f84ca..7f45471a169 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 3faff78c78a..0a8664a64c8 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 22611c2fe6b..47ac694796b 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 949ea9245b9..ef10ff467c7 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 24811ae873c..3c025806707 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 63cf2eb7c38..0fe74f02c17 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index b4a61ba097d..5628ca04a5c 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index fb2983fb647..4dda6f0c61f 100644 --- a/code/addons/storyshots-core/package.json +++ b/code/addons/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Take a code snapshot of every story automatically with Jest", "keywords": [ "addon", diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index 06e3336b0f9..59184bc8ca2 100644 --- a/code/addons/storyshots-puppeteer/package.json +++ b/code/addons/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Image snapshots addition to StoryShots based on puppeteer", "keywords": [ "addon", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 7b55ac383f4..dad4119e7da 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 5e690f76608..f9abcb3bc21 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 602c5742047..c9adc3a916c 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 82686b4d84e..892098df73c 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index d91ea3d0f7c..28b6453a7b3 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index a1caff69f98..3bd3891793a 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 8f61972eb1a..8fe5bda194e 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index bfae8ff0926..42688e68565 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook addons store", "keywords": [ "storybook" diff --git a/code/deprecated/channel-postmessage/package.json b/code/deprecated/channel-postmessage/package.json index e621ce3448f..7677be32e2d 100644 --- a/code/deprecated/channel-postmessage/package.json +++ b/code/deprecated/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/channel-websocket/package.json b/code/deprecated/channel-websocket/package.json index 153ddf04aae..0df526a75f3 100644 --- a/code/deprecated/channel-websocket/package.json +++ b/code/deprecated/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-api/package.json b/code/deprecated/client-api/package.json index ae5339cd7f0..dc5b07fcf18 100644 --- a/code/deprecated/client-api/package.json +++ b/code/deprecated/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Client API", "keywords": [ "storybook" diff --git a/code/deprecated/core-client/package.json b/code/deprecated/core-client/package.json index eb713ecc0d8..51f316799bb 100644 --- a/code/deprecated/core-client/package.json +++ b/code/deprecated/core-client/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-client", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 4c672635333..9852affc753 100644 --- a/code/deprecated/manager-api-shim/package.json +++ b/code/deprecated/manager-api-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" diff --git a/code/deprecated/preview-web/package.json b/code/deprecated/preview-web/package.json index dcf2a3dcd19..83ede355248 100644 --- a/code/deprecated/preview-web/package.json +++ b/code/deprecated/preview-web/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-web", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/store/package.json b/code/deprecated/store/package.json index 797e646b1f3..dca05538778 100644 --- a/code/deprecated/store/package.json +++ b/code/deprecated/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index b507f7cc44f..cf6bf428c4b 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 675ca5987b3..9fbc1ba59c0 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index f2c6fa2fb12..145d2f514a2 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index f1bb8735e60..8006517f0e7 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index d4e9dde15d3..acdeb717794 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 9fb4b47240d..25f3f46065b 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index ac1ac189d8c..0ce84861e0c 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 8556054be39..986100d09e1 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 395da8728de..1369b677c3e 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index c27e17cb7b3..e066f822938 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 51bb7343673..6c3b2b8bc00 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 3d9c75318d6..103b0c11b10 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 44d63c7a3fc..65c0126339f 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index f390500964e..d06d2f8e727 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index f481a29fdcd..fb9e2fad083 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index b153f3bdee4..b128c08736e 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 3306d3874ba..42ed51c2862 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 737988f9585..c3f54f4b949 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 3603585a0e7..313240f3610 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 6590dec3801..ac827abaed7 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index cff7eb80b6c..63a2425ecf9 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index a295d28ec38..23b6bb60d30 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index b38a8833ec3..31f99791086 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index dc4b7595229..1fb441cd11f 100644 --- a/code/lib/cli/src/versions.ts +++ b/code/lib/cli/src/versions.ts @@ -1,97 +1,97 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '7.4.0-alpha.1', - '@storybook/addon-actions': '7.4.0-alpha.1', - '@storybook/addon-backgrounds': '7.4.0-alpha.1', - '@storybook/addon-controls': '7.4.0-alpha.1', - '@storybook/addon-docs': '7.4.0-alpha.1', - '@storybook/addon-essentials': '7.4.0-alpha.1', - '@storybook/addon-highlight': '7.4.0-alpha.1', - '@storybook/addon-interactions': '7.4.0-alpha.1', - '@storybook/addon-jest': '7.4.0-alpha.1', - '@storybook/addon-links': '7.4.0-alpha.1', - '@storybook/addon-mdx-gfm': '7.4.0-alpha.1', - '@storybook/addon-measure': '7.4.0-alpha.1', - '@storybook/addon-outline': '7.4.0-alpha.1', - '@storybook/addon-themes': '7.4.0-alpha.1', - '@storybook/addon-storyshots': '7.4.0-alpha.1', - '@storybook/addon-storyshots-puppeteer': '7.4.0-alpha.1', - '@storybook/addon-storysource': '7.4.0-alpha.1', - '@storybook/addon-toolbars': '7.4.0-alpha.1', - '@storybook/addon-viewport': '7.4.0-alpha.1', - '@storybook/addons': '7.4.0-alpha.1', - '@storybook/angular': '7.4.0-alpha.1', - '@storybook/api': '7.4.0-alpha.1', - '@storybook/blocks': '7.4.0-alpha.1', - '@storybook/builder-manager': '7.4.0-alpha.1', - '@storybook/builder-vite': '7.4.0-alpha.1', - '@storybook/builder-webpack5': '7.4.0-alpha.1', - '@storybook/channel-postmessage': '7.4.0-alpha.1', - '@storybook/channel-websocket': '7.4.0-alpha.1', - '@storybook/channels': '7.4.0-alpha.1', - '@storybook/cli': '7.4.0-alpha.1', - '@storybook/client-api': '7.4.0-alpha.1', - '@storybook/client-logger': '7.4.0-alpha.1', - '@storybook/codemod': '7.4.0-alpha.1', - '@storybook/components': '7.4.0-alpha.1', - '@storybook/core-client': '7.4.0-alpha.1', - '@storybook/core-common': '7.4.0-alpha.1', - '@storybook/core-events': '7.4.0-alpha.1', - '@storybook/core-server': '7.4.0-alpha.1', - '@storybook/core-webpack': '7.4.0-alpha.1', - '@storybook/csf-plugin': '7.4.0-alpha.1', - '@storybook/csf-tools': '7.4.0-alpha.1', - '@storybook/docs-tools': '7.4.0-alpha.1', - '@storybook/ember': '7.4.0-alpha.1', - '@storybook/html': '7.4.0-alpha.1', - '@storybook/html-vite': '7.4.0-alpha.1', - '@storybook/html-webpack5': '7.4.0-alpha.1', - '@storybook/instrumenter': '7.4.0-alpha.1', - '@storybook/manager': '7.4.0-alpha.1', - '@storybook/manager-api': '7.4.0-alpha.1', - '@storybook/nextjs': '7.4.0-alpha.1', - '@storybook/node-logger': '7.4.0-alpha.1', - '@storybook/postinstall': '7.4.0-alpha.1', - '@storybook/preact': '7.4.0-alpha.1', - '@storybook/preact-vite': '7.4.0-alpha.1', - '@storybook/preact-webpack5': '7.4.0-alpha.1', - '@storybook/preset-create-react-app': '7.4.0-alpha.1', - '@storybook/preset-html-webpack': '7.4.0-alpha.1', - '@storybook/preset-preact-webpack': '7.4.0-alpha.1', - '@storybook/preset-react-webpack': '7.4.0-alpha.1', - '@storybook/preset-server-webpack': '7.4.0-alpha.1', - '@storybook/preset-svelte-webpack': '7.4.0-alpha.1', - '@storybook/preset-vue-webpack': '7.4.0-alpha.1', - '@storybook/preset-vue3-webpack': '7.4.0-alpha.1', - '@storybook/preset-web-components-webpack': '7.4.0-alpha.1', - '@storybook/preview': '7.4.0-alpha.1', - '@storybook/preview-api': '7.4.0-alpha.1', - '@storybook/preview-web': '7.4.0-alpha.1', - '@storybook/react': '7.4.0-alpha.1', - '@storybook/react-dom-shim': '7.4.0-alpha.1', - '@storybook/react-vite': '7.4.0-alpha.1', - '@storybook/react-webpack5': '7.4.0-alpha.1', - '@storybook/router': '7.4.0-alpha.1', - '@storybook/server': '7.4.0-alpha.1', - '@storybook/server-webpack5': '7.4.0-alpha.1', - '@storybook/source-loader': '7.4.0-alpha.1', - '@storybook/store': '7.4.0-alpha.1', - '@storybook/svelte': '7.4.0-alpha.1', - '@storybook/svelte-vite': '7.4.0-alpha.1', - '@storybook/svelte-webpack5': '7.4.0-alpha.1', - '@storybook/sveltekit': '7.4.0-alpha.1', - '@storybook/telemetry': '7.4.0-alpha.1', - '@storybook/theming': '7.4.0-alpha.1', - '@storybook/types': '7.4.0-alpha.1', - '@storybook/vue': '7.4.0-alpha.1', - '@storybook/vue-vite': '7.4.0-alpha.1', - '@storybook/vue-webpack5': '7.4.0-alpha.1', - '@storybook/vue3': '7.4.0-alpha.1', - '@storybook/vue3-vite': '7.4.0-alpha.1', - '@storybook/vue3-webpack5': '7.4.0-alpha.1', - '@storybook/web-components': '7.4.0-alpha.1', - '@storybook/web-components-vite': '7.4.0-alpha.1', - '@storybook/web-components-webpack5': '7.4.0-alpha.1', - sb: '7.4.0-alpha.1', - storybook: '7.4.0-alpha.1', + '@storybook/addon-a11y': '7.4.0-alpha.2', + '@storybook/addon-actions': '7.4.0-alpha.2', + '@storybook/addon-backgrounds': '7.4.0-alpha.2', + '@storybook/addon-controls': '7.4.0-alpha.2', + '@storybook/addon-docs': '7.4.0-alpha.2', + '@storybook/addon-essentials': '7.4.0-alpha.2', + '@storybook/addon-highlight': '7.4.0-alpha.2', + '@storybook/addon-interactions': '7.4.0-alpha.2', + '@storybook/addon-jest': '7.4.0-alpha.2', + '@storybook/addon-links': '7.4.0-alpha.2', + '@storybook/addon-mdx-gfm': '7.4.0-alpha.2', + '@storybook/addon-measure': '7.4.0-alpha.2', + '@storybook/addon-outline': '7.4.0-alpha.2', + '@storybook/addon-themes': '7.4.0-alpha.2', + '@storybook/addon-storyshots': '7.4.0-alpha.2', + '@storybook/addon-storyshots-puppeteer': '7.4.0-alpha.2', + '@storybook/addon-storysource': '7.4.0-alpha.2', + '@storybook/addon-toolbars': '7.4.0-alpha.2', + '@storybook/addon-viewport': '7.4.0-alpha.2', + '@storybook/addons': '7.4.0-alpha.2', + '@storybook/angular': '7.4.0-alpha.2', + '@storybook/api': '7.4.0-alpha.2', + '@storybook/blocks': '7.4.0-alpha.2', + '@storybook/builder-manager': '7.4.0-alpha.2', + '@storybook/builder-vite': '7.4.0-alpha.2', + '@storybook/builder-webpack5': '7.4.0-alpha.2', + '@storybook/channel-postmessage': '7.4.0-alpha.2', + '@storybook/channel-websocket': '7.4.0-alpha.2', + '@storybook/channels': '7.4.0-alpha.2', + '@storybook/cli': '7.4.0-alpha.2', + '@storybook/client-api': '7.4.0-alpha.2', + '@storybook/client-logger': '7.4.0-alpha.2', + '@storybook/codemod': '7.4.0-alpha.2', + '@storybook/components': '7.4.0-alpha.2', + '@storybook/core-client': '7.4.0-alpha.2', + '@storybook/core-common': '7.4.0-alpha.2', + '@storybook/core-events': '7.4.0-alpha.2', + '@storybook/core-server': '7.4.0-alpha.2', + '@storybook/core-webpack': '7.4.0-alpha.2', + '@storybook/csf-plugin': '7.4.0-alpha.2', + '@storybook/csf-tools': '7.4.0-alpha.2', + '@storybook/docs-tools': '7.4.0-alpha.2', + '@storybook/ember': '7.4.0-alpha.2', + '@storybook/html': '7.4.0-alpha.2', + '@storybook/html-vite': '7.4.0-alpha.2', + '@storybook/html-webpack5': '7.4.0-alpha.2', + '@storybook/instrumenter': '7.4.0-alpha.2', + '@storybook/manager': '7.4.0-alpha.2', + '@storybook/manager-api': '7.4.0-alpha.2', + '@storybook/nextjs': '7.4.0-alpha.2', + '@storybook/node-logger': '7.4.0-alpha.2', + '@storybook/postinstall': '7.4.0-alpha.2', + '@storybook/preact': '7.4.0-alpha.2', + '@storybook/preact-vite': '7.4.0-alpha.2', + '@storybook/preact-webpack5': '7.4.0-alpha.2', + '@storybook/preset-create-react-app': '7.4.0-alpha.2', + '@storybook/preset-html-webpack': '7.4.0-alpha.2', + '@storybook/preset-preact-webpack': '7.4.0-alpha.2', + '@storybook/preset-react-webpack': '7.4.0-alpha.2', + '@storybook/preset-server-webpack': '7.4.0-alpha.2', + '@storybook/preset-svelte-webpack': '7.4.0-alpha.2', + '@storybook/preset-vue-webpack': '7.4.0-alpha.2', + '@storybook/preset-vue3-webpack': '7.4.0-alpha.2', + '@storybook/preset-web-components-webpack': '7.4.0-alpha.2', + '@storybook/preview': '7.4.0-alpha.2', + '@storybook/preview-api': '7.4.0-alpha.2', + '@storybook/preview-web': '7.4.0-alpha.2', + '@storybook/react': '7.4.0-alpha.2', + '@storybook/react-dom-shim': '7.4.0-alpha.2', + '@storybook/react-vite': '7.4.0-alpha.2', + '@storybook/react-webpack5': '7.4.0-alpha.2', + '@storybook/router': '7.4.0-alpha.2', + '@storybook/server': '7.4.0-alpha.2', + '@storybook/server-webpack5': '7.4.0-alpha.2', + '@storybook/source-loader': '7.4.0-alpha.2', + '@storybook/store': '7.4.0-alpha.2', + '@storybook/svelte': '7.4.0-alpha.2', + '@storybook/svelte-vite': '7.4.0-alpha.2', + '@storybook/svelte-webpack5': '7.4.0-alpha.2', + '@storybook/sveltekit': '7.4.0-alpha.2', + '@storybook/telemetry': '7.4.0-alpha.2', + '@storybook/theming': '7.4.0-alpha.2', + '@storybook/types': '7.4.0-alpha.2', + '@storybook/vue': '7.4.0-alpha.2', + '@storybook/vue-vite': '7.4.0-alpha.2', + '@storybook/vue-webpack5': '7.4.0-alpha.2', + '@storybook/vue3': '7.4.0-alpha.2', + '@storybook/vue3-vite': '7.4.0-alpha.2', + '@storybook/vue3-webpack5': '7.4.0-alpha.2', + '@storybook/web-components': '7.4.0-alpha.2', + '@storybook/web-components-vite': '7.4.0-alpha.2', + '@storybook/web-components-webpack5': '7.4.0-alpha.2', + sb: '7.4.0-alpha.2', + storybook: '7.4.0-alpha.2', }; diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index ef9fcd2b76e..979725dae34 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 17a477dc70f..2606573d269 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 04b6c56ac08..2d0193d3e75 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index ce2bb693b3b..c53633ff254 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index b61bdda65d9..bbae41b4f41 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index a106ecd7379..905cb09aa5c 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 7d1861f9580..a38f2350b46 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index a3b8823e455..441a17b1dda 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 78b6986795f..31628435b74 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 1e417bffe8a..f53e74ff9ff 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index bf05da714bc..7f2566a63dc 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index b44861c925b..71da909fc64 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '7.4.0-alpha.1'; +export const version = '7.4.0-alpha.2'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 594be411c90..52efe3cbde6 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index a39b6d79634..073d6aa3e82 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook addons postinstall utilities", "keywords": [ "api", diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index ab860ca4d43..da9d2d75578 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index cb5379fcb51..097bc0e89ae 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index ab60d278783..536b11e5e03 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "", "keywords": [ "storybook" diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 5f61cae7451..781912d0670 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 8e37eb335a5..9495a137c18 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index 9a499323217..22fa64bb7b4 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index acf2f1860bb..dbdb97937c8 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/lib/types/package.json b/code/lib/types/package.json index b44b80ccfc4..dbae3876bf2 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index 3a3fba278a5..196be495bf4 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -327,6 +327,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "7.4.0-alpha.2" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index c2c17371d8c..1eb7e78f348 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index fc7353808c7..21d6dccaa3a 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index cc5998189cf..573dec779a7 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index a379ac3ab55..d61c44306e2 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 457d485368f..7ec7c6bcf88 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 3976a5faa91..a2edea524c9 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index 9c6f1a9b0d4..691b37f0511 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 7a03e573259..474ee3a2b5a 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index 1905636da4f..bca248c3766 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-web-components-webpack", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 33d6d258405..7c7b5030d35 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 25b386c6d07..540d1d160ec 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index b175c1b68d8..f441fa61484 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 2a5c8f83ca0..47157d77b3c 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 69bcd6063da..f75fadbad62 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index f186367d1ec..a15d81a5179 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Vue renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index e8c342368ca..692bc1324e9 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 2a86d748672..6c175803976 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook web-components renderer", "keywords": [ "lit", diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index 505b9b6ae3a..2956fd10dbd 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/ui/components/package.json b/code/ui/components/package.json index 55edae33f78..55e4c8091b8 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index e77fbf835f8..a25ec1c3761 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "7.4.0-alpha.1", + "version": "7.4.0-alpha.2", "description": "Core Storybook UI", "keywords": [ "storybook" From 552829ace4f1f1164c459b9f2bebc4c91634b16b Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Fri, 25 Aug 2023 15:03:49 -0400 Subject: [PATCH 023/171] Move isCorePackage to utils --- code/lib/cli/src/upgrade.test.ts | 25 +------------------------ code/lib/cli/src/upgrade.ts | 32 +------------------------------- code/lib/cli/src/utils.test.ts | 21 +++++++++++++++++++++ code/lib/cli/src/utils.ts | 31 +++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 55 deletions(-) create mode 100644 code/lib/cli/src/utils.test.ts diff --git a/code/lib/cli/src/upgrade.test.ts b/code/lib/cli/src/upgrade.test.ts index 0c70a5ad2e2..1110946e0b2 100644 --- a/code/lib/cli/src/upgrade.test.ts +++ b/code/lib/cli/src/upgrade.test.ts @@ -1,9 +1,4 @@ -import { - addExtraFlags, - addNxPackagesToReject, - getStorybookVersion, - isCorePackage, -} from './upgrade'; +import { addExtraFlags, addNxPackagesToReject, getStorybookVersion } from './upgrade'; describe.each([ ['│ │ │ ├── @babel/code-frame@7.10.3 deduped', null], @@ -26,24 +21,6 @@ describe.each([ }); }); -describe.each([ - ['@storybook/react', true], - ['@storybook/node-logger', true], - ['@storybook/addon-info', true], - ['@storybook/something-random', true], - ['@storybook/preset-create-react-app', false], - ['@storybook/linter-config', false], - ['@storybook/design-system', false], - ['@storybook/addon-styling', false], - ['@storybook/addon-styling-webpack', false], - ['@nx/storybook', false], - ['@nrwl/storybook', false], -])('isCorePackage', (input, output) => { - it(`${input}`, () => { - expect(isCorePackage(input)).toEqual(output); - }); -}); - describe('extra flags', () => { const extraFlags = { 'react-scripts@<5': ['--foo'], diff --git a/code/lib/cli/src/upgrade.ts b/code/lib/cli/src/upgrade.ts index a125e77a950..24effe5758e 100644 --- a/code/lib/cli/src/upgrade.ts +++ b/code/lib/cli/src/upgrade.ts @@ -8,6 +8,7 @@ import type { PackageJsonWithMaybeDeps, PackageManagerName } from './js-package- import { getPackageDetails, JsPackageManagerFactory, useNpmWarning } from './js-package-manager'; import { commandLog } from './helpers'; import { automigrate } from './automigrate'; +import { isCorePackage } from './utils'; type Package = { package: string; @@ -25,37 +26,6 @@ export const getStorybookVersion = (line: string) => { }; }; -const excludeList = [ - '@storybook/addon-bench', - '@storybook/addon-console', - '@storybook/addon-postcss', - '@storybook/addon-styling', - '@storybook/addon-styling-webpack', - '@storybook/babel-plugin-require-context-hook', - '@storybook/bench', - '@storybook/builder-vite', - '@storybook/csf', - '@storybook/design-system', - '@storybook/ember-cli-storybook', - '@storybook/eslint-config-storybook', - '@storybook/expect', - '@storybook/jest', - '@storybook/linter-config', - '@storybook/mdx1-csf', - '@storybook/mdx2-csf', - '@storybook/react-docgen-typescript-plugin', - '@storybook/storybook-deployer', - '@storybook/test-runner', - '@storybook/testing-library', - '@storybook/testing-react', - '@nrwl/storybook', - '@nx/storybook', -]; -export const isCorePackage = (pkg: string) => - pkg.startsWith('@storybook/') && - !pkg.startsWith('@storybook/preset-') && - !excludeList.includes(pkg); - const deprecatedPackages = [ { minVersion: '6.0.0-alpha.0', diff --git a/code/lib/cli/src/utils.test.ts b/code/lib/cli/src/utils.test.ts new file mode 100644 index 00000000000..6d7dd9fe9ea --- /dev/null +++ b/code/lib/cli/src/utils.test.ts @@ -0,0 +1,21 @@ +import { isCorePackage } from './utils'; + +describe('UTILS', () => { + describe.each([ + ['@storybook/react', true], + ['@storybook/node-logger', true], + ['@storybook/addon-info', true], + ['@storybook/something-random', true], + ['@storybook/preset-create-react-app', false], + ['@storybook/linter-config', false], + ['@storybook/design-system', false], + ['@storybook/addon-styling', false], + ['@storybook/addon-styling-webpack', false], + ['@nx/storybook', false], + ['@nrwl/storybook', false], + ])('isCorePackage', (input, output) => { + it(`It should return "${output}" when given "${input}"`, () => { + expect(isCorePackage(input)).toEqual(output); + }); + }); +}); diff --git a/code/lib/cli/src/utils.ts b/code/lib/cli/src/utils.ts index 1aedbe047d5..b7d9ac81176 100644 --- a/code/lib/cli/src/utils.ts +++ b/code/lib/cli/src/utils.ts @@ -97,3 +97,34 @@ export const createLogStream = async ( logStream.once('error', reject); }); }; + +const PACKAGES_EXCLUDED_FROM_CORE = [ + '@storybook/addon-bench', + '@storybook/addon-console', + '@storybook/addon-postcss', + '@storybook/addon-styling', + '@storybook/addon-styling-webpack', + '@storybook/babel-plugin-require-context-hook', + '@storybook/bench', + '@storybook/builder-vite', + '@storybook/csf', + '@storybook/design-system', + '@storybook/ember-cli-storybook', + '@storybook/eslint-config-storybook', + '@storybook/expect', + '@storybook/jest', + '@storybook/linter-config', + '@storybook/mdx1-csf', + '@storybook/mdx2-csf', + '@storybook/react-docgen-typescript-plugin', + '@storybook/storybook-deployer', + '@storybook/test-runner', + '@storybook/testing-library', + '@storybook/testing-react', + '@nrwl/storybook', + '@nx/storybook', +]; +export const isCorePackage = (pkg: string) => + pkg.startsWith('@storybook/') && + !pkg.startsWith('@storybook/preset-') && + !PACKAGES_EXCLUDED_FROM_CORE.includes(pkg); From 3750f3a682bdea7d1f1c9f0fb24db7bd060f4160 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Fri, 25 Aug 2023 15:04:09 -0400 Subject: [PATCH 024/171] Don't use SB version on non-core packages --- code/lib/cli/src/add.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/add.ts b/code/lib/cli/src/add.ts index c5ddd1b1c99..a163e1f1e34 100644 --- a/code/lib/cli/src/add.ts +++ b/code/lib/cli/src/add.ts @@ -7,7 +7,7 @@ import { useNpmWarning, type PackageManagerName, } from './js-package-manager'; -import { getStorybookVersion } from './utils'; +import { getStorybookVersion, isCorePackage } from './utils'; const logger = console; @@ -76,8 +76,9 @@ export async function add( // add to package.json const isStorybookAddon = addonName.startsWith('@storybook/'); + const isAddonFromCore = isCorePackage(addonName); const storybookVersion = await getStorybookVersion(packageManager); - const version = versionSpecifier || (isStorybookAddon ? storybookVersion : latestVersion); + const version = versionSpecifier || (isAddonFromCore ? storybookVersion : latestVersion); const addonWithVersion = SemVer.valid(version) ? `${addonName}@^${version}` : `${addonName}@${version}`; From 5a2ed3d0a8982e4064caeb1c6da27d74d9be3500 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Sat, 26 Aug 2023 17:07:24 +0100 Subject: [PATCH 025/171] Extra Doc blocks videos --- docs/api/doc-block-colorpalette.md | 2 ++ docs/api/doc-block-icongallery.md | 2 ++ docs/api/doc-block-typeset.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/api/doc-block-colorpalette.md b/docs/api/doc-block-colorpalette.md index 3229612173c..b97c6ec67b5 100644 --- a/docs/api/doc-block-colorpalette.md +++ b/docs/api/doc-block-colorpalette.md @@ -2,6 +2,8 @@ title: 'ColorPalette' --- + + The `ColorPalette` block allows you to document all color-related items (e.g., swatches) used throughout your project. ![Screenshot of ColorPalette and ColorItem blocks](./doc-block-colorpalette.png) diff --git a/docs/api/doc-block-icongallery.md b/docs/api/doc-block-icongallery.md index db16ee30ed5..c89f511f2b6 100644 --- a/docs/api/doc-block-icongallery.md +++ b/docs/api/doc-block-icongallery.md @@ -2,6 +2,8 @@ title: 'IconGallery' --- + + The `IconGallery` block enables you to easily document React icon components associated with your project, displayed in a neat grid. ![Screenshot of IconGallery and IconItem blocks](./doc-block-icongallery.png) diff --git a/docs/api/doc-block-typeset.md b/docs/api/doc-block-typeset.md index 854cd140232..22933dc5f52 100644 --- a/docs/api/doc-block-typeset.md +++ b/docs/api/doc-block-typeset.md @@ -2,6 +2,8 @@ title: 'Typeset' --- + + The `Typeset` block helps document the fonts used throughout your project. ![Screenshot of Typeset block](./doc-block-typeset.png) From 5f32f1752c9d37343e6fd54ebc5955394c114a05 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 28 Aug 2023 10:30:04 +0200 Subject: [PATCH 026/171] improve autotitle stories format handling --- .../cli/src/automigrate/fixes/mdx-gfm.test.ts | 22 +++++++++++++++++++ code/lib/cli/src/automigrate/fixes/mdx-gfm.ts | 13 +++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts b/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts index e7d7f0c2a30..45d6704c86e 100644 --- a/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts +++ b/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts @@ -128,4 +128,26 @@ describe('continue', () => { }) ).resolves.toBeTruthy(); }); + test('stories object with directory + files', async () => { + await expect( + check({ + packageManager: {}, + main: { + stories: [{ directory: 'src', titlePrefix: 'src', files: '' }], + addons: ['@storybook/addon-essentials'], + }, + }) + ).resolves.toBeTruthy(); + }); + test('stories object with directory and no files', async () => { + await expect( + check({ + packageManager: {}, + main: { + stories: [{ directory: 'src', titlePrefix: 'src' }], + addons: ['@storybook/addon-essentials'], + }, + }) + ).resolves.toBeTruthy(); + }); }); diff --git a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts index d138f9578f4..1601dce8957 100644 --- a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts +++ b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts @@ -31,10 +31,15 @@ export const mdxgfm: Fix = { return true; } - const pattern = - typeof item === 'string' - ? slash(join(configDir, item)) - : slash(join(configDir, item.directory, item.files)); + let pattern; + + if (typeof item === 'string') { + pattern = slash(join(configDir, item)); + } else if (typeof item === 'object') { + const directory = item.directory || '..'; + const files = item.files || '**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))'; + pattern = slash(join(configDir, directory, files)); + } const files = await glob(pattern, commonGlobOptions(pattern)); From 9f39fea2ff88efb1b86191f2b80e960a0d5acb0d Mon Sep 17 00:00:00 2001 From: Abdullah Mansoor Date: Mon, 28 Aug 2023 15:11:56 +0530 Subject: [PATCH 027/171] React.ReactElement not found issue --- code/lib/types/src/modules/api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/lib/types/src/modules/api.ts b/code/lib/types/src/modules/api.ts index 1fbaf0bba9b..694510e27ee 100644 --- a/code/lib/types/src/modules/api.ts +++ b/code/lib/types/src/modules/api.ts @@ -8,6 +8,8 @@ import type { API_FilterFunction, API_HashEntry, API_IndexHash } from './api-sto import type { SetStoriesStory, SetStoriesStoryData } from './channelApi'; import type { Addon_BaseType, Addon_Collection, Addon_RenderOptions, Addon_Type } from './addons'; import type { StoryIndex } from './indexer'; +import React from 'react'; + type OrString = T | (string & {}); From 9e035970e630d6c24a1efb5abe722940bf6ca41f Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 28 Aug 2023 12:43:25 +0200 Subject: [PATCH 028/171] cleanup --- code/lib/types/package.json | 1 + code/lib/types/src/modules/api.ts | 5 ++--- code/yarn.lock | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/lib/types/package.json b/code/lib/types/package.json index dbae3876bf2..871e4131a54 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -52,6 +52,7 @@ "devDependencies": { "@storybook/csf": "^0.1.0", "@types/node": "^16.0.0", + "@types/react": "^16.14.34", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/lib/types/src/modules/api.ts b/code/lib/types/src/modules/api.ts index 694510e27ee..53fa99965b5 100644 --- a/code/lib/types/src/modules/api.ts +++ b/code/lib/types/src/modules/api.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ +import type { ReactElement } from 'react'; import type { RenderData } from '../../../router/src/types'; import type { Channel } from '../../../channels/src'; import type { ThemeVars } from '../../../theming/src/types'; @@ -8,8 +9,6 @@ import type { API_FilterFunction, API_HashEntry, API_IndexHash } from './api-sto import type { SetStoriesStory, SetStoriesStoryData } from './channelApi'; import type { Addon_BaseType, Addon_Collection, Addon_RenderOptions, Addon_Type } from './addons'; import type { StoryIndex } from './indexer'; -import React from 'react'; - type OrString = T | (string & {}); @@ -76,7 +75,7 @@ export type API_IframeRenderer = ( baseUrl: string, scale: number, queryParams: Record -) => React.ReactElement | null; +) => ReactElement | null; export interface API_UIOptions { name?: string; diff --git a/code/yarn.lock b/code/yarn.lock index f6d64d96598..0c3bd9b6b83 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -8037,6 +8037,7 @@ __metadata: "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 "@types/node": ^16.0.0 + "@types/react": ^16.14.34 file-system-cache: 2.3.0 typescript: ~4.9.3 languageName: unknown From 8ceec7d72828b16db4bf3a77dc9aace1a4bcf648 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 28 Aug 2023 12:51:52 +0200 Subject: [PATCH 029/171] add as a dependency, to ensure the right version is used --- code/lib/types/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 871e4131a54..2cca8688ce9 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -47,12 +47,12 @@ "@storybook/channels": "workspace:*", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", + "@types/react": "^16.14.34", "file-system-cache": "2.3.0" }, "devDependencies": { "@storybook/csf": "^0.1.0", "@types/node": "^16.0.0", - "@types/react": "^16.14.34", "typescript": "~4.9.3" }, "publishConfig": { From 73382295aede3ec9cfdf69d0da3b0cd120713d76 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 28 Aug 2023 14:11:09 +0200 Subject: [PATCH 030/171] don't pass --no-install to create-qwik --- code/lib/cli/src/sandbox-templates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 95aa9bf029a..bbfdaef49ef 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -422,7 +422,7 @@ const baseTemplates = { }, 'qwik-vite/default-ts': { name: 'Qwik CLI (Default TS)', - script: 'yarn create qwik basic {{beforeDir}} --no-install', + script: 'yarn create qwik basic {{beforeDir}}', // TODO: The community template does not provide standard stories, which is required for e2e tests. Reenable once it does. inDevelopment: true, expected: { From cbd91aad94e8d3977e958f9d87293a01a6d4f574 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 28 Aug 2023 14:28:00 +0200 Subject: [PATCH 031/171] set server init generator to use Webpack5 --- code/lib/cli/src/generators/SERVER/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/generators/SERVER/index.ts b/code/lib/cli/src/generators/SERVER/index.ts index 966efee9089..c99b69e4902 100755 --- a/code/lib/cli/src/generators/SERVER/index.ts +++ b/code/lib/cli/src/generators/SERVER/index.ts @@ -6,7 +6,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => { await baseGenerator( packageManager, npmOptions, - { ...options, builder: CoreBuilder.Vite }, + { ...options, builder: CoreBuilder.Webpack5 }, 'server', { extensions: ['json', 'yaml', 'yml'], From 7c6488c966f4c0a966450adf0d36109346be3169 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 28 Aug 2023 20:57:31 +0800 Subject: [PATCH 032/171] Upgrade escodegen to fix security issue --- code/renderers/react/package.json | 2 +- code/yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index f441fa61484..50243cff2c6 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -66,7 +66,7 @@ "acorn": "^7.4.1", "acorn-jsx": "^5.3.1", "acorn-walk": "^7.2.0", - "escodegen": "^2.0.0", + "escodegen": "^2.1.0", "html-tags": "^3.1.0", "lodash": "^4.17.21", "prop-types": "^15.7.2", diff --git a/code/yarn.lock b/code/yarn.lock index 0c3bd9b6b83..debf9c20cd8 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -7603,7 +7603,7 @@ __metadata: acorn: ^7.4.1 acorn-jsx: ^5.3.1 acorn-walk: ^7.2.0 - escodegen: ^2.0.0 + escodegen: ^2.1.0 expect-type: ^0.15.0 html-tags: ^3.1.0 jest-specific-snapshot: ^8.0.0 @@ -15519,7 +15519,7 @@ __metadata: languageName: node linkType: hard -"escodegen@npm:^2.0.0": +"escodegen@npm:^2.0.0, escodegen@npm:^2.1.0": version: 2.1.0 resolution: "escodegen@npm:2.1.0" dependencies: From 0b911763d80ea4e0fbf69a51bc38f81938a244b7 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 28 Aug 2023 21:12:16 +0800 Subject: [PATCH 033/171] Core: Fix indexing for non-prefixed `stories.*` stories --- .../core-server/src/presets/common-preset.ts | 2 +- .../src/utils/StoryIndexGenerator.test.ts | 30 +++++++++++++++++++ .../src/utils/__mockdata__/src/stories.ts | 7 +++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 code/lib/core-server/src/utils/__mockdata__/src/stories.ts diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 36816316ccb..9d581c307c7 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -196,7 +196,7 @@ export const features = async ( }); export const csfIndexer: Indexer = { - test: /\.(stories|story)\.(m?js|ts)x?$/, + test: /(stories|story)\.(m?js|ts)x?$/, index: async (fileName, options) => (await readCsf(fileName, options)).parse().indexInputs, }; diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts index b1097c168a8..21b6d871802 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts @@ -129,6 +129,36 @@ describe('StoryIndexGenerator', () => { `); }); }); + describe('no prefix stories specifier', () => { + it.only('extracts stories from the right files', async () => { + const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry( + './src/stories.ts', + options + ); + + const generator = new StoryIndexGenerator([specifier], options); + await generator.initialize(); + + expect(await generator.getIndex()).toMatchInlineSnapshot(` + Object { + "entries": Object { + "stories--story-one": Object { + "id": "stories--story-one", + "importPath": "./src/stories.ts", + "name": "Story One", + "tags": Array [ + "autodocs", + "story", + ], + "title": "stories", + "type": "story", + }, + }, + "v": 4, + } + `); + }); + }); describe('non-recursive specifier', () => { it('extracts stories from the right files', async () => { const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry( diff --git a/code/lib/core-server/src/utils/__mockdata__/src/stories.ts b/code/lib/core-server/src/utils/__mockdata__/src/stories.ts new file mode 100644 index 00000000000..bb14d42c711 --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/stories.ts @@ -0,0 +1,7 @@ +const component = {}; +export default { + component, + tags: ['autodocs'], +}; + +export const StoryOne = {}; From 86c5b8382a071054df22255d9797c0bba92c9324 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 28 Aug 2023 21:36:41 +0800 Subject: [PATCH 034/171] Remove focused test --- code/lib/core-server/src/utils/StoryIndexGenerator.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts index 21b6d871802..fad7090789f 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts @@ -130,7 +130,7 @@ describe('StoryIndexGenerator', () => { }); }); describe('no prefix stories specifier', () => { - it.only('extracts stories from the right files', async () => { + it('extracts stories from the right files', async () => { const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry( './src/stories.ts', options From 63da1d85d37ca48fcb8dff594a078d009777d80d Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 24 Aug 2023 16:38:20 +0200 Subject: [PATCH 035/171] detect empty stories field and throw an error --- .../utils/__tests__/normalize-stories.test.ts | 35 +++++++++++++++---- .../src/utils/normalize-stories.ts | 10 ++++-- .../core-events/src/errors/server-errors.ts | 18 ++++++++++ docs/faq.md | 31 ++++++++++++++++ 4 files changed, 86 insertions(+), 8 deletions(-) diff --git a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts index ac42d9da581..0b857b7a57c 100644 --- a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts +++ b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts @@ -2,8 +2,14 @@ /// import { dedent } from 'ts-dedent'; +import { sep } from 'path'; -import { normalizeStoriesEntry } from '../normalize-stories'; +import { InvalidStoriesEntryError } from '@storybook/core-events/server-errors'; +import { + getDirectoryFromWorkingDir, + normalizeStories, + normalizeStoriesEntry, +} from '../normalize-stories'; expect.addSnapshotSerializer({ print: (val: any) => JSON.stringify(val, null, 2), @@ -47,12 +53,12 @@ jest.mock('fs', () => { }; }); -describe('normalizeStoriesEntry', () => { - const options = { - configDir: '/path/to/project/.storybook', - workingDir: '/path/to/project', - }; +const options = { + configDir: '/path/to/project/.storybook', + workingDir: '/path/to/project', +}; +describe('normalizeStoriesEntry', () => { it('direct file path', () => { const specifier = normalizeStoriesEntry('../path/to/file.stories.mdx', options); expect(specifier).toMatchInlineSnapshot(` @@ -310,3 +316,20 @@ describe('normalizeStoriesEntry', () => { ]); }); }); + +describe('getDirectoryFromWorkingDir', () => { + it('should return normalized story path', () => { + const normalizedPath = getDirectoryFromWorkingDir({ + configDir: '/path/to/project/.storybook', + workingDir: '/path/to/project', + directory: '/path/to/project/src', + }); + expect(normalizedPath).toBe(`.${sep}src`); + }); +}); + +describe('normalizeStories', () => { + it('should throw InvalidStoriesEntryError for empty entries', () => { + expect(() => normalizeStories([], options)).toThrow(InvalidStoriesEntryError); + }); +}); diff --git a/code/lib/core-common/src/utils/normalize-stories.ts b/code/lib/core-common/src/utils/normalize-stories.ts index fb0e1c782e2..9801fbeae30 100644 --- a/code/lib/core-common/src/utils/normalize-stories.ts +++ b/code/lib/core-common/src/utils/normalize-stories.ts @@ -4,6 +4,7 @@ import * as pico from 'picomatch'; import slash from 'slash'; import type { StoriesEntry, NormalizedStoriesSpecifier } from '@storybook/types'; +import { InvalidStoriesEntryError } from '@storybook/core-events/server-errors'; import { normalizeStoryPath } from './paths'; import { globToRegexp } from './glob-to-regexp'; @@ -100,5 +101,10 @@ interface NormalizeOptions { workingDir: string; } -export const normalizeStories = (entries: StoriesEntry[], options: NormalizeOptions) => - entries.map((entry) => normalizeStoriesEntry(entry, options)); +export const normalizeStories = (entries: StoriesEntry[], options: NormalizeOptions) => { + if (!entries || (Array.isArray(entries) && entries.length === 0)) { + throw new InvalidStoriesEntryError(); + } + + return entries.map((entry) => normalizeStoriesEntry(entry, options)); +}; diff --git a/code/lib/core-events/src/errors/server-errors.ts b/code/lib/core-events/src/errors/server-errors.ts index f12926d0f4a..93f7355a302 100644 --- a/code/lib/core-events/src/errors/server-errors.ts +++ b/code/lib/core-events/src/errors/server-errors.ts @@ -119,3 +119,21 @@ export class ConflictingStaticDirConfigError extends StorybookError { `; } } + +export class InvalidStoriesEntryError extends StorybookError { + readonly category = Category.CORE_COMMON; + + readonly code = 4; + + public readonly documentation = + 'https://storybook.js.org/docs/react/faq#can-i-have-a-storybook-with-no-local-stories'; + + template() { + return dedent` + Storybook could not index your stories. + Your main configuration somehow does not contain a 'stories' field, or it resolved to an empty array. + + Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array. + `; + } +} diff --git a/docs/faq.md b/docs/faq.md index a60c06db15e..015c7310023 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -16,6 +16,7 @@ Here are some answers to frequently asked questions. If you have a question, you - [Why is there no addons channel?](#why-is-there-no-addons-channel) - [Why aren't Controls visible in the Canvas panel but visible in Docs?](#why-arent-controls-visible-in-the-canvas-panel-but-visible-in-docs) - [Why aren't the addons working in a composed Storybook?](#why-arent-the-addons-working-in-a-composed-storybook) +- [Can I have a Storybook with no local stories?](#can-i-have-a-storybook-with-no-local-stories) - [Which community addons are compatible with the latest version of Storybook?](#which-community-addons-are-compatible-with-the-latest-version-of-storybook) - [Is it possible to browse the documentation for past versions of Storybook?](#is-it-possible-to-browse-the-documentation-for-past-versions-of-storybook) - [What icons are available for my toolbar or my addon?](#what-icons-are-available-for-my-toolbar-or-my-addon) @@ -218,6 +219,36 @@ For now, the addons you're using in a composed Storybook will not work. We're working on overcoming this limitation, and soon you'll be able to use them as if you are working with a non-composed Storybook. +## Can I have a Storybook with no local stories? + +Storybook does not work unless you define at least one local story. + +If you're in a Storybook composition scenario, where you have multiple Storybooks, and want to have an extra Storybook with no stories of its own, that serves as a "glue" for all the other Storybooks in a project for demo/documentation purposes, you can do the following steps: + +Introduce a single `.mdx` story (addon-essentials or addon-docs required), that serves as an Introduction page, like so: + +```mdx +// Introduction.mdx +# Welcome + +Some description here +``` + +And then refer to it in your main.js file: + +```ts +// .storybook/main.js +const config = { + stories: ['../Introduction.mdx'], + refs: { + firstProject: { title: 'First', url: 'some-url' }, + secondProject: { title: 'Second', url: 'other-url' }, + } + // ... +} +export default config; +``` + ## Which community addons are compatible with the latest version of Storybook? Starting with Storybook version 6.0, we've introduced some great features aimed at streamlining your development workflow. From 4e6d66fba12f78c1b00c5f52994f055a19f69984 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 29 Aug 2023 09:58:46 +0200 Subject: [PATCH 036/171] tweak faq --- docs/faq.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 015c7310023..83756f4152c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -221,25 +221,27 @@ We're working on overcoming this limitation, and soon you'll be able to use them ## Can I have a Storybook with no local stories? -Storybook does not work unless you define at least one local story. +Storybook does not work unless you have at least one local story (or docs page) defined in your project. In this context, local means a `.stories.*` or `.mdx` file that is referenced in your project's `.storybook/main.js` config. -If you're in a Storybook composition scenario, where you have multiple Storybooks, and want to have an extra Storybook with no stories of its own, that serves as a "glue" for all the other Storybooks in a project for demo/documentation purposes, you can do the following steps: +If you're in a [Storybook composition](https://storybook.js.org/docs/react/sharing/storybook-composition) scenario, where you have multiple Storybooks, and want to have an extra Storybook with no stories of its own, that serves as a "glue" for all the other Storybooks in a project for demo/documentation purposes, you can do the following steps: -Introduce a single `.mdx` story (addon-essentials or addon-docs required), that serves as an Introduction page, like so: +Introduce a single `.mdx` docs page (addon-essentials or addon-docs required), that serves as an Introduction page, like so: ```mdx -// Introduction.mdx + # Welcome Some description here ``` -And then refer to it in your main.js file: +And then refer to it in your Storybook config file: ```ts // .storybook/main.js const config = { + // define at least one local story/page here stories: ['../Introduction.mdx'], + // define composed Storybooks here refs: { firstProject: { title: 'First', url: 'some-url' }, secondProject: { title: 'Second', url: 'other-url' }, From fe537c2e3df5d571e06bfd45a6a2ee5d2a05a75c Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Tue, 29 Aug 2023 08:20:57 +0000 Subject: [PATCH 037/171] Write changelog for 7.4.0 --- CHANGELOG.md | 11 +++++++++++ code/package.json | 3 ++- docs/versions/latest.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4d663ad99..464cd6afb07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 7.4.0 + +- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)! +- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)! +- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)! +- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)! +- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)! +- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)! +- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)! +- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)! + ## 7.3.2 - Maintenance: Revert "WebpackBuilder: Remove need for `react` as peerDependency" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)! diff --git a/code/package.json b/code/package.json index 196be495bf4..13abddf3913 100644 --- a/code/package.json +++ b/code/package.json @@ -327,5 +327,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "7.4.0" } diff --git a/docs/versions/latest.json b/docs/versions/latest.json index 7618803cf16..d4621d021c4 100644 --- a/docs/versions/latest.json +++ b/docs/versions/latest.json @@ -1 +1 @@ -{"version":"7.3.0","info":{"plain":"- Core: Improve `composeStories` typings - [#23577](https://github.com/storybookjs/storybook/pull/23577), thanks [@yannbf](https://github.com/yannbf)!"}} +{"version":"7.4.0","info":{"plain":"- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!"}} From dbf7f61ad689252dbdd971010755a2f28d1208b3 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 29 Aug 2023 10:27:49 +0200 Subject: [PATCH 038/171] merge prerelease changelogs to 7.4.0 [skip ci] --- CHANGELOG.md | 28 ++++++++++++++++++++++++++-- docs/versions/latest.json | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464cd6afb07..6a0baacd83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,38 @@ ## 7.4.0 +- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)! +- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)! +- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)! +- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)! - CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)! - CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)! +- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)! +- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)! - CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)! +- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)! +- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)! - Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)! +- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)! - Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)! - Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)! +- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)! +- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)! +- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)! +- Maintenance: Revert "WebpackBuilder: Remove need for `react` as peerDependency" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)! +- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)! +- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)! +- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)! - Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)! - Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)! +- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)! +- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)! +- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)! ## 7.3.2 @@ -84,7 +109,6 @@ Storybook 7.2 is the first of these new, faster releases: - UI: Show the story status in the search results - [#23441](https://github.com/storybookjs/storybook/pull/23441), thanks [@ndelangen](https://github.com/ndelangen)! - UI: Create new form elements in the new Core UI (Input, TextArea, Select) - [#23469](https://github.com/storybookjs/storybook/pull/23469), thanks [@cdedreuille](https://github.com/cdedreuille)! - ## 7.1.1 - Angular: Make enableProdMode optional - [#23489](https://github.com/storybookjs/storybook/pull/23489), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! @@ -103,7 +127,7 @@ Storybook 7.1 is here! 🎉 - 📗 **Vue3 source snippets** and reactivity improvements - 💯 **Hundreds more** fixes and improvements -7.1 contains hundreds more fixes, features, and tweaks. Browse the changelogs matching `7.1.0-alpha.*`, `7.1.0-beta.*`, and `7.1.0-rc.*` for the full list of changes. + 7.1 contains hundreds more fixes, features, and tweaks. Browse the changelogs matching `7.1.0-alpha.*`, `7.1.0-beta.*`, and `7.1.0-rc.*` for the full list of changes. For a better upgrade experience, please use one of the following commands: diff --git a/docs/versions/latest.json b/docs/versions/latest.json index d4621d021c4..18bc602521b 100644 --- a/docs/versions/latest.json +++ b/docs/versions/latest.json @@ -1 +1 @@ -{"version":"7.4.0","info":{"plain":"- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!"}} +{"version":"7.4.0","info":{"plain":"- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)!\n- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Revert "WebpackBuilder: Remove need for `react` as peerDependency" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)!\n- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)!\n- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)!\n- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)!"}} From e38d1ab6c307551cff0bca6467052b687d29c24c Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:10:43 +0000 Subject: [PATCH 039/171] Bump version from "7.4.0-alpha.2" to "7.4.0" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storyshots-core/package.json | 2 +- code/addons/storyshots-puppeteer/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-manager/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/deprecated/addons/package.json | 2 +- .../channel-postmessage/package.json | 2 +- .../deprecated/channel-websocket/package.json | 2 +- code/deprecated/client-api/package.json | 2 +- code/deprecated/core-client/package.json | 2 +- code/deprecated/manager-api-shim/package.json | 2 +- code/deprecated/preview-web/package.json | 2 +- code/deprecated/store/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue-vite/package.json | 2 +- code/frameworks/vue-webpack5/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/channels/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/cli/src/versions.ts | 188 +++++++++--------- code/lib/client-logger/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-common/package.json | 2 +- code/lib/core-events/package.json | 2 +- code/lib/core-server/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/csf-tools/package.json | 2 +- code/lib/docs-tools/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/manager-api/package.json | 2 +- code/lib/manager-api/src/version.ts | 2 +- code/lib/node-logger/package.json | 2 +- code/lib/postinstall/package.json | 2 +- code/lib/preview-api/package.json | 2 +- code/lib/preview/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/router/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/telemetry/package.json | 2 +- code/lib/theming/package.json | 2 +- code/lib/types/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- .../web-components-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- code/ui/blocks/package.json | 2 +- code/ui/components/package.json | 2 +- code/ui/manager/package.json | 2 +- 97 files changed, 191 insertions(+), 192 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index e37bb3fbd7a..5a7c1215c46 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index f04f164a3fe..62e0156cd7e 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 4b27406819d..af672d68317 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index d7603cb7caf..c4e025a3168 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 27e8936644d..5c443e55334 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index eb3509db2aa..459bdde2d04 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 7f45471a169..a14a7eb5660 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 0a8664a64c8..a83314a5c24 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 47ac694796b..721e13cac58 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index ef10ff467c7..bb1f30c9106 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 3c025806707..60047cef410 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 0fe74f02c17..4b1466d0d3c 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 5628ca04a5c..3e0c58105cb 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index 4dda6f0c61f..e21c58a8890 100644 --- a/code/addons/storyshots-core/package.json +++ b/code/addons/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Take a code snapshot of every story automatically with Jest", "keywords": [ "addon", diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index 59184bc8ca2..4c966ff4357 100644 --- a/code/addons/storyshots-puppeteer/package.json +++ b/code/addons/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Image snapshots addition to StoryShots based on puppeteer", "keywords": [ "addon", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index dad4119e7da..be8581fc248 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index f9abcb3bc21..8e4a40ec9a0 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index c9adc3a916c..d988e992541 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 892098df73c..c7dae82f506 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index 28b6453a7b3..7f12ba26bea 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 3bd3891793a..9d38efab01e 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 8fe5bda194e..e24badba444 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 42688e68565..e8f710906b8 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook addons store", "keywords": [ "storybook" diff --git a/code/deprecated/channel-postmessage/package.json b/code/deprecated/channel-postmessage/package.json index 7677be32e2d..626bbf0529b 100644 --- a/code/deprecated/channel-postmessage/package.json +++ b/code/deprecated/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/channel-websocket/package.json b/code/deprecated/channel-websocket/package.json index 0df526a75f3..beca23fe6fe 100644 --- a/code/deprecated/channel-websocket/package.json +++ b/code/deprecated/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-api/package.json b/code/deprecated/client-api/package.json index dc5b07fcf18..330465df9e3 100644 --- a/code/deprecated/client-api/package.json +++ b/code/deprecated/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Client API", "keywords": [ "storybook" diff --git a/code/deprecated/core-client/package.json b/code/deprecated/core-client/package.json index 51f316799bb..d5eac9d32aa 100644 --- a/code/deprecated/core-client/package.json +++ b/code/deprecated/core-client/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-client", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 9852affc753..b873695766d 100644 --- a/code/deprecated/manager-api-shim/package.json +++ b/code/deprecated/manager-api-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" diff --git a/code/deprecated/preview-web/package.json b/code/deprecated/preview-web/package.json index 83ede355248..49a530b00f9 100644 --- a/code/deprecated/preview-web/package.json +++ b/code/deprecated/preview-web/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-web", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/store/package.json b/code/deprecated/store/package.json index dca05538778..6d6e9aa413f 100644 --- a/code/deprecated/store/package.json +++ b/code/deprecated/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index cf6bf428c4b..0611580a818 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 9fbc1ba59c0..16f724b1ba9 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 145d2f514a2..b7003719087 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 8006517f0e7..4f4704a723e 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index acdeb717794..a7cf4171ab4 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 25f3f46065b..b4e19bb7c8f 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 0ce84861e0c..7e59ec07cd5 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 986100d09e1..9e6b008bed0 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 1369b677c3e..00036ab34b9 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index e066f822938..e18f980f484 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 6c3b2b8bc00..e911b05375e 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 103b0c11b10..da70c830243 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 65c0126339f..fe3d0227169 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index d06d2f8e727..30ae8c7d541 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index fb9e2fad083..d5f2d05df30 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index b128c08736e..17a4cf65a98 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 42ed51c2862..e1c6efab600 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index c3f54f4b949..2a123ea0041 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 313240f3610..565f9ca6089 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index ac827abaed7..97be4d3904b 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 63a2425ecf9..fe90b2d6c39 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 23b6bb60d30..1e3e673d7bb 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 31f99791086..8dbcdb6b8c9 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index 1fb441cd11f..d55ca23b838 100644 --- a/code/lib/cli/src/versions.ts +++ b/code/lib/cli/src/versions.ts @@ -1,97 +1,97 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '7.4.0-alpha.2', - '@storybook/addon-actions': '7.4.0-alpha.2', - '@storybook/addon-backgrounds': '7.4.0-alpha.2', - '@storybook/addon-controls': '7.4.0-alpha.2', - '@storybook/addon-docs': '7.4.0-alpha.2', - '@storybook/addon-essentials': '7.4.0-alpha.2', - '@storybook/addon-highlight': '7.4.0-alpha.2', - '@storybook/addon-interactions': '7.4.0-alpha.2', - '@storybook/addon-jest': '7.4.0-alpha.2', - '@storybook/addon-links': '7.4.0-alpha.2', - '@storybook/addon-mdx-gfm': '7.4.0-alpha.2', - '@storybook/addon-measure': '7.4.0-alpha.2', - '@storybook/addon-outline': '7.4.0-alpha.2', - '@storybook/addon-themes': '7.4.0-alpha.2', - '@storybook/addon-storyshots': '7.4.0-alpha.2', - '@storybook/addon-storyshots-puppeteer': '7.4.0-alpha.2', - '@storybook/addon-storysource': '7.4.0-alpha.2', - '@storybook/addon-toolbars': '7.4.0-alpha.2', - '@storybook/addon-viewport': '7.4.0-alpha.2', - '@storybook/addons': '7.4.0-alpha.2', - '@storybook/angular': '7.4.0-alpha.2', - '@storybook/api': '7.4.0-alpha.2', - '@storybook/blocks': '7.4.0-alpha.2', - '@storybook/builder-manager': '7.4.0-alpha.2', - '@storybook/builder-vite': '7.4.0-alpha.2', - '@storybook/builder-webpack5': '7.4.0-alpha.2', - '@storybook/channel-postmessage': '7.4.0-alpha.2', - '@storybook/channel-websocket': '7.4.0-alpha.2', - '@storybook/channels': '7.4.0-alpha.2', - '@storybook/cli': '7.4.0-alpha.2', - '@storybook/client-api': '7.4.0-alpha.2', - '@storybook/client-logger': '7.4.0-alpha.2', - '@storybook/codemod': '7.4.0-alpha.2', - '@storybook/components': '7.4.0-alpha.2', - '@storybook/core-client': '7.4.0-alpha.2', - '@storybook/core-common': '7.4.0-alpha.2', - '@storybook/core-events': '7.4.0-alpha.2', - '@storybook/core-server': '7.4.0-alpha.2', - '@storybook/core-webpack': '7.4.0-alpha.2', - '@storybook/csf-plugin': '7.4.0-alpha.2', - '@storybook/csf-tools': '7.4.0-alpha.2', - '@storybook/docs-tools': '7.4.0-alpha.2', - '@storybook/ember': '7.4.0-alpha.2', - '@storybook/html': '7.4.0-alpha.2', - '@storybook/html-vite': '7.4.0-alpha.2', - '@storybook/html-webpack5': '7.4.0-alpha.2', - '@storybook/instrumenter': '7.4.0-alpha.2', - '@storybook/manager': '7.4.0-alpha.2', - '@storybook/manager-api': '7.4.0-alpha.2', - '@storybook/nextjs': '7.4.0-alpha.2', - '@storybook/node-logger': '7.4.0-alpha.2', - '@storybook/postinstall': '7.4.0-alpha.2', - '@storybook/preact': '7.4.0-alpha.2', - '@storybook/preact-vite': '7.4.0-alpha.2', - '@storybook/preact-webpack5': '7.4.0-alpha.2', - '@storybook/preset-create-react-app': '7.4.0-alpha.2', - '@storybook/preset-html-webpack': '7.4.0-alpha.2', - '@storybook/preset-preact-webpack': '7.4.0-alpha.2', - '@storybook/preset-react-webpack': '7.4.0-alpha.2', - '@storybook/preset-server-webpack': '7.4.0-alpha.2', - '@storybook/preset-svelte-webpack': '7.4.0-alpha.2', - '@storybook/preset-vue-webpack': '7.4.0-alpha.2', - '@storybook/preset-vue3-webpack': '7.4.0-alpha.2', - '@storybook/preset-web-components-webpack': '7.4.0-alpha.2', - '@storybook/preview': '7.4.0-alpha.2', - '@storybook/preview-api': '7.4.0-alpha.2', - '@storybook/preview-web': '7.4.0-alpha.2', - '@storybook/react': '7.4.0-alpha.2', - '@storybook/react-dom-shim': '7.4.0-alpha.2', - '@storybook/react-vite': '7.4.0-alpha.2', - '@storybook/react-webpack5': '7.4.0-alpha.2', - '@storybook/router': '7.4.0-alpha.2', - '@storybook/server': '7.4.0-alpha.2', - '@storybook/server-webpack5': '7.4.0-alpha.2', - '@storybook/source-loader': '7.4.0-alpha.2', - '@storybook/store': '7.4.0-alpha.2', - '@storybook/svelte': '7.4.0-alpha.2', - '@storybook/svelte-vite': '7.4.0-alpha.2', - '@storybook/svelte-webpack5': '7.4.0-alpha.2', - '@storybook/sveltekit': '7.4.0-alpha.2', - '@storybook/telemetry': '7.4.0-alpha.2', - '@storybook/theming': '7.4.0-alpha.2', - '@storybook/types': '7.4.0-alpha.2', - '@storybook/vue': '7.4.0-alpha.2', - '@storybook/vue-vite': '7.4.0-alpha.2', - '@storybook/vue-webpack5': '7.4.0-alpha.2', - '@storybook/vue3': '7.4.0-alpha.2', - '@storybook/vue3-vite': '7.4.0-alpha.2', - '@storybook/vue3-webpack5': '7.4.0-alpha.2', - '@storybook/web-components': '7.4.0-alpha.2', - '@storybook/web-components-vite': '7.4.0-alpha.2', - '@storybook/web-components-webpack5': '7.4.0-alpha.2', - sb: '7.4.0-alpha.2', - storybook: '7.4.0-alpha.2', + '@storybook/addon-a11y': '7.4.0', + '@storybook/addon-actions': '7.4.0', + '@storybook/addon-backgrounds': '7.4.0', + '@storybook/addon-controls': '7.4.0', + '@storybook/addon-docs': '7.4.0', + '@storybook/addon-essentials': '7.4.0', + '@storybook/addon-highlight': '7.4.0', + '@storybook/addon-interactions': '7.4.0', + '@storybook/addon-jest': '7.4.0', + '@storybook/addon-links': '7.4.0', + '@storybook/addon-mdx-gfm': '7.4.0', + '@storybook/addon-measure': '7.4.0', + '@storybook/addon-outline': '7.4.0', + '@storybook/addon-themes': '7.4.0', + '@storybook/addon-storyshots': '7.4.0', + '@storybook/addon-storyshots-puppeteer': '7.4.0', + '@storybook/addon-storysource': '7.4.0', + '@storybook/addon-toolbars': '7.4.0', + '@storybook/addon-viewport': '7.4.0', + '@storybook/addons': '7.4.0', + '@storybook/angular': '7.4.0', + '@storybook/api': '7.4.0', + '@storybook/blocks': '7.4.0', + '@storybook/builder-manager': '7.4.0', + '@storybook/builder-vite': '7.4.0', + '@storybook/builder-webpack5': '7.4.0', + '@storybook/channel-postmessage': '7.4.0', + '@storybook/channel-websocket': '7.4.0', + '@storybook/channels': '7.4.0', + '@storybook/cli': '7.4.0', + '@storybook/client-api': '7.4.0', + '@storybook/client-logger': '7.4.0', + '@storybook/codemod': '7.4.0', + '@storybook/components': '7.4.0', + '@storybook/core-client': '7.4.0', + '@storybook/core-common': '7.4.0', + '@storybook/core-events': '7.4.0', + '@storybook/core-server': '7.4.0', + '@storybook/core-webpack': '7.4.0', + '@storybook/csf-plugin': '7.4.0', + '@storybook/csf-tools': '7.4.0', + '@storybook/docs-tools': '7.4.0', + '@storybook/ember': '7.4.0', + '@storybook/html': '7.4.0', + '@storybook/html-vite': '7.4.0', + '@storybook/html-webpack5': '7.4.0', + '@storybook/instrumenter': '7.4.0', + '@storybook/manager': '7.4.0', + '@storybook/manager-api': '7.4.0', + '@storybook/nextjs': '7.4.0', + '@storybook/node-logger': '7.4.0', + '@storybook/postinstall': '7.4.0', + '@storybook/preact': '7.4.0', + '@storybook/preact-vite': '7.4.0', + '@storybook/preact-webpack5': '7.4.0', + '@storybook/preset-create-react-app': '7.4.0', + '@storybook/preset-html-webpack': '7.4.0', + '@storybook/preset-preact-webpack': '7.4.0', + '@storybook/preset-react-webpack': '7.4.0', + '@storybook/preset-server-webpack': '7.4.0', + '@storybook/preset-svelte-webpack': '7.4.0', + '@storybook/preset-vue-webpack': '7.4.0', + '@storybook/preset-vue3-webpack': '7.4.0', + '@storybook/preset-web-components-webpack': '7.4.0', + '@storybook/preview': '7.4.0', + '@storybook/preview-api': '7.4.0', + '@storybook/preview-web': '7.4.0', + '@storybook/react': '7.4.0', + '@storybook/react-dom-shim': '7.4.0', + '@storybook/react-vite': '7.4.0', + '@storybook/react-webpack5': '7.4.0', + '@storybook/router': '7.4.0', + '@storybook/server': '7.4.0', + '@storybook/server-webpack5': '7.4.0', + '@storybook/source-loader': '7.4.0', + '@storybook/store': '7.4.0', + '@storybook/svelte': '7.4.0', + '@storybook/svelte-vite': '7.4.0', + '@storybook/svelte-webpack5': '7.4.0', + '@storybook/sveltekit': '7.4.0', + '@storybook/telemetry': '7.4.0', + '@storybook/theming': '7.4.0', + '@storybook/types': '7.4.0', + '@storybook/vue': '7.4.0', + '@storybook/vue-vite': '7.4.0', + '@storybook/vue-webpack5': '7.4.0', + '@storybook/vue3': '7.4.0', + '@storybook/vue3-vite': '7.4.0', + '@storybook/vue3-webpack5': '7.4.0', + '@storybook/web-components': '7.4.0', + '@storybook/web-components-vite': '7.4.0', + '@storybook/web-components-webpack5': '7.4.0', + sb: '7.4.0', + storybook: '7.4.0', }; diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 979725dae34..fb451424848 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 2606573d269..aa6caa1a169 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 2d0193d3e75..56aad7f9f47 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index c53633ff254..c497f9041ce 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index bbae41b4f41..aa2be123b5d 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 905cb09aa5c..dfc8f3a78e6 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index a38f2350b46..9097da12c31 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index 441a17b1dda..18633851f3d 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 31628435b74..0ce1ad2f560 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index f53e74ff9ff..ed33b6ca6ae 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 7f2566a63dc..7ca039a1b0c 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index 71da909fc64..1ed1073630d 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '7.4.0-alpha.2'; +export const version = '7.4.0'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 52efe3cbde6..5c8dc3fdc7d 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index 073d6aa3e82..8a2938e0c8e 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook addons postinstall utilities", "keywords": [ "api", diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index da9d2d75578..1c018d6c123 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 097bc0e89ae..3750786446c 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 536b11e5e03..25b300b3861 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 781912d0670..9d615e8ad8d 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 9495a137c18..09f8532b630 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index 22fa64bb7b4..8ca60a31c8e 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index dbdb97937c8..32867e2d019 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 2cca8688ce9..b8b9ea5c6c5 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index 13abddf3913..4f9fe2399e4 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -327,6 +327,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "7.4.0" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 1eb7e78f348..7b4bbd5576d 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 21d6dccaa3a..1f35784d524 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 573dec779a7..f368bc6785d 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index d61c44306e2..04a2d399bee 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 7ec7c6bcf88..054090c68f0 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index a2edea524c9..2f3abbaca8d 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index 691b37f0511..7d6d01fee24 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 474ee3a2b5a..434621c3ddc 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index bca248c3766..378c65328ac 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-web-components-webpack", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 7c7b5030d35..7d169e4cada 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 540d1d160ec..5cf82426242 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 50243cff2c6..5ef32e5acb8 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 47157d77b3c..87a8a327d95 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index f75fadbad62..f55fa8c12b0 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index a15d81a5179..c7162ed280e 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Vue renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 692bc1324e9..9673350e4c2 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 6c175803976..448afa36805 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook web-components renderer", "keywords": [ "lit", diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index 2956fd10dbd..436d00f85a2 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/ui/components/package.json b/code/ui/components/package.json index 55e4c8091b8..9b170beb3b7 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index a25ec1c3761..d47573e31a8 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "7.4.0-alpha.2", + "version": "7.4.0", "description": "Core Storybook UI", "keywords": [ "storybook" From f4a1021902b903d2a1c425da3bb089e336b1ab53 Mon Sep 17 00:00:00 2001 From: Martin Nabhan <7613182+martinnabhan@users.noreply.github.com> Date: Tue, 29 Aug 2023 18:13:39 +0900 Subject: [PATCH 040/171] Make sure the Next.js Image Context is reused instead of recreated when imported --- code/frameworks/nextjs/package.json | 8 +++++++- .../src/{images/context.ts => image-context.ts} | 0 code/frameworks/nextjs/src/images/decorator.tsx | 3 ++- .../nextjs/src/images/next-future-image.tsx | 11 ++++------- code/frameworks/nextjs/src/images/next-image.tsx | 9 ++++----- .../nextjs/src/images/next-legacy-image.tsx | 11 ++++------- 6 files changed, 21 insertions(+), 21 deletions(-) rename code/frameworks/nextjs/src/{images/context.ts => image-context.ts} (100%) diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index acdeb717794..00afe2a336e 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -27,6 +27,11 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, + "./image-context": { + "types": "./dist/image-context.d.ts", + "require": "./dist/image-context.js", + "import": "./dist/image-context.mjs" + }, "./preset": { "types": "./dist/preset.d.ts", "require": "./dist/preset.js" @@ -136,11 +141,12 @@ }, "bundler": { "entries": [ + "./src/image-context.ts", "./src/index.ts", "./src/preset.ts", "./src/preview.tsx", "./src/next-image-loader-stub.ts", - "./src/images/context.ts", + "./src/images/decorator.tsx", "./src/images/next-future-image.tsx", "./src/images/next-legacy-image.tsx", "./src/images/next-image.tsx", diff --git a/code/frameworks/nextjs/src/images/context.ts b/code/frameworks/nextjs/src/image-context.ts similarity index 100% rename from code/frameworks/nextjs/src/images/context.ts rename to code/frameworks/nextjs/src/image-context.ts diff --git a/code/frameworks/nextjs/src/images/decorator.tsx b/code/frameworks/nextjs/src/images/decorator.tsx index f0917b3a3b5..0ee445f8707 100644 --- a/code/frameworks/nextjs/src/images/decorator.tsx +++ b/code/frameworks/nextjs/src/images/decorator.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import type { Addon_StoryContext } from '@storybook/types'; -import { ImageContext } from './context'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { ImageContext } from '@storybook/nextjs/dist/image-context'; export const ImageDecorator = ( Story: React.FC, diff --git a/code/frameworks/nextjs/src/images/next-future-image.tsx b/code/frameworks/nextjs/src/images/next-future-image.tsx index 559d2e857d3..0b841452d1f 100644 --- a/code/frameworks/nextjs/src/images/next-future-image.tsx +++ b/code/frameworks/nextjs/src/images/next-future-image.tsx @@ -3,18 +3,15 @@ import type * as _NextImage from 'next/image'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import is aliased in webpack config import OriginalNextFutureImage from 'sb-original/next/future/image'; -import { ImageContext } from './context'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { ImageContext } from '@storybook/nextjs/dist/image-context'; import { defaultLoader } from './next-image-default-loader'; -function NextFutureImage(props: _NextImage.ImageProps) { +function NextFutureImage({ loader, ...props }: _NextImage.ImageProps) { const imageParameters = React.useContext(ImageContext); return ( - + ); } diff --git a/code/frameworks/nextjs/src/images/next-image.tsx b/code/frameworks/nextjs/src/images/next-image.tsx index 74e252d93a7..34cf6d242bc 100644 --- a/code/frameworks/nextjs/src/images/next-image.tsx +++ b/code/frameworks/nextjs/src/images/next-image.tsx @@ -3,15 +3,14 @@ import OriginalNextImage from 'sb-original/next/image'; import type * as _NextImage from 'next/image'; import React from 'react'; -import { ImageContext } from './context'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { ImageContext } from '@storybook/nextjs/dist/image-context'; import { defaultLoader } from './next-image-default-loader'; -const MockedNextImage = (props: _NextImage.ImageProps) => { +const MockedNextImage = ({ loader, ...props }: _NextImage.ImageProps) => { const imageParameters = React.useContext(ImageContext); - return ( - - ); + return ; }; export default MockedNextImage; diff --git a/code/frameworks/nextjs/src/images/next-legacy-image.tsx b/code/frameworks/nextjs/src/images/next-legacy-image.tsx index 8d899cc341a..1e2f8d9df20 100644 --- a/code/frameworks/nextjs/src/images/next-legacy-image.tsx +++ b/code/frameworks/nextjs/src/images/next-legacy-image.tsx @@ -3,18 +3,15 @@ import OriginalNextLegacyImage from 'sb-original/next/legacy/image'; import type * as _NextLegacyImage from 'next/legacy/image'; import React from 'react'; -import { ImageContext } from './context'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { ImageContext } from '@storybook/nextjs/dist/image-context'; import { defaultLoader } from './next-image-default-loader'; -function NextLegacyImage(props: _NextLegacyImage.ImageProps) { +function NextLegacyImage({ loader, ...props }: _NextLegacyImage.ImageProps) { const imageParameters = React.useContext(ImageContext); return ( - + ); } From 2ae443208da90905cbbf098a96cd661358f35f45 Mon Sep 17 00:00:00 2001 From: Almog Haimovitch Date: Tue, 29 Aug 2023 12:33:05 +0300 Subject: [PATCH 041/171] CSS changes is fixing the toc is not scrollable with large content --- code/ui/blocks/src/components/TableOfContents.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/ui/blocks/src/components/TableOfContents.tsx b/code/ui/blocks/src/components/TableOfContents.tsx index 892f1e137f2..87201910433 100644 --- a/code/ui/blocks/src/components/TableOfContents.tsx +++ b/code/ui/blocks/src/components/TableOfContents.tsx @@ -40,9 +40,12 @@ const Wrapper = styled.div(({ theme }) => ({ const Content = styled.div(({ theme }) => ({ position: 'fixed', + bottom: 0, top: 0, width: '10rem', paddingTop: '4rem', + paddingBottom: '2rem', + overflowY: 'auto', fontFamily: theme.typography.fonts.base, fontSize: theme.typography.size.s2, From cf42d9775776e8b23a1df31bd8f3054d992e3116 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 29 Aug 2023 12:49:56 +0200 Subject: [PATCH 042/171] add strict type to name --- code/lib/cli/src/sandbox-templates.ts | 34 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index f4332722424..4a2656d4c6f 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -19,7 +19,7 @@ export type Template = { /** * Readable name for the template, which will be used for feedback and the status page * Follows the naming scheme when it makes sense: - * [- ] (JS|TS) + * <"v"version|"Latest"|"Prerelease"> [- ](JS|TS) * React Latest - Webpack (TS) * Next.js v12 (JS) * Angular CLI Prerelease @@ -76,6 +76,12 @@ export type Template = { isInternal?: boolean; }; +type BaseTemplates = Template & { + name: `${string} ${`v${number}` | 'Latest' | 'Prerelease'} ${`- ${string} ` | ''}(${ + | 'JS' + | 'TS'})`; +}; + const baseTemplates = { 'cra/default-js': { name: 'Create React App Latest (JS)', @@ -132,7 +138,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-vite/default-js': { - name: 'React Vite (JS)', + name: 'React Latest - Vite (JS)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template react', expected: { framework: '@storybook/react-vite', @@ -228,7 +234,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'html-webpack/default': { - name: 'HTML - Webpack', + name: 'HTML Latest - Webpack (JS)', script: 'yarn create webpack5-html {{beforeDir}}', expected: { framework: '@storybook/html-webpack5', @@ -238,7 +244,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'html-vite/default-js': { - name: 'HTML - Vite (JS)', + name: 'HTML Latest - Vite (JS)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vanilla && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -249,7 +255,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'html-vite/default-ts': { - name: 'HTML - Vite (TS)', + name: 'HTML Latest - Vite (TS)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vanilla-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -281,7 +287,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'angular-cli/prerelease': { - name: 'Angular CLI Prerelease', + name: 'Angular CLI Prerelease (TS)', script: 'npx -p @angular/cli@next ng new angular-v16 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -292,7 +298,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'angular-cli/default-ts': { - name: 'Angular CLI Latest', + name: 'Angular CLI Latest (TS)', script: 'npx -p @angular/cli ng new angular-latest --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -303,7 +309,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'angular-cli/15-ts': { - name: 'Angular CLI v15', + name: 'Angular CLI v15 (TS)', script: 'npx -p @angular/cli@15 ng new angular-v15 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -360,7 +366,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'vue-cli/default-js': { - name: 'Vue v3 CLI (JS)', + name: 'Vue v3 - CLI (JS)', script: 'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -372,7 +378,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'vue-cli/vue2-default-js': { - name: 'Vue v2 CLI (JS)', + name: 'Vue v2 - CLI (JS)', script: 'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge --preset="Default (Vue 2)" && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -384,7 +390,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'preact-webpack5/default-js': { - name: 'Preact Latest CLI (JS)', + name: 'Preact Latest - CLI (JS)', script: 'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -395,7 +401,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'preact-webpack5/default-ts': { - name: 'Preact Latest CLI (TS)', + name: 'Preact Latest - CLI (TS)', script: 'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -426,7 +432,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'qwik-vite/default-ts': { - name: 'Qwik Latest CLI (TS)', + name: 'Qwik Latest - CLI (TS)', script: 'yarn create qwik basic {{beforeDir}}', // TODO: The community template does not provide standard stories, which is required for e2e tests. Reenable once it does. inDevelopment: true, @@ -438,7 +444,7 @@ const baseTemplates = { // TODO: The community template does not provide standard stories, which is required for e2e tests. skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench'], }, -} satisfies Record; +} satisfies Record; /** * Internal templates reuse config from other templates and add extra config on top. From f70acaa31675e5931fbb8f4bd1fae0677d87bf02 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Wed, 16 Aug 2023 13:25:36 -0600 Subject: [PATCH 043/171] Document deprecation of storyshots - Add equivalent test-runner instructions --- docs/faq.md | 6 +++ docs/writing-tests/snapshot-testing.md | 51 +++++++++++++++++++++++++- docs/writing-tests/visual-testing.md | 2 +- 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 83756f4152c..02c7e58f3ff 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -374,6 +374,12 @@ Yes, with the release of version 6.2, Storybook now includes support for Vue 3. ## Is snapshot testing with Storyshots supported for Vue 3? +
+ +⛔️ Storyshots has been deprecated in favor of [test runner](./writing-tests/test-runner.md), which you can use for both snapshot and [visual testing](./writing-tests/visual-testing.md). + +
+ Yes, with the release of version 6.2, the [`Storyshots addon`](https://www.npmjs.com/package/@storybook/addon-storyshots) will automatically detect Vue 3 projects. If you run into a situation where this is not the case, you can adjust the `config` object and manually specify the framework (e.g., `vue3`). diff --git a/docs/writing-tests/snapshot-testing.md b/docs/writing-tests/snapshot-testing.md index 29f3489add0..2cbf003c4b0 100644 --- a/docs/writing-tests/snapshot-testing.md +++ b/docs/writing-tests/snapshot-testing.md @@ -8,9 +8,56 @@ Storybook is a helpful tool for snapshot testing because every story is essentia ![Example Snapshot test](./snapshot-test.png) -## Setup Storyshots +## Set up test runner -[Storyshots](https://storybook.js.org/addons/@storybook/addon-storyshots/) is the official Storybook addon that enables snapshot testing, powered by [Jest](https://jestjs.io/docs/getting-started). +Storybook test runner turns all of your stories into executable tests. It is powered by [Jest](https://jestjs.io/) and [Playwright](https://playwright.dev/). + +Follow the [setup instructions](./test-runner#setup) to install and run the test runner. + +Then, you can use the [test hook API](./test-runner#test-hook-api-experimental) to snapshot the HTML of each story: + +```js +// .storybook/test-runner.js + +module.exports = { + async postRender(page, context) { + // the #storybook-root element wraps each story + const elementHandler = await page.$('#storybook-root'); + const innerHTML = await elementHandler.innerHTML(); + expect(innerHTML).toMatchSnapshot(); + }, +}; +``` + +When running in [stories.json mode](./test-runner#storiesjson-mode), tests are generated in a temporary folder and snapshots get stored alongside them. You will need to [`--eject`](./test-runner#configure) and configure a custom [`snapshotResolver`](https://jestjs.io/docs/configuration#snapshotresolver-string) to store them elsewhere, e.g. in your working directory: + +```js +// ./test-runner-jest.config.js + +const path = require('path'); + +module.exports = { + resolveSnapshotPath: (testPath, snapshotExtension) => + path.join(process.cwd(), '__snapshots__', path.basename(testPath) + snapshotExtension), + resolveTestPath: (snapshotFilePath, snapshotExtension) => + path.join(process.env.TEST_ROOT, path.basename(snapshotFilePath, snapshotExtension)), + testPathForConsistencyCheck: path.join(process.env.TEST_ROOT, 'example.test.js'), +}; +``` + +Finally, you can [set up test runner to run your tests in CI](/test-runner#set-up-ci-to-run-tests). + +There are many other configuration options available, such as watch mode and coverage. Please reference the [test runner documentation](./test-runner) for more information. + +## Set up Storyshots + +
+ +⛔️ Storyshots has been deprecated in favor of [test runner](./test-runner.md), which you can use for both snapshot and [visual testing](./visual-testing.md). + +
+ +[Storyshots](https://storybook.js.org/addons/@storybook/addon-storyshots/) is a Storybook addon that enables snapshot testing, powered by [Jest](https://jestjs.io/docs/getting-started). Run the following command to install Storyshots: diff --git a/docs/writing-tests/visual-testing.md b/docs/writing-tests/visual-testing.md index a62cbdd9d59..7e303fcfa4a 100644 --- a/docs/writing-tests/visual-testing.md +++ b/docs/writing-tests/visual-testing.md @@ -15,7 +15,7 @@ Ideal for verifying what the user sees: layout, color, size, and contrast. Story There are [many tools](https://github.com/mojoaxel/awesome-regression-testing) for visual testing. We recommend [Chromatic](https://www.chromatic.com?utm_source=storybook_website&utm_medium=link&utm_campaign=storybook) by Storybook maintainers to run visual tests in a lightning-fast cloud browser environment. -For a self-managed alternative to Chromatic, we offer [StoryShots](https://github.com/storybookjs/storybook/tree/next/code/addons/storyshots-core). It allows you to run visual tests on stories by integrating with [jest-image-snapshot](https://github.com/storybookjs/storybook/tree/main/code/addons/storyshots-puppeteer#imagesnapshots). +For a self-managed alternative to Chromatic, we offer [test runner](./test-runner.md). It allows you to run visual tests on stories by integrating with [Jest](https://jestjs.io/) and [Playwright](https://playwright.dev/). Here's an example [recipe for visual testing stories](https://github.com/storybookjs/test-runner#image-snapshot-recipe). ## Setup Chromatic addon From ad881b92d43664cde50287fa0bbae25a5369766c Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Mon, 21 Aug 2023 11:12:55 -0600 Subject: [PATCH 044/171] Remove no longer needed FAQ question --- docs/faq.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 02c7e58f3ff..9be3455a3be 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -22,7 +22,6 @@ Here are some answers to frequently asked questions. If you have a question, you - [What icons are available for my toolbar or my addon?](#what-icons-are-available-for-my-toolbar-or-my-addon) - [I see a "No Preview" error with a Storybook production build](#i-see-a-no-preview-error-with-a-storybook-production-build) - [Can I use Storybook with Vue 3?](#can-i-use-storybook-with-vue-3) -- [Is snapshot testing with Storyshots supported for Vue 3?](#is-snapshot-testing-with-storyshots-supported-for-vue-3) - [Why aren't my code blocks highlighted with Storybook MDX](#why-arent-my-code-blocks-highlighted-with-storybook-mdx) - [Why aren't my MDX 2 stories working in Storybook?](#why-arent-my-mdx-2-stories-working-in-storybook) - [Why are my mocked GraphQL queries failing with Storybook's MSW addon?](#why-are-my-mocked-graphql-queries-failing-with-storybooks-msw-addon) @@ -372,20 +371,6 @@ Suppose you don't want to run the command above frequently. Add http-serve Yes, with the release of version 6.2, Storybook now includes support for Vue 3. See the [install page](./get-started/install.md) for instructions. -## Is snapshot testing with Storyshots supported for Vue 3? - -
- -⛔️ Storyshots has been deprecated in favor of [test runner](./writing-tests/test-runner.md), which you can use for both snapshot and [visual testing](./writing-tests/visual-testing.md). - -
- -Yes, with the release of version 6.2, the [`Storyshots addon`](https://www.npmjs.com/package/@storybook/addon-storyshots) will automatically detect Vue 3 projects. - -If you run into a situation where this is not the case, you can adjust the `config` object and manually specify the framework (e.g., `vue3`). - -See our documentation on how to customize the [Storyshots configuration](./writing-tests/snapshot-testing.md). - ## Why aren't my code blocks highlighted with Storybook MDX Out of the box, Storybook provides syntax highlighting for a set of languages (e.g., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) you can use with your code blocks. Currently, there's a know limitation when you try and register a custom language to get syntax highlighting. We're working on a fix for this And will update this section once it's available. From 1fe1d34327259da1a7399658ee4901deb07abc4f Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Fri, 25 Aug 2023 09:18:17 -0600 Subject: [PATCH 045/171] Address feedback - Turn code example into snippets - Fix link --- .../common/test-runner-snapshot.js.mdx | 12 ++++++++++ .../common/test-runner-snapshot.ts.mdx | 16 ++++++++++++++ docs/writing-tests/snapshot-testing.md | 22 +++++++++---------- 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 docs/snippets/common/test-runner-snapshot.js.mdx create mode 100644 docs/snippets/common/test-runner-snapshot.ts.mdx diff --git a/docs/snippets/common/test-runner-snapshot.js.mdx b/docs/snippets/common/test-runner-snapshot.js.mdx new file mode 100644 index 00000000000..9786372faf5 --- /dev/null +++ b/docs/snippets/common/test-runner-snapshot.js.mdx @@ -0,0 +1,12 @@ +```js +// .storybook/test-runner.js + +export default { + async postRender(page, context) { + // the #storybook-root element wraps each story + const elementHandler = await page.$('#storybook-root'); + const innerHTML = await elementHandler.innerHTML(); + expect(innerHTML).toMatchSnapshot(); + }, +}; +``` \ No newline at end of file diff --git a/docs/snippets/common/test-runner-snapshot.ts.mdx b/docs/snippets/common/test-runner-snapshot.ts.mdx new file mode 100644 index 00000000000..9df97e63893 --- /dev/null +++ b/docs/snippets/common/test-runner-snapshot.ts.mdx @@ -0,0 +1,16 @@ +```ts +// .storybook/test-runner.ts + +import type { TestRunnerConfig } from '@storybook/test-runner'; + +const config: TestRunnerConfig = { + async postRender(page, context) { + // the #storybook-root element wraps each story + const elementHandler = await page.$('#storybook-root'); + const innerHTML = await elementHandler.innerHTML(); + expect(innerHTML).toMatchSnapshot(); + }, +}; + +export default config; +``` \ No newline at end of file diff --git a/docs/writing-tests/snapshot-testing.md b/docs/writing-tests/snapshot-testing.md index 2cbf003c4b0..6d693b44b5f 100644 --- a/docs/writing-tests/snapshot-testing.md +++ b/docs/writing-tests/snapshot-testing.md @@ -16,18 +16,16 @@ Follow the [setup instructions](./test-runner#setup) to install and run the test Then, you can use the [test hook API](./test-runner#test-hook-api-experimental) to snapshot the HTML of each story: -```js -// .storybook/test-runner.js + -module.exports = { - async postRender(page, context) { - // the #storybook-root element wraps each story - const elementHandler = await page.$('#storybook-root'); - const innerHTML = await elementHandler.innerHTML(); - expect(innerHTML).toMatchSnapshot(); - }, -}; -``` + + + When running in [stories.json mode](./test-runner#storiesjson-mode), tests are generated in a temporary folder and snapshots get stored alongside them. You will need to [`--eject`](./test-runner#configure) and configure a custom [`snapshotResolver`](https://jestjs.io/docs/configuration#snapshotresolver-string) to store them elsewhere, e.g. in your working directory: @@ -45,7 +43,7 @@ module.exports = { }; ``` -Finally, you can [set up test runner to run your tests in CI](/test-runner#set-up-ci-to-run-tests). +Finally, you can [set up test runner to run your tests in CI](./test-runner.md#set-up-ci-to-run-tests). There are many other configuration options available, such as watch mode and coverage. Please reference the [test runner documentation](./test-runner) for more information. From 1f89b847c7229b8622548a6eff050d95167931c4 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Tue, 29 Aug 2023 11:09:20 -0600 Subject: [PATCH 046/171] Update `stories.json` -> `index.json` --- docs/api/main-config-features.md | 4 ++- docs/configure/overview.md | 10 +++---- docs/configure/sidebar-and-urls.md | 2 +- docs/sharing/publish-storybook.md | 2 +- docs/sharing/storybook-composition.md | 16 +++++----- ...est-runner-disable-stories-json.npm.js.mdx | 3 -- ...st-runner-disable-stories-json.pnpm.js.mdx | 3 -- ...st-runner-disable-stories-json.yarn.js.mdx | 3 -- ...k-test-runner-with-stories-json.npm.js.mdx | 3 -- ...-test-runner-with-stories-json.pnpm.js.mdx | 3 -- ...-test-runner-with-stories-json.yarn.js.mdx | 3 -- .../test-runner-no-index-json.npm.js.mdx | 3 ++ .../test-runner-no-index-json.pnpm.js.mdx | 3 ++ .../test-runner-no-index-json.yarn.js.mdx | 3 ++ .../test-runner-with-index-json.npm.js.mdx | 3 ++ .../test-runner-with-index-json.pnpm.js.mdx | 3 ++ .../test-runner-with-index-json.yarn.js.mdx | 3 ++ docs/writing-tests/snapshot-testing.md | 2 +- docs/writing-tests/test-runner.md | 30 +++++++++---------- 19 files changed, 52 insertions(+), 50 deletions(-) delete mode 100644 docs/snippets/common/storybook-test-runner-disable-stories-json.npm.js.mdx delete mode 100644 docs/snippets/common/storybook-test-runner-disable-stories-json.pnpm.js.mdx delete mode 100644 docs/snippets/common/storybook-test-runner-disable-stories-json.yarn.js.mdx delete mode 100644 docs/snippets/common/storybook-test-runner-with-stories-json.npm.js.mdx delete mode 100644 docs/snippets/common/storybook-test-runner-with-stories-json.pnpm.js.mdx delete mode 100644 docs/snippets/common/storybook-test-runner-with-stories-json.yarn.js.mdx create mode 100644 docs/snippets/common/test-runner-no-index-json.npm.js.mdx create mode 100644 docs/snippets/common/test-runner-no-index-json.pnpm.js.mdx create mode 100644 docs/snippets/common/test-runner-no-index-json.yarn.js.mdx create mode 100644 docs/snippets/common/test-runner-with-index-json.npm.js.mdx create mode 100644 docs/snippets/common/test-runner-with-index-json.pnpm.js.mdx create mode 100644 docs/snippets/common/test-runner-with-index-json.yarn.js.mdx diff --git a/docs/api/main-config-features.md b/docs/api/main-config-features.md index b556e832311..81a80502a7b 100644 --- a/docs/api/main-config-features.md +++ b/docs/api/main-config-features.md @@ -22,7 +22,9 @@ Enables Storybook's additional features. Type: `boolean` -Generates a `stories.json` file to help story loading with the on-demand mode. +Default: `true`, when [`storyStoreV7`](#storystorev7) is `true` + +Generates a `index.json` and `stories.json` files to help story loading with the on-demand mode. diff --git a/docs/configure/overview.md b/docs/configure/overview.md index 14faf978e1a..a5e877a03e4 100644 --- a/docs/configure/overview.md +++ b/docs/configure/overview.md @@ -51,11 +51,11 @@ Storybook's main configuration (i.e., the `main.js|ts`) defines your Storybook p Additionally, you can also provide additional feature flags to your Storybook configuration. Below is an abridged list of available features that are currently available. -| Configuration element | Description | -| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `storyStoreV7` | Configures Storybook to load stories [on demand](#on-demand-story-loading), rather than during boot up
`features: { storyStoreV7: true }` | -| `buildStoriesJson` | Generates a `stories.json` file to help story loading with the on-demand mode
`features: { buildStoriesJson: true }` | -| `legacyMdx1` | Enables support for MDX version 1 as a fallback. Requires [`@storybook/mdx1-csf`](https://github.com/storybookjs/mdx1-csf)
`features: { legacyMdx1: true }` | +| Configuration element | Description | +| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `storyStoreV7` | Configures Storybook to load stories [on demand](#on-demand-story-loading), rather than during boot up (defaults to `true` as of `v7.0`)
`features: { storyStoreV7: true }` | +| `buildStoriesJson` | Generates `index.json` and `stories.json` files to help story loading with the on-demand mode (defaults to `true` when `storyStoreV7` is `true`)
`features: { buildStoriesJson: true }` | +| `legacyMdx1` | Enables support for MDX version 1 as a fallback. Requires [`@storybook/mdx1-csf`](https://github.com/storybookjs/mdx1-csf)
`features: { legacyMdx1: true }` | ## Configure story loading diff --git a/docs/configure/sidebar-and-urls.md b/docs/configure/sidebar-and-urls.md index 094add432b1..0d3bc106cb9 100644 --- a/docs/configure/sidebar-and-urls.md +++ b/docs/configure/sidebar-and-urls.md @@ -149,7 +149,7 @@ When Storybook generates the titles for all matching stories, they'll retain the ### Story Indexers -Story Indexers are a set of heuristics used by Storybook to crawl your filesystem based on a given glob pattern searching for matching stories, which is then used to generate an index.json (formerly stories.json) file responsible for populating the sidebar with the necessary information. By default, this heuristic will look for files that contain the following scheme \*.stories.@(js|jsx|mjs|ts|tsx). However, if you need, you can create your custom story indexer that you can use to include stories that have a different naming convention. For example: +Story Indexers are a set of heuristics used by Storybook to crawl your filesystem based on a given glob pattern searching for matching stories, which is then used to generate an `index.json` (formerly `stories.json`) file responsible for populating the sidebar with the necessary information. By default, this heuristic will look for files that contain the following scheme \*.stories.@(js|jsx|mjs|ts|tsx). However, if you need, you can create your custom story indexer that you can use to include stories that have a different naming convention. For example: diff --git a/docs/sharing/publish-storybook.md b/docs/sharing/publish-storybook.md index 0c89b697865..1748a54049b 100644 --- a/docs/sharing/publish-storybook.md +++ b/docs/sharing/publish-storybook.md @@ -151,7 +151,7 @@ Storybook can communicate with services that host built Storybooks online. This This level of service serves published Storybooks and makes the following available: - Versioned endpoints, URLs that resolve to different published Storybooks depending on a `version=x.y.z` query parameter (where `x.y.z` is the released version of the package). -- Support for `/stories.json` +- Support for `/index.json` (formerly `/stories.json`) endpoint, which returns a list of stories and their metadata. - Support for `/metadata.json` and the `releases` field. Example: [Chromatic](https://www.chromatic.com/?utm_source=storybook_website&utm_medium=link&utm_campaign=storybook) diff --git a/docs/sharing/storybook-composition.md b/docs/sharing/storybook-composition.md index b9dde4a0e09..04aa8440c53 100644 --- a/docs/sharing/storybook-composition.md +++ b/docs/sharing/storybook-composition.md @@ -78,7 +78,7 @@ So far, we've seen how we can use composition with local or published Storybooks ### With feature flags -If you're using Storybook 6.4, or higher, you can optimize your composition via the `buildStoriesJson` feature flag, allowing you to generate a `stories.json` file with the required information, providing you with a seamless integration without the need for additional dependencies. For example: +If you're using Storybook 6.4, or higher, you can optimize your composition via the `buildStoriesJson` feature flag, allowing you to generate `index.json` and `stories.json` files with the required information, providing you with a seamless integration without the need for additional dependencies. For example: @@ -93,11 +93,11 @@ If you're using Storybook 6.4, or higher, you can optimize your composition via
-💡 If you already enabled automatic code splitting via the [`storyStoreV7`](https://storybook.js.org/docs/react/builders/webpack#code-splitting), you won't need this flag as it will automatically generate the `stories.json` file. +💡 If you already enabled automatic code splitting via the [`storyStoreV7`](https://storybook.js.org/docs/react/builders/webpack#code-splitting), you won't need this flag as it will automatically generate the `index.json` file.
-When you compose a Storybook featuring this flag, it will use the information retrieved from the file to populate the UI with your composed Storybook stories automatically. Here's an example of the output generated by the `stories.json` file: +When you compose a Storybook featuring this flag, it will use the information retrieved from the file to populate the UI with your composed Storybook stories automatically. Here's an example of the output generated by the `index.json` file: @@ -111,7 +111,7 @@ When you compose a Storybook featuring this flag, it will use the information re ### With the CLI -If you're working with an outdated Storybook version or have a project-specific requirement that prevents you from enabling the `buildStoriesJson` feature flag. In that case, you can use Storybook's CLI to automatically generate the `stories.json` file when you deploy your Storybook. For example: +If you're working with an outdated Storybook version or have a project-specific requirement that prevents you from enabling the `buildStoriesJson` feature flag. In that case, you can use Storybook's CLI to automatically generate the `index.json` file when you deploy your Storybook. For example: ```shell npx storybook extract @@ -123,7 +123,7 @@ npx storybook extract -Although a good approach to improve composition, it comes with a cost, as it will require an additional dependency being added and increased build times. Once it finishes executing, it will generate a `stories.json` file in the default build directory (`storybook-static`) with the information related to your Storybook. Here’s an example of the file contents: +Although a good approach to improve composition, it comes with a cost, as it will require an additional dependency being added and increased build times. Once it finishes executing, it will generate an `index.json` file in the default build directory (`storybook-static`) with the information related to your Storybook. Here’s an example of the file contents: @@ -137,13 +137,13 @@ Although a good approach to improve composition, it comes with a cost, as it wil Linking to a Storybook deployed using this approach will yield all the stories and other relevant information displayed in the UI. -If you need, you can also add additional arguments to this command. For instance, if you want to generate the stories.json file into a custom directory, you can use the following: +If you need, you can also add additional arguments to this command. For instance, if you want to generate the `index.json` file into a custom directory, you can use the following: ```shell -npx storybook extract my-built-storybook-directory my-other-directory/stories.json +npx storybook extract my-built-storybook-directory my-other-directory/index.json ``` -When executed, it will look up a built Storybook in the `my-built-storybook-directory` and create the `stories.json` file in the `my-other-directory` with all the necessary information. +When executed, it will look up a built Storybook in the `my-built-storybook-directory` and create the `index.json` file in the `my-other-directory` with all the necessary information.
diff --git a/docs/snippets/common/storybook-test-runner-disable-stories-json.npm.js.mdx b/docs/snippets/common/storybook-test-runner-disable-stories-json.npm.js.mdx deleted file mode 100644 index 33555a01dc6..00000000000 --- a/docs/snippets/common/storybook-test-runner-disable-stories-json.npm.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -npm run test-storybook -- --no-stories-json -``` diff --git a/docs/snippets/common/storybook-test-runner-disable-stories-json.pnpm.js.mdx b/docs/snippets/common/storybook-test-runner-disable-stories-json.pnpm.js.mdx deleted file mode 100644 index ca79b95665f..00000000000 --- a/docs/snippets/common/storybook-test-runner-disable-stories-json.pnpm.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -pnpm run test-storybook --no-stories-json -``` diff --git a/docs/snippets/common/storybook-test-runner-disable-stories-json.yarn.js.mdx b/docs/snippets/common/storybook-test-runner-disable-stories-json.yarn.js.mdx deleted file mode 100644 index 3a8b80a3988..00000000000 --- a/docs/snippets/common/storybook-test-runner-disable-stories-json.yarn.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -yarn test-storybook --no-stories-json -``` diff --git a/docs/snippets/common/storybook-test-runner-with-stories-json.npm.js.mdx b/docs/snippets/common/storybook-test-runner-with-stories-json.npm.js.mdx deleted file mode 100644 index b0a1f2f3909..00000000000 --- a/docs/snippets/common/storybook-test-runner-with-stories-json.npm.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -npm run test-storybook -- --stories-json -``` diff --git a/docs/snippets/common/storybook-test-runner-with-stories-json.pnpm.js.mdx b/docs/snippets/common/storybook-test-runner-with-stories-json.pnpm.js.mdx deleted file mode 100644 index 7d1e764ea21..00000000000 --- a/docs/snippets/common/storybook-test-runner-with-stories-json.pnpm.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -pnpm run test-storybook --stories-json -``` diff --git a/docs/snippets/common/storybook-test-runner-with-stories-json.yarn.js.mdx b/docs/snippets/common/storybook-test-runner-with-stories-json.yarn.js.mdx deleted file mode 100644 index eeebd6fb444..00000000000 --- a/docs/snippets/common/storybook-test-runner-with-stories-json.yarn.js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```shell -yarn test-storybook --stories-json -``` diff --git a/docs/snippets/common/test-runner-no-index-json.npm.js.mdx b/docs/snippets/common/test-runner-no-index-json.npm.js.mdx new file mode 100644 index 00000000000..eec0635b27e --- /dev/null +++ b/docs/snippets/common/test-runner-no-index-json.npm.js.mdx @@ -0,0 +1,3 @@ +```shell +npm run test-storybook -- --no-index-json +``` diff --git a/docs/snippets/common/test-runner-no-index-json.pnpm.js.mdx b/docs/snippets/common/test-runner-no-index-json.pnpm.js.mdx new file mode 100644 index 00000000000..326202bcc21 --- /dev/null +++ b/docs/snippets/common/test-runner-no-index-json.pnpm.js.mdx @@ -0,0 +1,3 @@ +```shell +pnpm run test-storybook --no-index-json +``` diff --git a/docs/snippets/common/test-runner-no-index-json.yarn.js.mdx b/docs/snippets/common/test-runner-no-index-json.yarn.js.mdx new file mode 100644 index 00000000000..f53c2b82672 --- /dev/null +++ b/docs/snippets/common/test-runner-no-index-json.yarn.js.mdx @@ -0,0 +1,3 @@ +```shell +yarn test-storybook --no-index-json +``` diff --git a/docs/snippets/common/test-runner-with-index-json.npm.js.mdx b/docs/snippets/common/test-runner-with-index-json.npm.js.mdx new file mode 100644 index 00000000000..e0cc8c5cfd7 --- /dev/null +++ b/docs/snippets/common/test-runner-with-index-json.npm.js.mdx @@ -0,0 +1,3 @@ +```shell +npm run test-storybook -- --index-json +``` diff --git a/docs/snippets/common/test-runner-with-index-json.pnpm.js.mdx b/docs/snippets/common/test-runner-with-index-json.pnpm.js.mdx new file mode 100644 index 00000000000..d008d5bc5e0 --- /dev/null +++ b/docs/snippets/common/test-runner-with-index-json.pnpm.js.mdx @@ -0,0 +1,3 @@ +```shell +pnpm run test-storybook --index-json +``` diff --git a/docs/snippets/common/test-runner-with-index-json.yarn.js.mdx b/docs/snippets/common/test-runner-with-index-json.yarn.js.mdx new file mode 100644 index 00000000000..b852aa053dc --- /dev/null +++ b/docs/snippets/common/test-runner-with-index-json.yarn.js.mdx @@ -0,0 +1,3 @@ +```shell +yarn test-storybook --index-json +``` diff --git a/docs/writing-tests/snapshot-testing.md b/docs/writing-tests/snapshot-testing.md index 6d693b44b5f..69b0c17c680 100644 --- a/docs/writing-tests/snapshot-testing.md +++ b/docs/writing-tests/snapshot-testing.md @@ -27,7 +27,7 @@ Then, you can use the [test hook API](./test-runner#test-hook-api-experimental) -When running in [stories.json mode](./test-runner#storiesjson-mode), tests are generated in a temporary folder and snapshots get stored alongside them. You will need to [`--eject`](./test-runner#configure) and configure a custom [`snapshotResolver`](https://jestjs.io/docs/configuration#snapshotresolver-string) to store them elsewhere, e.g. in your working directory: +When running in [index.json mode](./test-runner#indexjson-mode), tests are generated in a temporary folder and snapshots get stored alongside them. You will need to [`--eject`](./test-runner#configure) and configure a custom [`snapshotResolver`](https://jestjs.io/docs/configuration#snapshotresolver-string) to store them elsewhere, e.g. in your working directory: ```js // ./test-runner-jest.config.js diff --git a/docs/writing-tests/test-runner.md b/docs/writing-tests/test-runner.md index 4ef6b07315a..27716c0deda 100644 --- a/docs/writing-tests/test-runner.md +++ b/docs/writing-tests/test-runner.md @@ -82,8 +82,8 @@ If you're already using any of those flags in your project, you should be able t | Options | Description | | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--help` | Output usage information
`test-storybook --help` | -| `-s`, `--stories-json` | Run in stories json mode. Automatically detected (requires a compatible Storybook)
`test-storybook --stories-json` | -| `--no-stories-json` | Disables stories json mode
`test-storybook --no-stories-json` | +| `-s`, `--index-json` | Run in index json mode. Automatically detected (requires a compatible Storybook)
`test-storybook --index-json` | +| `--no-index-json` | Disables index json mode
`test-storybook --no-index-json` | | `-c`, `--config-dir [dir-name]` | Directory where to load Storybook configurations from
`test-storybook -c .storybook` | | `--watch` | Run in watch mode
`test-storybook --watch` | | `--watchAll` | Watch files for changes and rerun all tests when something changes.
`test-storybook --watchAll` | @@ -254,21 +254,21 @@ The test-runner exports a few helpers that can be used to make your tests more r -### Stories.json mode +### Index.json mode -The test-runner transforms your story files into tests when testing a local Storybook. For a remote Storybook, it uses the Storybook's [stories.json](../configure/overview.md#feature-flags) file (a static index of all the stories) to run the tests. +The test-runner transforms your story files into tests when testing a local Storybook. For a remote Storybook, it uses the Storybook's [index.json](../configure/overview.md#feature-flags) (formerly `stories.json`) file (a static index of all the stories) to run the tests. #### Why? -Suppose you run into a situation where the local and remote Storybooks appear out of sync, or you might not even have access to the code. In that case, the `stories.json` file is guaranteed to be the most accurate representation of the deployed Storybook you are testing. To test a local Storybook using this feature, use the `--stories-json` flag as follows: +Suppose you run into a situation where the local and remote Storybooks appear out of sync, or you might not even have access to the code. In that case, the `index.json` file is guaranteed to be the most accurate representation of the deployed Storybook you are testing. To test a local Storybook using this feature, use the `--index-json` flag as follows: @@ -276,27 +276,27 @@ Suppose you run into a situation where the local and remote Storybooks appear ou
-💡 The `stories.json` mode is not compatible with watch mode. +💡 The `index.json` mode is not compatible with watch mode.
-If you need to disable it, use the `--no-stories-json` flag: +If you need to disable it, use the `--no-index-json` flag: -#### How do I check if my Storybook has a `stories.json` file? +#### How do I check if my Storybook has a `index.json` file? -Stories.json mode requires a `stories.json` file. Open a browser window and navigate to your deployed Storybook instance (for example, `https://your-storybook-url-here.com/stories.json`). You should see a JSON file that starts with a `"v": 3` key, immediately followed by another key called "stories", which contains a map of story IDs to JSON objects. If that is the case, your Storybook supports [stories.json mode](../configure/overview.md#feature-flags). +Index.json mode requires a `index.json` file. Open a browser window and navigate to your deployed Storybook instance (for example, `https://your-storybook-url-here.com/index.json`). You should see a JSON file that starts with a `"v": 3` key, immediately followed by another key called "stories", which contains a map of story IDs to JSON objects. If that is the case, your Storybook supports [index.json mode](../configure/overview.md#feature-flags). --- From aa5510a1b39b3c3001dc1fdc1cba1f94b9dd2df1 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Tue, 29 Aug 2023 11:49:23 -0600 Subject: [PATCH 047/171] Rename snippets - Remove superfluous `storybook-` prefix - Formatting --- ....js.mdx => test-runner-a11y-config.js.mdx} | 0 ....ts.mdx => test-runner-a11y-config.ts.mdx} | 0 ....mdx => test-runner-a11y-configure.js.mdx} | 0 ....mdx => test-runner-a11y-configure.ts.mdx} | 0 ...js.mdx => test-runner-a11y-disable.js.mdx} | 0 ...ts.mdx => test-runner-a11y-disable.ts.mdx} | 0 ... => test-runner-axe-playwright.npm.js.mdx} | 0 ...=> test-runner-axe-playwright.pnpm.js.mdx} | 0 ...=> test-runner-axe-playwright.yarn.js.mdx} | 0 ...js.mdx => test-runner-coverage.npm.js.mdx} | 0 ...s.mdx => test-runner-coverage.pnpm.js.mdx} | 0 ...s.mdx => test-runner-coverage.yarn.js.mdx} | 0 ...test-runner-execute-with-flags.npm.js.mdx} | 0 ...est-runner-execute-with-flags.pnpm.js.mdx} | 0 ...est-runner-execute-with-flags.yarn.js.mdx} | 0 ...st-runner-execute-with-url.env-var.js.mdx} | 0 ...> test-runner-execute-with-url.npm.js.mdx} | 0 ... test-runner-execute-with-url.pnpm.js.mdx} | 0 ... test-runner-execute-with-url.yarn.js.mdx} | 0 ....js.mdx => test-runner-execute.npm.js.mdx} | 0 ...js.mdx => test-runner-execute.pnpm.js.mdx} | 0 ...js.mdx => test-runner-execute.yarn.js.mdx} | 0 ...mdx => test-runner-helper-function.js.mdx} | 0 ...mdx => test-runner-helper-function.ts.mdx} | 0 ...s.mdx => test-runner-hooks-example.js.mdx} | 0 ...s.mdx => test-runner-hooks-example.ts.mdx} | 0 ....js.mdx => test-runner-install.npm.js.mdx} | 0 ...js.mdx => test-runner-install.pnpm.js.mdx} | 0 ...js.mdx => test-runner-install.yarn.js.mdx} | 0 ... test-runner-local-build-workflow.yml.mdx} | 0 .../common/test-runner-snapshot.js.mdx | 2 +- .../common/test-runner-snapshot.ts.mdx | 2 +- ...runner-with-deploy-event-workflow.yml.mdx} | 0 docs/writing-tests/accessibility-testing.md | 18 ++++----- docs/writing-tests/interaction-testing.md | 6 +-- docs/writing-tests/test-coverage.md | 6 +-- docs/writing-tests/test-runner.md | 39 +++++++++---------- 37 files changed, 36 insertions(+), 37 deletions(-) rename docs/snippets/common/{storybook-test-runner-a11y-config.js.mdx => test-runner-a11y-config.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-a11y-config.ts.mdx => test-runner-a11y-config.ts.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-a11y-configure.js.mdx => test-runner-a11y-configure.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-a11y-configure.ts.mdx => test-runner-a11y-configure.ts.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-a11y-disable.js.mdx => test-runner-a11y-disable.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-a11y-disable.ts.mdx => test-runner-a11y-disable.ts.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-axe-playwright.npm.js.mdx => test-runner-axe-playwright.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-axe-playwright.pnpm.js.mdx => test-runner-axe-playwright.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-axe-playwright.yarn.js.mdx => test-runner-axe-playwright.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-coverage.npm.js.mdx => test-runner-coverage.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-coverage.pnpm.js.mdx => test-runner-coverage.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-coverage.yarn.js.mdx => test-runner-coverage.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-flags.npm.js.mdx => test-runner-execute-with-flags.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-flags.pnpm.js.mdx => test-runner-execute-with-flags.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-flags.yarn.js.mdx => test-runner-execute-with-flags.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-url.env-var.js.mdx => test-runner-execute-with-url.env-var.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-url.npm.js.mdx => test-runner-execute-with-url.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-url.pnpm.js.mdx => test-runner-execute-with-url.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute-with-url.yarn.js.mdx => test-runner-execute-with-url.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute.npm.js.mdx => test-runner-execute.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute.pnpm.js.mdx => test-runner-execute.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-execute.yarn.js.mdx => test-runner-execute.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-helper-function.js.mdx => test-runner-helper-function.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-helper-function.ts.mdx => test-runner-helper-function.ts.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-hooks-example.js.mdx => test-runner-hooks-example.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-hooks-example.ts.mdx => test-runner-hooks-example.ts.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-install.npm.js.mdx => test-runner-install.npm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-install.pnpm.js.mdx => test-runner-install.pnpm.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-install.yarn.js.mdx => test-runner-install.yarn.js.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-local-build-workflow.yml.mdx => test-runner-local-build-workflow.yml.mdx} (100%) rename docs/snippets/common/{storybook-test-runner-with-deploy-event-workflow.yml.mdx => test-runner-with-deploy-event-workflow.yml.mdx} (100%) diff --git a/docs/snippets/common/storybook-test-runner-a11y-config.js.mdx b/docs/snippets/common/test-runner-a11y-config.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-config.js.mdx rename to docs/snippets/common/test-runner-a11y-config.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-a11y-config.ts.mdx b/docs/snippets/common/test-runner-a11y-config.ts.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-config.ts.mdx rename to docs/snippets/common/test-runner-a11y-config.ts.mdx diff --git a/docs/snippets/common/storybook-test-runner-a11y-configure.js.mdx b/docs/snippets/common/test-runner-a11y-configure.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-configure.js.mdx rename to docs/snippets/common/test-runner-a11y-configure.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-a11y-configure.ts.mdx b/docs/snippets/common/test-runner-a11y-configure.ts.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-configure.ts.mdx rename to docs/snippets/common/test-runner-a11y-configure.ts.mdx diff --git a/docs/snippets/common/storybook-test-runner-a11y-disable.js.mdx b/docs/snippets/common/test-runner-a11y-disable.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-disable.js.mdx rename to docs/snippets/common/test-runner-a11y-disable.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-a11y-disable.ts.mdx b/docs/snippets/common/test-runner-a11y-disable.ts.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-a11y-disable.ts.mdx rename to docs/snippets/common/test-runner-a11y-disable.ts.mdx diff --git a/docs/snippets/common/storybook-test-runner-axe-playwright.npm.js.mdx b/docs/snippets/common/test-runner-axe-playwright.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-axe-playwright.npm.js.mdx rename to docs/snippets/common/test-runner-axe-playwright.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-axe-playwright.pnpm.js.mdx b/docs/snippets/common/test-runner-axe-playwright.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-axe-playwright.pnpm.js.mdx rename to docs/snippets/common/test-runner-axe-playwright.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-axe-playwright.yarn.js.mdx b/docs/snippets/common/test-runner-axe-playwright.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-axe-playwright.yarn.js.mdx rename to docs/snippets/common/test-runner-axe-playwright.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-coverage.npm.js.mdx b/docs/snippets/common/test-runner-coverage.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-coverage.npm.js.mdx rename to docs/snippets/common/test-runner-coverage.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-coverage.pnpm.js.mdx b/docs/snippets/common/test-runner-coverage.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-coverage.pnpm.js.mdx rename to docs/snippets/common/test-runner-coverage.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-coverage.yarn.js.mdx b/docs/snippets/common/test-runner-coverage.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-coverage.yarn.js.mdx rename to docs/snippets/common/test-runner-coverage.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-flags.npm.js.mdx b/docs/snippets/common/test-runner-execute-with-flags.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-flags.npm.js.mdx rename to docs/snippets/common/test-runner-execute-with-flags.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-flags.pnpm.js.mdx b/docs/snippets/common/test-runner-execute-with-flags.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-flags.pnpm.js.mdx rename to docs/snippets/common/test-runner-execute-with-flags.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-flags.yarn.js.mdx b/docs/snippets/common/test-runner-execute-with-flags.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-flags.yarn.js.mdx rename to docs/snippets/common/test-runner-execute-with-flags.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-url.env-var.js.mdx b/docs/snippets/common/test-runner-execute-with-url.env-var.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-url.env-var.js.mdx rename to docs/snippets/common/test-runner-execute-with-url.env-var.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-url.npm.js.mdx b/docs/snippets/common/test-runner-execute-with-url.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-url.npm.js.mdx rename to docs/snippets/common/test-runner-execute-with-url.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-url.pnpm.js.mdx b/docs/snippets/common/test-runner-execute-with-url.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-url.pnpm.js.mdx rename to docs/snippets/common/test-runner-execute-with-url.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute-with-url.yarn.js.mdx b/docs/snippets/common/test-runner-execute-with-url.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute-with-url.yarn.js.mdx rename to docs/snippets/common/test-runner-execute-with-url.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute.npm.js.mdx b/docs/snippets/common/test-runner-execute.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute.npm.js.mdx rename to docs/snippets/common/test-runner-execute.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute.pnpm.js.mdx b/docs/snippets/common/test-runner-execute.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute.pnpm.js.mdx rename to docs/snippets/common/test-runner-execute.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-execute.yarn.js.mdx b/docs/snippets/common/test-runner-execute.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-execute.yarn.js.mdx rename to docs/snippets/common/test-runner-execute.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-helper-function.js.mdx b/docs/snippets/common/test-runner-helper-function.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-helper-function.js.mdx rename to docs/snippets/common/test-runner-helper-function.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-helper-function.ts.mdx b/docs/snippets/common/test-runner-helper-function.ts.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-helper-function.ts.mdx rename to docs/snippets/common/test-runner-helper-function.ts.mdx diff --git a/docs/snippets/common/storybook-test-runner-hooks-example.js.mdx b/docs/snippets/common/test-runner-hooks-example.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-hooks-example.js.mdx rename to docs/snippets/common/test-runner-hooks-example.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-hooks-example.ts.mdx b/docs/snippets/common/test-runner-hooks-example.ts.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-hooks-example.ts.mdx rename to docs/snippets/common/test-runner-hooks-example.ts.mdx diff --git a/docs/snippets/common/storybook-test-runner-install.npm.js.mdx b/docs/snippets/common/test-runner-install.npm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-install.npm.js.mdx rename to docs/snippets/common/test-runner-install.npm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-install.pnpm.js.mdx b/docs/snippets/common/test-runner-install.pnpm.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-install.pnpm.js.mdx rename to docs/snippets/common/test-runner-install.pnpm.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-install.yarn.js.mdx b/docs/snippets/common/test-runner-install.yarn.js.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-install.yarn.js.mdx rename to docs/snippets/common/test-runner-install.yarn.js.mdx diff --git a/docs/snippets/common/storybook-test-runner-local-build-workflow.yml.mdx b/docs/snippets/common/test-runner-local-build-workflow.yml.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-local-build-workflow.yml.mdx rename to docs/snippets/common/test-runner-local-build-workflow.yml.mdx diff --git a/docs/snippets/common/test-runner-snapshot.js.mdx b/docs/snippets/common/test-runner-snapshot.js.mdx index 9786372faf5..d62224bc098 100644 --- a/docs/snippets/common/test-runner-snapshot.js.mdx +++ b/docs/snippets/common/test-runner-snapshot.js.mdx @@ -9,4 +9,4 @@ export default { expect(innerHTML).toMatchSnapshot(); }, }; -``` \ No newline at end of file +``` diff --git a/docs/snippets/common/test-runner-snapshot.ts.mdx b/docs/snippets/common/test-runner-snapshot.ts.mdx index 9df97e63893..1874d5d9fe2 100644 --- a/docs/snippets/common/test-runner-snapshot.ts.mdx +++ b/docs/snippets/common/test-runner-snapshot.ts.mdx @@ -13,4 +13,4 @@ const config: TestRunnerConfig = { }; export default config; -``` \ No newline at end of file +``` diff --git a/docs/snippets/common/storybook-test-runner-with-deploy-event-workflow.yml.mdx b/docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx similarity index 100% rename from docs/snippets/common/storybook-test-runner-with-deploy-event-workflow.yml.mdx rename to docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx diff --git a/docs/writing-tests/accessibility-testing.md b/docs/writing-tests/accessibility-testing.md index 0efa6436d3c..d6dbba00d27 100644 --- a/docs/writing-tests/accessibility-testing.md +++ b/docs/writing-tests/accessibility-testing.md @@ -182,9 +182,9 @@ Run the following command to install the required dependencies. @@ -196,8 +196,8 @@ Add a new [configuration file](./test-runner.md#test-hook-api-experimental) insi @@ -223,8 +223,8 @@ The test runner provides [helper methods](./test-runner.md#helpers), allowing ac @@ -238,8 +238,8 @@ Additionally, if you have already [disabled accessibility](#how-to-disable-a11y- diff --git a/docs/writing-tests/interaction-testing.md b/docs/writing-tests/interaction-testing.md index 01df1b1283e..8f0fdd9cbab 100644 --- a/docs/writing-tests/interaction-testing.md +++ b/docs/writing-tests/interaction-testing.md @@ -160,9 +160,9 @@ Storybook only runs the interaction test when you're viewing a story. Therefore, diff --git a/docs/writing-tests/test-coverage.md b/docs/writing-tests/test-coverage.md index a3025ced5a8..b0df76cbf73 100644 --- a/docs/writing-tests/test-coverage.md +++ b/docs/writing-tests/test-coverage.md @@ -70,9 +70,9 @@ Finally, open a new terminal window and run the test-runner with: diff --git a/docs/writing-tests/test-runner.md b/docs/writing-tests/test-runner.md index 27716c0deda..32376be5806 100644 --- a/docs/writing-tests/test-runner.md +++ b/docs/writing-tests/test-runner.md @@ -19,9 +19,9 @@ Run the following command to install it. @@ -62,9 +62,9 @@ Finally, open a new terminal window and run the test-runner with: @@ -104,14 +104,13 @@ If you're already using any of those flags in your project, you should be able t | `--shard [index/count]` | Requires CI. Splits the test suite execution into multiple machines
`test-storybook --shard=1/8` | | `--failOnConsole` | Makes tests fail on browser console errors
`test-storybook --failOnConsole` | - @@ -125,10 +124,10 @@ By default, the test-runner assumes that you're running it against a locally ser @@ -146,7 +145,7 @@ If you're publishing your Storybook with services such as [Vercel](https://verce @@ -166,7 +165,7 @@ You can use your CI provider (for example, [GitHub Actions](https://github.com/f @@ -217,8 +216,8 @@ To enable the hooks API, you'll need to add a new configuration file inside your @@ -247,8 +246,8 @@ The test-runner exports a few helpers that can be used to make your tests more r From 9656e436cef98d767eb91e870a22b4a8ecd768c6 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Tue, 29 Aug 2023 16:06:17 -0400 Subject: [PATCH 048/171] Scripts: Fix the changelog writer to escape doublequotes --- .../release/__tests__/write-changelog.test.ts | 39 +++++++++++++++++++ scripts/release/write-changelog.ts | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/scripts/release/__tests__/write-changelog.test.ts b/scripts/release/__tests__/write-changelog.test.ts index 383d3169dec..7431222f975 100644 --- a/scripts/release/__tests__/write-changelog.test.ts +++ b/scripts/release/__tests__/write-changelog.test.ts @@ -82,6 +82,45 @@ describe('Write changelog', () => { `); }); + it('should escape double quotes for json files', async () => { + getChangesMock.mockResolvedValue({ + changes: [], + changelogText: `## 7.0.1 + +- React: Make it reactive +- Revert "CLI: Not UI" +- CLI: Not UI`, + }); + + await writeChangelog(['7.0.1'], {}); + + expect(fsExtra.writeFile).toHaveBeenCalledTimes(1); + expect(fsExtra.writeFile.mock.calls[0][0]).toBe(STABLE_CHANGELOG_PATH); + expect(fsExtra.writeFile.mock.calls[0][1]).toMatchInlineSnapshot(` + "## 7.0.1 + + - React: Make it reactive + - Revert "CLI: Not UI" + - CLI: Not UI + + ## 7.0.0 + + - Core: Some change" + `); + expect(fsExtra.writeJson).toBeCalledTimes(1); + expect(fsExtra.writeJson.mock.calls[0][0]).toBe(LATEST_VERSION_PATH); + expect(fsExtra.writeJson.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "info": { + "plain": "- React: Make it reactive + - Revert \\"CLI: Not UI\\" + - CLI: Not UI", + }, + "version": "7.0.1", + } + `); + }); + it('should write to prerelase changelogs and version files in docs', async () => { getChangesMock.mockResolvedValue({ changes: [], diff --git a/scripts/release/write-changelog.ts b/scripts/release/write-changelog.ts index e97a7acc70d..41bc9b72bd3 100644 --- a/scripts/release/write-changelog.ts +++ b/scripts/release/write-changelog.ts @@ -94,7 +94,7 @@ const writeToDocsVersionFile = async ({ console.log(`📝 Writing changelog to ${chalk.blue(path)}`); } - const textWithoutHeading = changelogText.split('\n').slice(2).join('\n'); + const textWithoutHeading = changelogText.split('\n').slice(2).join('\n').replaceAll('"', '\\"'); const content = { version, From 711776c870f914171eaa8781b5c86dc0a9dc76b5 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Tue, 29 Aug 2023 16:14:12 -0400 Subject: [PATCH 049/171] Fix broken JSON --- docs/versions/latest.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/versions/latest.json b/docs/versions/latest.json index 18bc602521b..4325d5d96ac 100644 --- a/docs/versions/latest.json +++ b/docs/versions/latest.json @@ -1 +1,6 @@ -{"version":"7.4.0","info":{"plain":"- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)!\n- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Revert "WebpackBuilder: Remove need for `react` as peerDependency" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)!\n- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)!\n- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)!\n- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)!"}} +{ + "version": "7.4.0", + "info": { + "plain": "- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)!\n- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Revert \"WebpackBuilder: Remove need for `react` as peerDependency\" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)!\n- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)!\n- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)!\n- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)!" + } +} From e8d1b046f5ee86360a1b91538b22b677c66c8d27 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 30 Aug 2023 12:42:54 +0800 Subject: [PATCH 050/171] Telemetry: Filter addon options to protect sensitive info --- .../telemetry/src/storybook-metadata.test.ts | 27 +++++++++++++++++++ code/lib/telemetry/src/storybook-metadata.ts | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/code/lib/telemetry/src/storybook-metadata.test.ts b/code/lib/telemetry/src/storybook-metadata.test.ts index ab64dc26e9a..83a206a9276 100644 --- a/code/lib/telemetry/src/storybook-metadata.test.ts +++ b/code/lib/telemetry/src/storybook-metadata.test.ts @@ -349,6 +349,33 @@ describe('storybook-metadata', () => { expect(res.refCount).toEqual(2); }); + test('only reports addon options for addon-essentials', async () => { + const res = await computeStorybookMetadata({ + packageJson: packageJsonMock, + mainConfig: { + ...mainJsMock, + addons: [ + { name: '@storybook/addon-essentials', options: { controls: false } }, + { name: 'addon-foo', options: { foo: 'bar' } }, + ], + }, + }); + expect(res.addons).toMatchInlineSnapshot(` + Object { + "@storybook/addon-essentials": Object { + "options": Object { + "controls": false, + }, + "version": "x.x.x", + }, + "addon-foo": Object { + "options": undefined, + "version": "x.x.x", + }, + } + `); + }); + test.each(Object.entries(metaFrameworks))( 'should detect the supported metaframework: %s', async (metaFramework, name) => { diff --git a/code/lib/telemetry/src/storybook-metadata.ts b/code/lib/telemetry/src/storybook-metadata.ts index 01a54d9c9ec..2c70b566f97 100644 --- a/code/lib/telemetry/src/storybook-metadata.ts +++ b/code/lib/telemetry/src/storybook-metadata.ts @@ -114,7 +114,9 @@ export const computeStorybookMetadata = async ({ if (typeof addon === 'string') { addonName = sanitizeAddonName(addon); } else { - options = addon.options; + if (addon.name.includes('addon-essentials')) { + options = addon.options; + } addonName = sanitizeAddonName(addon.name); } From 3de6d1a19f6d21bac4ab5d16cd79f6b6bdd29bb8 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 30 Aug 2023 08:37:18 +0200 Subject: [PATCH 051/171] add more information to storybook info --- code/lib/cli/src/generate.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/lib/cli/src/generate.ts b/code/lib/cli/src/generate.ts index f12564b0d9c..49a8eed9401 100644 --- a/code/lib/cli/src/generate.ts +++ b/code/lib/cli/src/generate.ts @@ -88,14 +88,14 @@ command('upgrade') command('info') .description('Prints debugging information about the local environment') .action(() => { - consoleLogger.log(chalk.bold('\nEnvironment Info:')); + consoleLogger.log(chalk.bold('\nStorybook Environment Info:')); envinfo .run({ - System: ['OS', 'CPU'], - Binaries: ['Node', 'Yarn', 'npm'], + System: ['OS', 'CPU', 'Shell'], + Binaries: ['Node', 'Yarn', 'npm', 'pnpm'], Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'], - npmPackages: '@storybook/*', - npmGlobalPackages: '@storybook/*', + npmPackages: '{@storybook/*,*storybook*,sb,chromatic}', + npmGlobalPackages: '{@storybook/*,*storybook*,sb,chromatic}', }) .then(consoleLogger.log); }); From 788ceadae3167f98141a96dfd67aa9134f851fbd Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 30 Aug 2023 08:45:47 +0200 Subject: [PATCH 052/171] fix textarea type for bug templates --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index cbf53f0d9ac..871971bac23 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -30,7 +30,7 @@ body: attributes: label: System description: Please paste the results of `npx storybook@latest info` here. - render: shell + render: bash - type: textarea id: context attributes: From 148c524edf18135c928b8d165605c63f17c546ab Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 30 Aug 2023 08:59:11 +0200 Subject: [PATCH 053/171] change name template --- code/lib/cli/src/sandbox-templates.ts | 72 +++++++++++++-------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 4a2656d4c6f..ba040e993b6 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -77,14 +77,14 @@ export type Template = { }; type BaseTemplates = Template & { - name: `${string} ${`v${number}` | 'Latest' | 'Prerelease'} ${`- ${string} ` | ''}(${ - | 'JS' - | 'TS'})`; + name: `${string} ${`v${number}` | 'Latest' | 'Prerelease'} (${'Webpack' | 'Vite'} | ${ + | 'JavaScript' + | 'TypeScript'})`; }; const baseTemplates = { 'cra/default-js': { - name: 'Create React App Latest (JS)', + name: 'Create React App Latest (Webpack | JavaScript)', script: 'npx create-react-app {{beforeDir}}', expected: { // TODO: change this to @storybook/cra once that package is created @@ -95,7 +95,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'cra/default-ts': { - name: 'Create React App Latest (TS)', + name: 'Create React App Latest (Webpack | TypeScript)', script: 'npx create-react-app {{beforeDir}} --template typescript', // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed. skipTasks: ['smoke-test', 'bench'], @@ -107,7 +107,7 @@ const baseTemplates = { }, }, 'nextjs/12-js': { - name: 'Next.js v12 (JS)', + name: 'Next.js v12 (Webpack | JavaScript)', script: 'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-12-3-2/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^12.2.0" && yarn && git add . && git commit --amend --no-edit && cd ..', expected: { @@ -118,7 +118,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'nextjs/default-js': { - name: 'Next.js Latest (JS)', + name: 'Next.js Latest (Webpack | JavaScript)', script: 'yarn create next-app {{beforeDir}} --javascript --eslint', expected: { framework: '@storybook/nextjs', @@ -128,7 +128,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'nextjs/default-ts': { - name: 'Next.js Latest (TS)', + name: 'Next.js Latest (Webpack | TypeScript)', script: 'yarn create next-app {{beforeDir}} --typescript --eslint', expected: { framework: '@storybook/nextjs', @@ -138,7 +138,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-vite/default-js': { - name: 'React Latest - Vite (JS)', + name: 'React Latest (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template react', expected: { framework: '@storybook/react-vite', @@ -148,7 +148,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-vite/default-ts': { - name: 'React Latest - Vite (TS)', + name: 'React Latest (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template react-ts', expected: { framework: '@storybook/react-vite', @@ -158,7 +158,7 @@ const baseTemplates = { skipTasks: ['bench'], }, 'react-webpack/18-ts': { - name: 'React Latest - Webpack (TS)', + name: 'React Latest (Webpack | TypeScript)', script: 'yarn create webpack5-react {{beforeDir}}', expected: { framework: '@storybook/react-webpack5', @@ -168,7 +168,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-webpack/17-ts': { - name: 'React v17 - Webpack (TS)', + name: 'React v17 (Webpack | TypeScript)', script: 'yarn create webpack5-react {{beforeDir}} --version-react="17" --version-react-dom="17"', expected: { @@ -179,7 +179,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'solid-vite/default-js': { - name: 'SolidJS Latest - Vite (JS)', + name: 'SolidJS Latest (Vite | JavaScript)', script: 'npx degit solidjs/templates/js {{beforeDir}}', expected: { framework: 'storybook-solidjs-vite', @@ -191,7 +191,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'solid-vite/default-ts': { - name: 'SolidJS Latest - Vite (TS)', + name: 'SolidJS Latest (Vite | TypeScript)', script: 'npx degit solidjs/templates/ts {{beforeDir}}', expected: { framework: 'storybook-solidjs-vite', @@ -203,7 +203,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'vue3-vite/default-js': { - name: 'Vue v3 - Vite (JS)', + name: 'Vue v3 (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vue', expected: { framework: '@storybook/vue3-vite', @@ -213,7 +213,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'vue3-vite/default-ts': { - name: 'Vue v3 - Vite (TS)', + name: 'Vue v3 (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vue-ts', expected: { framework: '@storybook/vue3-vite', @@ -223,7 +223,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'vue2-vite/2.7-js': { - name: 'Vue v2 - Vite (JS)', + name: 'Vue v2 (Vite | JavaScript)', script: 'npx create-vue@2 {{beforeDir}} --default', expected: { framework: '@storybook/vue-vite', @@ -234,7 +234,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'html-webpack/default': { - name: 'HTML Latest - Webpack (JS)', + name: 'HTML Latest (Webpack | JavaScript)', script: 'yarn create webpack5-html {{beforeDir}}', expected: { framework: '@storybook/html-webpack5', @@ -244,7 +244,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'html-vite/default-js': { - name: 'HTML Latest - Vite (JS)', + name: 'HTML Latest (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vanilla && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -255,7 +255,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'html-vite/default-ts': { - name: 'HTML Latest - Vite (TS)', + name: 'HTML Latest (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template vanilla-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -266,7 +266,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'svelte-vite/default-js': { - name: 'Svelte Latest - Vite (JS)', + name: 'Svelte Latest (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template svelte', expected: { framework: '@storybook/svelte-vite', @@ -276,7 +276,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'svelte-vite/default-ts': { - name: 'Svelte Latest - Vite (TS)', + name: 'Svelte Latest (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template svelte-ts', expected: { framework: '@storybook/svelte-vite', @@ -287,7 +287,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'angular-cli/prerelease': { - name: 'Angular CLI Prerelease (TS)', + name: 'Angular CLI Prerelease (Webpack | TypeScript)', script: 'npx -p @angular/cli@next ng new angular-v16 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -298,7 +298,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'angular-cli/default-ts': { - name: 'Angular CLI Latest (TS)', + name: 'Angular CLI Latest (Webpack | TypeScript)', script: 'npx -p @angular/cli ng new angular-latest --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -309,7 +309,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'angular-cli/15-ts': { - name: 'Angular CLI v15 (TS)', + name: 'Angular CLI v15 (Webpack | TypeScript)', script: 'npx -p @angular/cli@15 ng new angular-v15 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', expected: { @@ -320,7 +320,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'svelte-kit/skeleton-js': { - name: 'SvelteKit Latest (JS)', + name: 'SvelteKit Latest (Vite | JavaScript)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory={{beforeDir}} --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -331,7 +331,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'svelte-kit/skeleton-ts': { - name: 'SvelteKit Latest (TS)', + name: 'SvelteKit Latest (Vite | TypeScript)', script: 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory={{beforeDir}} --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest', expected: { @@ -342,7 +342,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'lit-vite/default-js': { - name: 'Lit Latest - Vite (JS)', + name: 'Lit Latest (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template lit && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -354,7 +354,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'lit-vite/default-ts': { - name: 'Lit Latest - Vite (TS)', + name: 'Lit Latest (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template lit-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js', expected: { @@ -366,7 +366,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'vue-cli/default-js': { - name: 'Vue v3 - CLI (JS)', + name: 'Vue CLI v3 (Webpack | JavaScript)', script: 'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -378,7 +378,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'vue-cli/vue2-default-js': { - name: 'Vue v2 - CLI (JS)', + name: 'Vue CLI v2 (Webpack | JavaScript)', script: 'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge --preset="Default (Vue 2)" && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -390,7 +390,7 @@ const baseTemplates = { skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'], }, 'preact-webpack5/default-js': { - name: 'Preact Latest - CLI (JS)', + name: 'Preact CLI Latest (Webpack | JavaScript)', script: 'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -401,7 +401,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'preact-webpack5/default-ts': { - name: 'Preact Latest - CLI (TS)', + name: 'Preact CLI Latest (Webpack | TypeScript)', script: 'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js', expected: { @@ -412,7 +412,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'preact-vite/default-js': { - name: 'Preact Latest - Vite (JS)', + name: 'Preact Latest (Vite | JavaScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template preact', expected: { framework: '@storybook/preact-vite', @@ -422,7 +422,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'preact-vite/default-ts': { - name: 'Preact Latest - Vite (TS)', + name: 'Preact Latest (Vite | TypeScript)', script: 'npm create vite@latest --yes {{beforeDir}} -- --template preact-ts', expected: { framework: '@storybook/preact-vite', @@ -432,7 +432,7 @@ const baseTemplates = { skipTasks: ['e2e-tests-dev', 'bench'], }, 'qwik-vite/default-ts': { - name: 'Qwik Latest - CLI (TS)', + name: 'Qwik CLI Latest (Vite | TypeScript)', script: 'yarn create qwik basic {{beforeDir}}', // TODO: The community template does not provide standard stories, which is required for e2e tests. Reenable once it does. inDevelopment: true, From 60e8ee0355440fb51e5dc19a162a34315c87660c Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 30 Aug 2023 10:22:08 +0200 Subject: [PATCH 054/171] highlight active package manager in info cli --- code/lib/cli/src/generate.ts | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/code/lib/cli/src/generate.ts b/code/lib/cli/src/generate.ts index 49a8eed9401..fa52682ee27 100644 --- a/code/lib/cli/src/generate.ts +++ b/code/lib/cli/src/generate.ts @@ -22,6 +22,7 @@ import { dev } from './dev'; import { build } from './build'; import { parseList, getEnvConfig } from './utils'; import versions from './versions'; +import { JsPackageManagerFactory } from './js-package-manager'; addToGlobalContext('cliVersion', versions.storybook); @@ -87,17 +88,24 @@ command('upgrade') command('info') .description('Prints debugging information about the local environment') - .action(() => { + .action(async () => { consoleLogger.log(chalk.bold('\nStorybook Environment Info:')); - envinfo - .run({ - System: ['OS', 'CPU', 'Shell'], - Binaries: ['Node', 'Yarn', 'npm', 'pnpm'], - Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'], - npmPackages: '{@storybook/*,*storybook*,sb,chromatic}', - npmGlobalPackages: '{@storybook/*,*storybook*,sb,chromatic}', - }) - .then(consoleLogger.log); + const pkgManager = await JsPackageManagerFactory.getPackageManager(); + const activePackageManager = pkgManager.type.replace(/\d/, ''); // 'yarn1' -> 'yarn' + const output = await envinfo.run({ + System: ['OS', 'CPU', 'Shell'], + Binaries: ['Node', 'Yarn', 'npm', 'pnpm'], + Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'], + npmPackages: '{@storybook/*,*storybook*,sb,chromatic}', + npmGlobalPackages: '{@storybook/*,*storybook*,sb,chromatic}', + }); + const activePackageManagerLine = output.match(new RegExp(`${activePackageManager}:.*`, 'i')); + consoleLogger.log( + output.replace( + activePackageManagerLine, + chalk.bold(`${activePackageManagerLine} <----- active`) + ) + ); }); command('migrate [migration]') From 3eec835f8c0710a17b8ca4fa91501671e443e6f4 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 30 Aug 2023 10:24:54 +0200 Subject: [PATCH 055/171] update template comment --- code/lib/cli/src/sandbox-templates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index ba040e993b6..9d06a805495 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -19,7 +19,7 @@ export type Template = { /** * Readable name for the template, which will be used for feedback and the status page * Follows the naming scheme when it makes sense: - * <"v"version|"Latest"|"Prerelease"> [- ](JS|TS) + * <"v"version|"Latest"|"Prerelease"> (<"Webpack"|"Vite"> | <"JavaScript"|"TypeScript">) * React Latest - Webpack (TS) * Next.js v12 (JS) * Angular CLI Prerelease From c31c498a39445696957f424a1453b1f2bd40dba9 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 30 Aug 2023 11:44:01 +0200 Subject: [PATCH 056/171] add ability to remove via setting `null` add ability to update status via a state-setter-function --- code/lib/manager-api/src/modules/stories.ts | 23 ++++- .../lib/manager-api/src/tests/stories.test.ts | 84 +++++++++++++++++++ code/lib/types/src/modules/api-stories.ts | 2 +- 3 files changed, 105 insertions(+), 4 deletions(-) diff --git a/code/lib/manager-api/src/modules/stories.ts b/code/lib/manager-api/src/modules/stories.ts index c69e5e23cdb..aff85aabcea 100644 --- a/code/lib/manager-api/src/modules/stories.ts +++ b/code/lib/manager-api/src/modules/stories.ts @@ -263,7 +263,10 @@ export interface SubAPI { * @param {StatusUpdate} update - An object containing the updated status information. * @returns {Promise} A promise that resolves when the status has been updated. */ - experimental_updateStatus: (addonId: string, update: API_StatusUpdate) => Promise; + experimental_updateStatus: ( + addonId: string, + update: API_StatusUpdate | ((state: API_StatusState) => API_StatusUpdate) + ) => Promise; /** * Updates the filtering of the index. * @@ -581,13 +584,27 @@ export const init: ModuleFn = ({ }, /* EXPERIMENTAL APIs */ - experimental_updateStatus: async (id, update) => { + experimental_updateStatus: async (id, input) => { const { status, internal_index: index } = store.getState(); const newStatus = { ...status }; + const update = typeof input === 'function' ? input(status) : input; + + if (Object.keys(update).length === 0) { + return; + } + Object.entries(update).forEach(([storyId, value]) => { newStatus[storyId] = { ...(newStatus[storyId] || {}) }; - newStatus[storyId][id] = value; + if (value === null) { + delete newStatus[storyId][id]; + } else { + newStatus[storyId][id] = value; + } + + if (Object.keys(newStatus[storyId]).length === 0) { + delete newStatus[storyId]; + } }); await store.setState({ status: newStatus }, { persistence: 'session' }); diff --git a/code/lib/manager-api/src/tests/stories.test.ts b/code/lib/manager-api/src/tests/stories.test.ts index 0ee0c9be4eb..a93cd1df9a9 100644 --- a/code/lib/manager-api/src/tests/stories.test.ts +++ b/code/lib/manager-api/src/tests/stories.test.ts @@ -1273,6 +1273,90 @@ describe('stories API', () => { } `); }); + it('delete when value is null', async () => { + const moduleArgs = createMockModuleArgs({}); + const { api } = initStories(moduleArgs as unknown as ModuleArgs); + const { store } = moduleArgs; + + await api.setIndex({ v: 4, entries: mockEntries }); + + await expect( + api.experimental_updateStatus('a-addon-id', { + 'a-story-id': { + status: 'pending', + title: 'an addon title', + description: 'an addon description', + }, + 'another-story-id': { status: 'success', title: 'a addon title', description: '' }, + }) + ).resolves.not.toThrow(); + + // do a second update, this time with null + await expect( + api.experimental_updateStatus('a-addon-id', { + 'a-story-id': null, + 'another-story-id': { status: 'success', title: 'a addon title', description: '' }, + }) + ).resolves.not.toThrow(); + + expect(store.getState().status).toMatchInlineSnapshot(` + Object { + "another-story-id": Object { + "a-addon-id": Object { + "description": "", + "status": "success", + "title": "a addon title", + }, + }, + } + `); + }); + it('updates with a function', async () => { + const moduleArgs = createMockModuleArgs({}); + const { api } = initStories(moduleArgs as unknown as ModuleArgs); + const { store } = moduleArgs; + + await api.setIndex({ v: 4, entries: mockEntries }); + + // setup initial state + await expect( + api.experimental_updateStatus('a-addon-id', () => ({ + 'a-story-id': { + status: 'pending', + title: 'an addon title', + description: 'an addon description', + }, + 'another-story-id': { status: 'success', title: 'a addon title', description: '' }, + })) + ).resolves.not.toThrow(); + + // use existing state in function + await expect( + api.experimental_updateStatus('a-addon-id', (current) => { + return Object.fromEntries( + Object.entries(current).map(([k, v]) => [k, { ...v['a-addon-id'], status: 'success' }]) + ); + }) + ).resolves.not.toThrow(); + expect(store.getState().status).toMatchInlineSnapshot(` + Object { + "a-story-id": Object { + "a-addon-id": Object { + "description": "an addon description", + "status": "success", + "title": "an addon title", + }, + }, + "another-story-id": Object { + "a-addon-id": Object { + "description": "", + "status": "success", + "title": "a addon title", + }, + }, + } + `); + }); }); describe('experimental_setFilter', () => { it('is included in the initial state', async () => { diff --git a/code/lib/types/src/modules/api-stories.ts b/code/lib/types/src/modules/api-stories.ts index 3df42dd812e..45acc19e35c 100644 --- a/code/lib/types/src/modules/api-stories.ts +++ b/code/lib/types/src/modules/api-stories.ts @@ -186,5 +186,5 @@ export type API_StatusState = Record>; export type API_StatusUpdate = Record; export type API_FilterFunction = ( - item: API_PreparedIndexEntry & { status: Record } + item: API_PreparedIndexEntry & { status: Record } ) => boolean; From 07846ac1a946b0b28bd618e9bfdec5ce6255e12d Mon Sep 17 00:00:00 2001 From: Nathan Heaps <1282393+nsheaps@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:28:03 -0400 Subject: [PATCH 057/171] PR feedback - move docs into nextjs specific readme --- code/frameworks/nextjs/README.md | 46 +++++++++++++++++++ docs/sharing/publish-storybook.md | 6 --- ...hromatic-github-action-with-mocking.js.mdx | 10 ---- .../common/mocked-google-fonts.js.mdx | 29 ------------ .../build-pages-with-storybook.md | 19 -------- 5 files changed, 46 insertions(+), 64 deletions(-) delete mode 100644 docs/snippets/common/chromatic-github-action-with-mocking.js.mdx delete mode 100644 docs/snippets/common/mocked-google-fonts.js.mdx diff --git a/code/frameworks/nextjs/README.md b/code/frameworks/nextjs/README.md index 4d9ea854247..d1e1a33bcc8 100644 --- a/code/frameworks/nextjs/README.md +++ b/code/frameworks/nextjs/README.md @@ -19,6 +19,7 @@ - [next/font/google](#nextfontgoogle) - [next/font/local](#nextfontlocal) - [Not supported features of next/font](#not-supported-features-of-nextfont) + - [Mocking fonts during testing](#mocking-fonts-during-testing) - [Next.js Routing](#nextjs-routing) - [Overriding defaults](#overriding-defaults) - [Global Defaults](#global-defaults) @@ -271,6 +272,51 @@ The following features are not supported (yet). Support for these features might - [preload](https://nextjs.org/docs/api-reference/next/font#preload) option gets ignored. Storybook handles Font loading its own way. - [display](https://nextjs.org/docs/api-reference/next/font#display) option gets ignored. All fonts are loaded with display set to "block" to make Storybook load the font properly. +#### Mocking fonts during testing + +Occasionally fetching fonts from google may fail as part of your storybook build. It is highly recommended to mock these requests, as those failures can cause your pipeline to fail as well. Next.js [supports](https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36)https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36 mocking fonts via a javascript module located where the env var `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` references. + +For example, using [GitHub Actions](https://www.chromatic.com/docs/github-actions): + +```shell + - uses: chromaui/action@v1 + env: + #👇 the location of mocked fonts to use + NEXT_FONT_GOOGLE_MOCKED_RESPONSES: ${{ github.workspace }}/mocked-google-fonts.js + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} +``` + +Your mocked fonts will look something lke this: + +```js +// mocked-google-fonts.js +//👇 Mocked responses of google fonts with the URL as the key +module.exports = { + 'https://fonts.googleapis.com/css?family=Inter:wght@400;500;600;800&display=block': ` + /* cyrillic-ext */ + @font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZJhiJ-Ek-_EeAmM.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; + } + /* more font declarations go here */ + /* latin */ + @font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + }`, +}; +``` + ### Next.js Routing [Next.js's router](https://nextjs.org/docs/routing/introduction) is automatically stubbed for you so that when the router is interacted with, all of its interactions are automatically logged to the Actions ctions panel if you have the [Storybook actions addon](https://storybook.js.org/docs/react/essentials/actions). diff --git a/docs/sharing/publish-storybook.md b/docs/sharing/publish-storybook.md index 1e3b4145ff2..0c89b697865 100644 --- a/docs/sharing/publish-storybook.md +++ b/docs/sharing/publish-storybook.md @@ -109,12 +109,6 @@ In your project's root directory, add a new file called `chromatic.yml` inside t
-
- -💡 External font resources may occasionally fail to load at build time for a variety of reasons. If you have issues with them, a good way to get around that problem is to [mock the fonts](../writing-stories/build-pages-with-storybook.md#mocking-fonts) your application requires - -
- Commit and push the file. Congratulations, you've successfully automated publishing your Storybook. Now whenever you open a PR you’ll get a handy link to your published Storybook in your PR checks. ![PR check publish](./prbadge-publish.png) diff --git a/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx b/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx deleted file mode 100644 index 2b4ae573a5e..00000000000 --- a/docs/snippets/common/chromatic-github-action-with-mocking.js.mdx +++ /dev/null @@ -1,10 +0,0 @@ -```shell - - uses: chromaui/action@v1 - env: - #👇 the location of mocked fonts to use - NEXT_FONT_GOOGLE_MOCKED_RESPONSES: ${{ github.workspace }}/mocked-google-fonts.js - with: - #👇 Chromatic projectToken, - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - token: ${{ secrets.GITHUB_TOKEN }} -``` diff --git a/docs/snippets/common/mocked-google-fonts.js.mdx b/docs/snippets/common/mocked-google-fonts.js.mdx deleted file mode 100644 index a56429147f1..00000000000 --- a/docs/snippets/common/mocked-google-fonts.js.mdx +++ /dev/null @@ -1,29 +0,0 @@ -```js -// mocked-google-fonts.js - -//👇 Mocked responses of google fonts -// If you run into errors during your build, easiest is to fetch them yourself and drop them in here -// so the URL requested explicitly matches the mocks rather than trying to determine it yourself. -module.exports = { - 'https://fonts.googleapis.com/css?family=Inter:wght@400;500;600;800&display=block': ` - /* cyrillic-ext */ - @font-face { - font-family: 'Inter'; - font-style: normal; - font-weight: 400; - font-display: block; - src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZJhiJ-Ek-_EeAmM.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; - } - /* more font declarations go here */ - /* latin */ - @font-face { - font-family: 'Inter'; - font-style: normal; - font-weight: 400; - font-display: block; - src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; - }`, -}; -``` diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 53f1de9efb9..4307a31020f 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -394,22 +394,3 @@ If you’ve set up `GlobalContainerContext`, you’ll need to set up a decorator /> - -### Mocking fonts - -If your application uses fonts from Google, occasionally fetching these fonts may fail as part of your storybook build. It is highly recommended to mock these requests, as those failures can cause your pipeline to fail as well. - -#### Mocking fonts in Next.js - -Next.js [supports](https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36)https://github.com/vercel/next.js/blob/725ddc7371f80cca273779d37f961c3e20356f95/packages/font/src/google/fetch-css-from-google-fonts.ts#L36 mocking fonts via a javascript module located where the env var `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` references. - - - - - - From 4c16fd2c4f84be2915be6d874ed2ca0f0170f391 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 30 Aug 2023 19:45:53 +0200 Subject: [PATCH 058/171] add uncaughtException handler in the CLI --- code/lib/cli/bin/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/lib/cli/bin/index.js b/code/lib/cli/bin/index.js index 812bff5291c..7131e95a311 100755 --- a/code/lib/cli/bin/index.js +++ b/code/lib/cli/bin/index.js @@ -6,4 +6,21 @@ if (majorNodeVersion < 16) { process.exit(1); } +// The Storybook CLI has a catch block for all of its commands, but if an error +// occurs before the command even runs, for instance, if an import fails, then +// such error will fall under the uncaughtException handler. +// This is the earliest moment we can catch such errors. +process.once('uncaughtException', (error) => { + if (error.message.includes('string-width')) { + console.error( + [ + '🔴 Error: It looks like you are having a known issue with package hoisting.', + 'Please check the following issue for details and solutions: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092\n\n', + ].join('\n') + ); + } + + throw error; +}); + require('../dist/generate.js'); From 3bd204616c4f6b4f44bf0763460e933dd25e09d2 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 30 Aug 2023 22:56:15 +0200 Subject: [PATCH 059/171] add visual tests addon to storybook:ui --- code/ui/.storybook/main.ts | 8 + code/ui/components/package.json | 1 + code/yarn.lock | 321 +++++++++++++++++++++++++++++++- 3 files changed, 322 insertions(+), 8 deletions(-) diff --git a/code/ui/.storybook/main.ts b/code/ui/.storybook/main.ts index 5f979898a5c..190a5e4b84d 100644 --- a/code/ui/.storybook/main.ts +++ b/code/ui/.storybook/main.ts @@ -51,6 +51,14 @@ const config: StorybookConfig = { '@storybook/addon-interactions', '@storybook/addon-storysource', '@storybook/addon-designs', + { + name: '@chromaui/addon-visual-tests', + options: { + projectId: 'Project:635781f3500dd2c49e189caf', + projectToken: '80b312430ec4', + buildScriptName: 'storybook:ui:build', + }, + }, ], framework: { name: '@storybook/react-vite', diff --git a/code/ui/components/package.json b/code/ui/components/package.json index 9b170beb3b7..9921b6ef112 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -71,6 +71,7 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { + "@chromaui/addon-visual-tests": "^0.0.49", "@popperjs/core": "^2.6.0", "@storybook/icons": "^1.1.6", "@types/react-syntax-highlighter": "11.0.5", diff --git a/code/yarn.lock b/code/yarn.lock index debf9c20cd8..82f1d07dbd2 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5,6 +5,18 @@ __metadata: version: 6 cacheKey: 8c0 +"@0no-co/graphql.web@npm:^1.0.1": + version: 1.0.4 + resolution: "@0no-co/graphql.web@npm:1.0.4" + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + peerDependenciesMeta: + graphql: + optional: true + checksum: bf63cb5b017063363c9a9e06dc17532abc1c2da402c7ebcbc7b5ab2a0601ec93b02de93af9e50d9daffb3b747eddcf0b1e5418a46d1182c5b8087b7d7a1768ad + languageName: node + linkType: hard + "@aashutoshrathi/word-wrap@npm:^1.2.3": version: 1.2.6 resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" @@ -2238,6 +2250,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.1.2": + version: 7.22.10 + resolution: "@babel/runtime@npm:7.22.10" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: d3a006fe2cbaf4048b935fb18f55d9ed52c26292182537b442cee57bf524dbb483367c57f464b1a5a96648d9d8d0fdcda848d58a8a09e18ed3f8971dcd684c6c + languageName: node + linkType: hard + "@babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2": version: 7.22.6 resolution: "@babel/runtime@npm:7.22.6" @@ -2321,6 +2342,38 @@ __metadata: languageName: node linkType: hard +"@chromaui/addon-visual-tests@npm:^0.0.49": + version: 0.0.49 + resolution: "@chromaui/addon-visual-tests@npm:0.0.49" + dependencies: + "@storybook/csf-tools": 7.4.0 + "@storybook/design-system": ^7.15.15 + chromatic: 6.24.0 + date-fns: ^2.30.0 + pluralize: ^8.0.0 + ts-dedent: ^2.2.0 + urql: ^4.0.3 + uuid: ^9.0.0 + peerDependencies: + "@storybook/blocks": ^7.2.0 + "@storybook/client-logger": ^7.2.0 + "@storybook/components": ^7.2.0 + "@storybook/core-events": ^7.2.0 + "@storybook/manager-api": ^7.2.0 + "@storybook/preview-api": ^7.2.0 + "@storybook/theming": ^7.2.0 + "@storybook/types": ^7.2.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: af5860520f2652d866017ca24d11fc38c18030c7452ba430c2f399c41ef5808af9187ded1f1fdcf936e97c68e821f8cce53495a54d8f40a75b07dfc7b94da3c4 + languageName: node + linkType: hard + "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" @@ -2614,7 +2667,7 @@ __metadata: languageName: node linkType: hard -"@emotion/weak-memoize@npm:^0.3.1": +"@emotion/weak-memoize@npm:^0.3.0, @emotion/weak-memoize@npm:^0.3.1": version: 0.3.1 resolution: "@emotion/weak-memoize@npm:0.3.1" checksum: ed514b3cb94bbacece4ac2450d98898066c0a0698bdeda256e312405ca53634cb83c75889b25cd8bbbe185c80f4c05a1f0a0091e1875460ba6be61d0334f0b8a @@ -3347,6 +3400,19 @@ __metadata: languageName: node linkType: hard +"@hypnosphi/create-react-context@npm:^0.3.1": + version: 0.3.1 + resolution: "@hypnosphi/create-react-context@npm:0.3.1" + dependencies: + gud: ^1.0.0 + warning: ^4.0.3 + peerDependencies: + prop-types: ^15.0.0 + react: ">=0.14.0" + checksum: e8072221f9f9c2c47c3ebc5bc6079f9a71938e181d2b4aa3e1d3922707bc097336d5260dad088cf47c1d6e1ff34839fa21f2505a95bddda0d7548c5a955b5691 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -6665,6 +6731,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/components@workspace:ui/components" dependencies: + "@chromaui/addon-visual-tests": ^0.0.49 "@popperjs/core": ^2.6.0 "@radix-ui/react-select": ^1.2.2 "@radix-ui/react-toolbar": ^1.0.4 @@ -6833,7 +6900,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": +"@storybook/csf-tools@7.4.0, @storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": version: 0.0.0-use.local resolution: "@storybook/csf-tools@workspace:lib/csf-tools" dependencies: @@ -6871,6 +6938,32 @@ __metadata: languageName: node linkType: hard +"@storybook/design-system@npm:^7.15.15": + version: 7.15.15 + resolution: "@storybook/design-system@npm:7.15.15" + dependencies: + "@emotion/weak-memoize": ^0.3.0 + "@storybook/theming": ^7.0.2 + "@types/pluralize": ^0.0.29 + "@types/prismjs": ^1.16.6 + "@types/react-modal": ^3.12.1 + "@types/uuid": ^8.3.1 + copy-to-clipboard: ^3.3.1 + human-format: ^0.11.0 + pluralize: ^8.0.0 + polished: ^3.6.4 + prismjs: 1.25.0 + react-github-button: ^0.1.11 + react-modal: ^3.11.2 + react-popper-tooltip: ^2.11.1 + uuid: ^3.3.3 + peerDependencies: + react: ^15.0.0 || ^16.0.0 || ^17.0.0 + react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 + checksum: 3f2ea63556aed966e906b8e56fa0ef12fd67f919426a63350a7ecba5a6cff277b8e18362d680530f7fdfa7240c8ceb890984a0594f5129f2b9d972e991b297cf + languageName: node + linkType: hard + "@storybook/docs-mdx@npm:^0.1.0": version: 0.1.0 resolution: "@storybook/docs-mdx@npm:0.1.0" @@ -8003,7 +8096,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": +"@storybook/theming@^7.0.2, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": version: 0.0.0-use.local resolution: "@storybook/theming@workspace:lib/theming" dependencies: @@ -9193,6 +9286,13 @@ __metadata: languageName: node linkType: hard +"@types/pluralize@npm:^0.0.29": + version: 0.0.29 + resolution: "@types/pluralize@npm:0.0.29" + checksum: 840796fa1db158eb4d9787758d134736e29d9a8035f5b0cbad06e3801fc64b79112ba944c83f9a1a5b94da08703f505b8315b7e0f28bfc0f8e9e1ccfead7b083 + languageName: node + linkType: hard + "@types/prettier@npm:2.7.2": version: 2.7.2 resolution: "@types/prettier@npm:2.7.2" @@ -9214,6 +9314,13 @@ __metadata: languageName: node linkType: hard +"@types/prismjs@npm:^1.16.6": + version: 1.26.0 + resolution: "@types/prismjs@npm:1.26.0" + checksum: dce1388a626c20b95fa2715917deef5a401eec33e9e181f202840ee3b3c7d8a84d5558c834af4c29b8e007741a6a18639b074db8ecccdd6e7de15280fc4dfdd2 + languageName: node + linkType: hard + "@types/prompts@npm:^2.0.9": version: 2.4.4 resolution: "@types/prompts@npm:2.4.4" @@ -9288,6 +9395,15 @@ __metadata: languageName: node linkType: hard +"@types/react-modal@npm:^3.12.1": + version: 3.16.0 + resolution: "@types/react-modal@npm:3.16.0" + dependencies: + "@types/react": "*" + checksum: ee65eb9f47e6c953bed23d716442ee1fcac3c2d586409924317043c8df2e38475c2232ef04e3c57d7d7387d7a319a97732278e92864d7363596e54fc5ebcd0cb + languageName: node + linkType: hard + "@types/react-syntax-highlighter@npm:11.0.5": version: 11.0.5 resolution: "@types/react-syntax-highlighter@npm:11.0.5" @@ -9500,6 +9616,13 @@ __metadata: languageName: node linkType: hard +"@types/uuid@npm:^8.3.1": + version: 8.3.4 + resolution: "@types/uuid@npm:8.3.4" + checksum: b9ac98f82fcf35962317ef7dc44d9ac9e0f6fdb68121d384c88fe12ea318487d5585d3480fa003cf28be86a3bbe213ca688ba786601dce4a97724765eb5b1cf2 + languageName: node + linkType: hard + "@types/uuid@npm:^9.0.1": version: 9.0.2 resolution: "@types/uuid@npm:9.0.2" @@ -9743,6 +9866,16 @@ __metadata: languageName: node linkType: hard +"@urql/core@npm:^4.1.0": + version: 4.1.1 + resolution: "@urql/core@npm:4.1.1" + dependencies: + "@0no-co/graphql.web": ^1.0.1 + wonka: ^6.3.2 + checksum: 1f2077a0ce6cc7e34f03107f6e51f7b4ae77a9ef8f81ac37a81d61828b8ec4fa7b937eb315ead84108164ecd01e442b21f8ad3701fb8df881fa1c63cba114e68 + languageName: node + linkType: hard + "@vitejs/plugin-basic-ssl@npm:1.0.1": version: 1.0.1 resolution: "@vitejs/plugin-basic-ssl@npm:1.0.1" @@ -12721,6 +12854,17 @@ __metadata: languageName: node linkType: hard +"chromatic@npm:6.24.0": + version: 6.24.0 + resolution: "chromatic@npm:6.24.0" + bin: + chroma: dist/bin.js + chromatic: dist/bin.js + chromatic-cli: dist/bin.js + checksum: e5ebc1ff78076e5112d79fd5f4f133febf789cb4713149507f755741cd069daf3f0a2c7f13b7b176becde7734cf010d1d7628a22f3e28087a6faa17f28ffd798 + languageName: node + linkType: hard + "chrome-trace-event@npm:^1.0.2": version: 1.0.3 resolution: "chrome-trace-event@npm:1.0.3" @@ -13966,7 +14110,7 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.0.1": +"date-fns@npm:^2.0.1, date-fns@npm:^2.30.0": version: 2.30.0 resolution: "date-fns@npm:2.30.0" dependencies: @@ -14075,6 +14219,20 @@ __metadata: languageName: node linkType: hard +"deep-equal@npm:^1.1.1": + version: 1.1.1 + resolution: "deep-equal@npm:1.1.1" + dependencies: + is-arguments: ^1.0.4 + is-date-object: ^1.0.1 + is-regex: ^1.0.4 + object-is: ^1.0.1 + object-keys: ^1.1.1 + regexp.prototype.flags: ^1.2.0 + checksum: 473d5dd1d707afd5ad3068864765590591b049d0e0d9a01931599dbbd820e35f09d0a42faa6e4644deb7cf6b7dc90f7bfdf5559f42279d67f714209b62036212 + languageName: node + linkType: hard + "deep-equal@npm:^2.0.5": version: 2.2.2 resolution: "deep-equal@npm:2.2.2" @@ -16155,6 +16313,13 @@ __metadata: languageName: node linkType: hard +"exenv@npm:^1.2.0": + version: 1.2.2 + resolution: "exenv@npm:1.2.2" + checksum: 4e96b355a6b9b9547237288ca779dd673b2e698458b409e88b50df09feb7c85ef94c07354b6b87bc3ed0193a94009a6f7a3c71956da12f45911c0d0f5aa3caa0 + languageName: node + linkType: hard + "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -17826,6 +17991,13 @@ __metadata: languageName: node linkType: hard +"gud@npm:^1.0.0": + version: 1.0.0 + resolution: "gud@npm:1.0.0" + checksum: a4db6edc18e2c4e3a22dc9e639e40a4e5650d53dae9cf384a96d5380dfa17ddda376cf6b7797a5c30d140d2532e5a69d167bdb70c2c151dd673253bac6b027f3 + languageName: node + linkType: hard + "gunzip-maybe@npm:^1.4.2": version: 1.4.2 resolution: "gunzip-maybe@npm:1.4.2" @@ -18496,6 +18668,13 @@ __metadata: languageName: node linkType: hard +"human-format@npm:^0.11.0": + version: 0.11.0 + resolution: "human-format@npm:0.11.0" + checksum: 83cc87af67036b4abb6dc585533fcc232279373f8a3a7a4fc1f6d988f6aa35664f986adb818d04d9de3dee240648ec94a9944a8ab1852df21eb67c254e991ea7 + languageName: node + linkType: hard + "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -19359,7 +19538,7 @@ __metadata: languageName: node linkType: hard -"is-regex@npm:^1.0.3, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.4": +"is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" dependencies: @@ -25162,6 +25341,15 @@ __metadata: languageName: node linkType: hard +"polished@npm:^3.6.4": + version: 3.7.2 + resolution: "polished@npm:3.7.2" + dependencies: + "@babel/runtime": ^7.12.5 + checksum: c36439946b5bfbac16c06dd7b00a89f45e07410427344e909c540ce3ddeb9b44d2ae9cc035a9d77f4551e07b9803419ae77767aec85958a0978158a95c0115d8 + languageName: node + linkType: hard + "polished@npm:^4.2.2": version: 4.2.2 resolution: "polished@npm:4.2.2" @@ -25171,6 +25359,13 @@ __metadata: languageName: node linkType: hard +"popper.js@npm:^1.14.4": + version: 1.16.1 + resolution: "popper.js@npm:1.16.1" + checksum: 1c1a826f757edb5b8c2049dfd7a9febf6ae1e9d0e51342fc715b49a0c1020fced250d26484619883651e097c5764bbcacd2f31496e3646027f079dd83e072681 + languageName: node + linkType: hard + "portfinder@npm:^1.0.28": version: 1.0.32 resolution: "portfinder@npm:1.0.32" @@ -25520,6 +25715,13 @@ __metadata: languageName: node linkType: hard +"prismjs@npm:1.25.0": + version: 1.25.0 + resolution: "prismjs@npm:1.25.0" + checksum: 0c3853a6c815b23a07bef77700f60a40b2a12018a383a75cd7d108718717b73927c809e7dd08ac0ae9f16fbe1e005b337262bc95952cf9cfc91914f986b07bd3 + languageName: node + linkType: hard + "prismjs@npm:^1.27.0": version: 1.29.0 resolution: "prismjs@npm:1.29.0" @@ -25662,7 +25864,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": +"prop-types@npm:^15.5.10, prop-types@npm:^15.6.1, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -26247,6 +26449,15 @@ __metadata: languageName: node linkType: hard +"react-github-button@npm:^0.1.11": + version: 0.1.11 + resolution: "react-github-button@npm:0.1.11" + dependencies: + prop-types: ^15.5.10 + checksum: e00fa4f3b2dee74f45fff0c9d68d7d75eefa495d27a56ef2e2391f9600623d16b8a9f99c1d35a7b4f620dfb95dd8ed0b1a76fbbfece4be0843cd507c17a37dfa + languageName: node + linkType: hard + "react-helmet-async@npm:^1.0.7": version: 1.3.0 resolution: "react-helmet-async@npm:1.3.0" @@ -26300,6 +26511,13 @@ __metadata: languageName: node linkType: hard +"react-lifecycles-compat@npm:^3.0.0": + version: 3.0.4 + resolution: "react-lifecycles-compat@npm:3.0.4" + checksum: 1d0df3c85af79df720524780f00c064d53a9dd1899d785eddb7264b378026979acbddb58a4b7e06e7d0d12aa1494fd5754562ee55d32907b15601068dae82c27 + languageName: node + linkType: hard + "react-merge-refs@npm:^1.0.0": version: 1.1.0 resolution: "react-merge-refs@npm:1.1.0" @@ -26307,6 +26525,34 @@ __metadata: languageName: node linkType: hard +"react-modal@npm:^3.11.2": + version: 3.16.1 + resolution: "react-modal@npm:3.16.1" + dependencies: + exenv: ^1.2.0 + prop-types: ^15.7.2 + react-lifecycles-compat: ^3.0.0 + warning: ^4.0.3 + peerDependencies: + react: ^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18 + react-dom: ^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18 + checksum: 7b56e2c505b2b924736c471a34754a4211df40ac2d6fb0949cf095aea5e65d3326bd9f111fa7898acf40afa54f526809ad8aa47e02b8328663d11422568dc7b1 + languageName: node + linkType: hard + +"react-popper-tooltip@npm:^2.11.1": + version: 2.11.1 + resolution: "react-popper-tooltip@npm:2.11.1" + dependencies: + "@babel/runtime": ^7.9.2 + react-popper: ^1.3.7 + peerDependencies: + react: ^16.6.0 + react-dom: ^16.6.0 + checksum: f81278f1ea87899ffa57fed85c2531fa583ebca424ae5522e3a1b05c5635c014b3467391e77fb9c48bbc8e7b9f1050fa9302e8ee6134a9333858b5a6e0ae1b49 + languageName: node + linkType: hard + "react-popper-tooltip@npm:^4.4.2": version: 4.4.2 resolution: "react-popper-tooltip@npm:4.4.2" @@ -26321,6 +26567,23 @@ __metadata: languageName: node linkType: hard +"react-popper@npm:^1.3.7": + version: 1.3.11 + resolution: "react-popper@npm:1.3.11" + dependencies: + "@babel/runtime": ^7.1.2 + "@hypnosphi/create-react-context": ^0.3.1 + deep-equal: ^1.1.1 + popper.js: ^1.14.4 + prop-types: ^15.6.1 + typed-styles: ^0.0.7 + warning: ^4.0.2 + peerDependencies: + react: 0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0 + checksum: d5dd1d0d4b5a3407134681b42a079fce525c94bce892ad177515d54a8cf64203eecbc30231476367e916aaff91221f5b6abd5afc207a86c698f35b7254178488 + languageName: node + linkType: hard + "react-popper@npm:^2.3.0": version: 2.3.0 resolution: "react-popper@npm:2.3.0" @@ -26815,6 +27078,13 @@ __metadata: languageName: node linkType: hard +"regenerator-runtime@npm:^0.14.0": + version: 0.14.0 + resolution: "regenerator-runtime@npm:0.14.0" + checksum: e25f062c1a183f81c99681691a342760e65c55e8d3a4d4fe347ebe72433b123754b942b70b622959894e11f8a9131dc549bd3c9a5234677db06a4af42add8d12 + languageName: node + linkType: hard + "regenerator-transform@npm:^0.15.1": version: 0.15.1 resolution: "regenerator-transform@npm:0.15.1" @@ -26841,7 +27111,7 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.0": +"regexp.prototype.flags@npm:^1.2.0, regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.0": version: 1.5.0 resolution: "regexp.prototype.flags@npm:1.5.0" dependencies: @@ -30162,6 +30432,13 @@ __metadata: languageName: node linkType: hard +"typed-styles@npm:^0.0.7": + version: 0.0.7 + resolution: "typed-styles@npm:0.0.7" + checksum: ec159f0e538364750cf9b8f19136375df64ad364fda355e6f7a7216ebffc67f18b436722c5c6853c89f70e6507eb69e5061ceb9334fa1f54902c0f6be1b985fe + languageName: node + linkType: hard + "typedarray@npm:^0.0.6": version: 0.0.6 resolution: "typedarray@npm:0.0.6" @@ -30723,6 +31000,18 @@ __metadata: languageName: node linkType: hard +"urql@npm:^4.0.3": + version: 4.0.5 + resolution: "urql@npm:4.0.5" + dependencies: + "@urql/core": ^4.1.0 + wonka: ^6.3.2 + peerDependencies: + react: ">= 16.8.0" + checksum: 9560d04b3c2fe72c921bdb21e969039b776e07999704d23bce35f815eb537c9357b6c7322a1b8cd43957550798c30cd15f5130ddd054dfd8a890d17d2be85282 + languageName: node + linkType: hard + "use-callback-ref@npm:^1.3.0": version: 1.3.0 resolution: "use-callback-ref@npm:1.3.0" @@ -30867,6 +31156,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^3.3.3": + version: 3.4.0 + resolution: "uuid@npm:3.4.0" + bin: + uuid: ./bin/uuid + checksum: 1c13950df865c4f506ebfe0a24023571fa80edf2e62364297a537c80af09c618299797bbf2dbac6b1f8ae5ad182ba474b89db61e0e85839683991f7e08795347 + languageName: node + linkType: hard + "uuid@npm:^9.0.0": version: 9.0.0 resolution: "uuid@npm:9.0.0" @@ -31480,7 +31778,7 @@ __metadata: languageName: node linkType: hard -"warning@npm:^4.0.2": +"warning@npm:^4.0.2, warning@npm:^4.0.3": version: 4.0.3 resolution: "warning@npm:4.0.3" dependencies: @@ -31952,6 +32250,13 @@ __metadata: languageName: node linkType: hard +"wonka@npm:^6.3.2": + version: 6.3.4 + resolution: "wonka@npm:6.3.4" + checksum: 77329eea673da07717476e1b8f1a22f1e1a4f261bb9a58fa446c03d3da13dbd5b254664f8aded5928d953f33ee5b399a17a4f70336e8b236e478209c0e78cda4 + languageName: node + linkType: hard + "wordwrap@npm:^1.0.0": version: 1.0.0 resolution: "wordwrap@npm:1.0.0" From 15b8f838be36f30a6783b9a17ccbb98ecdab6590 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 31 Aug 2023 11:58:11 +0200 Subject: [PATCH 060/171] sanitize ansi codes in error message and stack --- code/lib/telemetry/src/sanitize.test.ts | 16 ++++++++++++++++ code/lib/telemetry/src/sanitize.ts | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/code/lib/telemetry/src/sanitize.test.ts b/code/lib/telemetry/src/sanitize.test.ts index f5b3a742d3e..a3389c83df7 100644 --- a/code/lib/telemetry/src/sanitize.test.ts +++ b/code/lib/telemetry/src/sanitize.test.ts @@ -1,7 +1,23 @@ +/* eslint-disable local-rules/no-uncategorized-errors */ import { sanitizeError, cleanPaths } from './sanitize'; describe(`Errors Helpers`, () => { describe(`sanitizeError`, () => { + it(`Sanitizes ansi codes in error`, () => { + const errorMessage = `\u001B[4mStorybook\u001B[0m`; + let e: any; + try { + throw new Error(errorMessage); + } catch (error) { + e = error; + } + + const sanitizedError = sanitizeError(e); + + expect(sanitizedError.message).toEqual('Storybook'); + expect(sanitizedError.stack).toContain('Error: Storybook'); + }); + it(`Sanitizes current path from error stacktraces`, () => { const errorMessage = `this is a test`; let e: any; diff --git a/code/lib/telemetry/src/sanitize.ts b/code/lib/telemetry/src/sanitize.ts index 4c68ed50db9..a611dbea1a1 100644 --- a/code/lib/telemetry/src/sanitize.ts +++ b/code/lib/telemetry/src/sanitize.ts @@ -12,6 +12,11 @@ function regexpEscape(str: string): string { return str.replace(/[-[/{}()*+?.\\^$|]/g, `\\$&`); } +export function removeAnsiEscapeCodes(input: string): string { + // eslint-disable-next-line no-control-regex + return input.replace(/\u001B\[[0-9;]*m/g, ''); +} + export function cleanPaths(str: string, separator: string = sep): string { if (!str) return str; @@ -35,7 +40,15 @@ export function cleanPaths(str: string, separator: string = sep): string { export function sanitizeError(error: Error, pathSeparator: string = sep) { try { // Hack because Node - error = JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); + error = JSON.parse( + JSON.stringify(error, [...Object.getOwnPropertyNames(error), 'message', 'name']) + ); + if (error.message) { + error.message = removeAnsiEscapeCodes(error.message); + } + if (error.stack) { + error.stack = removeAnsiEscapeCodes(error.stack); + } // Removes all user paths const errorString = cleanPaths(JSON.stringify(error), pathSeparator); From e2e9c24ba9c454c6fcfc8c5958ce1b65ad9a07e3 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 31 Aug 2023 15:03:03 +0200 Subject: [PATCH 061/171] use node 18 to generate angular sandboxes --- .github/workflows/generate-sandboxes-main.yml | 57 ------------------- ...dboxes-next.yml => generate-sandboxes.yml} | 25 ++++++-- scripts/sandbox/generate.ts | 25 +++++++- 3 files changed, 42 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/generate-sandboxes-main.yml rename .github/workflows/{generate-sandboxes-next.yml => generate-sandboxes.yml} (69%) diff --git a/.github/workflows/generate-sandboxes-main.yml b/.github/workflows/generate-sandboxes-main.yml deleted file mode 100644 index 66cd1b800d3..00000000000 --- a/.github/workflows/generate-sandboxes-main.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Generate and push sandboxes (main) - -on: - schedule: - - cron: '2 2 */1 * *' - workflow_dispatch: - # To test fixes on push rather than wait for the scheduling, do the following: - # 1. Uncomment the lines below and add your branch. - # push: - # branches: - # - - # 2. change the "ref" value to in the actions/checkout step below. - # 3. 👉 DON'T FORGET TO UNDO THE VALUES BACK TO `main` BEFORE YOU MERGE YOUR CHANGES! - -jobs: - generate: - runs-on: ubuntu-latest - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - CLEANUP_SANDBOX_NODE_MODULES: true - steps: - - uses: actions/setup-node@v3 - with: - node-version: 16 - - uses: actions/checkout@v3 - with: - ref: main - - name: Setup git user - run: | - git config --global user.name "Storybook Bot" - git config --global user.email "bot@storybook.js.org" - - name: Install dependencies - run: node ./scripts/check-dependencies.js - - name: Compile Storybook libraries - run: yarn task --task compile --start-from=auto --no-link - - name: Publishing to local registry - run: yarn local-registry --publish - working-directory: ./code - - name: Running local registry - run: yarn local-registry --open & - working-directory: ./code - - name: Wait for registry - run: yarn wait-on http://localhost:6001 - working-directory: ./code - - name: Generate - run: yarn generate-sandboxes --local-registry - working-directory: ./code - - name: Publish - run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=main - working-directory: ./code - - name: The job has failed - if: ${{ failure() || cancelled() }} - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }} - uses: Ilshidur/action-discord@master - with: - args: 'The generation of sandboxes in the **main** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' diff --git a/.github/workflows/generate-sandboxes-next.yml b/.github/workflows/generate-sandboxes.yml similarity index 69% rename from .github/workflows/generate-sandboxes-next.yml rename to .github/workflows/generate-sandboxes.yml index f22e7cb4a50..c37ecb643fa 100644 --- a/.github/workflows/generate-sandboxes-next.yml +++ b/.github/workflows/generate-sandboxes.yml @@ -1,4 +1,4 @@ -name: Generate and push sandboxes (next) +name: Generate and push sandboxes on: schedule: @@ -18,13 +18,26 @@ jobs: env: YARN_ENABLE_IMMUTABLE_INSTALLS: false CLEANUP_SANDBOX_NODE_MODULES: true + strategy: + matrix: + node_version: + - 16 + - 18 + branch: + - main + - next + include: + - node_version: 16 + excludeTemplates: 'angular-cli/prerelease' + - node_version: 18 + includeTemplates: 'angular-cli/prerelease' steps: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: ${{ matrix.node_version }} - uses: actions/checkout@v3 with: - ref: next + ref: ${{ matrix.branch }} - name: Setup git user run: | git config --global user.name "Storybook Bot" @@ -43,10 +56,10 @@ jobs: run: yarn wait-on http://localhost:6001 working-directory: ./code - name: Generate - run: yarn generate-sandboxes --local-registry + run: yarn generate-sandboxes --local-registry --includeTemplates "${{matrix.includeTemplates}}" --excludeTemplates "${{matrix.excludeTemplates}}" working-directory: ./code - name: Publish - run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=next + run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=${{ matrix.branch }}} working-directory: ./code - name: The job has failed if: ${{ failure() || cancelled() }} @@ -54,4 +67,4 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }} uses: Ilshidur/action-discord@master with: - args: 'The generation of sandboxes in the **next** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' + args: 'The generation of sandboxes in the **${{ matrix.branch }}** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index b74ae5a28d0..6c2455d0d93 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -207,6 +207,17 @@ export const options = createOptions({ description: 'Which template would you like to create?', values: Object.keys(sandboxTemplates), }, + includeTemplates: { + type: 'string', + description: 'Comma-delimited list of templates to include', + promptType: false, + }, + excludeTemplates: { + type: 'string', + description: + 'Comma-delimited list of templates to exclude. Takes precedence over --includedTemplates', + promptType: false, + }, localRegistry: { type: 'boolean', description: 'Generate reproduction from local registry?', @@ -221,6 +232,8 @@ export const options = createOptions({ export const generate = async ({ template, + includeTemplates, + excludeTemplates, localRegistry, debug, }: OptionValues) => { @@ -233,8 +246,11 @@ export const generate = async ({ if (template) { return dirName === template; } - - return true; + let include = includeTemplates ? includeTemplates.split(',').includes(dirName) : true; + if (excludeTemplates && include) { + include = !excludeTemplates.split(',').includes(dirName); + } + return include; }); await runGenerators(generatorConfigs, localRegistry, debug); @@ -244,6 +260,11 @@ if (require.main === module) { program .description('Generate sandboxes from a set of possible templates') .option('--template