From 70f36b4c1198de606bb0377d448d2454f3dcbc76 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 30 Sep 2022 10:22:41 +0200 Subject: [PATCH 01/16] add sveltekit template --- code/lib/cli/src/repro-templates.ts | 14 ++++++++++++++ scripts/sandbox.ts | 1 + 2 files changed, 15 insertions(+) diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index 8910264bc56c..bbeb9f6c8889 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -94,6 +94,19 @@ const svelteViteTemplates = { // } }; +const svelteKitTemplates = { + 'svelte-kit/default-js': { + name: 'Svelte Kit (JS)', + script: 'npm create svelte-with-args', + cadence: ['ci', 'daily', 'weekly'], + expected: { + framework: '@storybook/svelte-vite', + renderer: '@storybook/svelte', + builder: '@storybook/builder-vite', + }, + }, +}; + const vueCliTemplates = { 'vue-cli/default-js': { name: 'Vue-CLI (Default JS)', @@ -126,6 +139,7 @@ export default { ...reactViteTemplates, ...vue3ViteTemplates, ...svelteViteTemplates, + ...svelteKitTemplates, ...vueCliTemplates, // FIXME: missing documentation.json // 'angular/latest': { diff --git a/scripts/sandbox.ts b/scripts/sandbox.ts index f1d85de6f6ac..001f109ee651 100644 --- a/scripts/sandbox.ts +++ b/scripts/sandbox.ts @@ -13,6 +13,7 @@ import { import prompts from 'prompts'; import type { AbortController } from 'node-abort-controller'; import command from 'execa'; +import dedent from 'ts-dedent'; import { createOptions, getOptionsOrPrompt, OptionValues } from './utils/options'; import { executeCLIStep } from './utils/cli-step'; From 7d4c1178d1f7229c15cf6f29ff47aa0c481e5079 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Sat, 1 Oct 2022 00:14:42 +0200 Subject: [PATCH 02/16] add actual repro configs using create-svelte-with-args --- code/lib/cli/src/repro-templates.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index bbeb9f6c8889..54d6e8edb3da 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -95,9 +95,21 @@ const svelteViteTemplates = { }; const svelteKitTemplates = { - 'svelte-kit/default-js': { + 'svelte-kit/skeleton-js': { name: 'Svelte Kit (JS)', - script: 'npm create svelte-with-args', + script: + 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright', + cadence: ['ci', 'daily', 'weekly'], + expected: { + framework: '@storybook/svelte-vite', + renderer: '@storybook/svelte', + builder: '@storybook/builder-vite', + }, + }, + 'svelte-kit/skeleton-ts': { + name: 'Svelte Kit (TS)', + script: + 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright', cadence: ['ci', 'daily', 'weekly'], expected: { framework: '@storybook/svelte-vite', From ceaf69b15f1c85e9aea3c017d84a8de7aa2138ed Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 00:51:03 +0200 Subject: [PATCH 03/16] allow root dir in vite-builder --- code/lib/builder-vite/src/vite-config.ts | 13 +++++++++++ code/lib/builder-vite/src/vite-server.ts | 29 ++++++++++++------------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index ccc58b27dfc6..02935a953924 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -88,6 +88,19 @@ export async function pluginConfig(options: ExtendedOptions) { mdxPlugin(options), injectExportOrderPlugin, stripStoryHMRBoundary(), + { + name: 'vite-plugin-storybook-allow-root-dir', + enforce: 'post', + config(config) { + // if there is NO allow list then Vite allows anything in the root directory + // if there is an allow list then Vite only allows anything in the listed directories + // add the root directory only if there's an allow list so that we don't end up + // disallowing the other directories unless root is already disallowed + if (config?.server?.fs?.allow) { + config.server.fs.allow.push('.'); + } + }, + }, ] as PluginOption[]; // We need the react plugin here to support MDX in non-react projects. diff --git a/code/lib/builder-vite/src/vite-server.ts b/code/lib/builder-vite/src/vite-server.ts index a8a1b35b1d46..10ee50c724e3 100644 --- a/code/lib/builder-vite/src/vite-server.ts +++ b/code/lib/builder-vite/src/vite-server.ts @@ -7,23 +7,24 @@ import { getOptimizeDeps } from './optimizeDeps'; export async function createViteServer(options: ExtendedOptions, devServer: Server) { const { presets } = options; - const config = await commonConfig(options, 'development'); + const commonCfg = await commonConfig(options, 'development'); - // Set up dev server - config.server = { - middlewareMode: true, - hmr: { - port: options.port, - server: devServer, - }, - fs: { - strict: true, + const config = { + ...commonCfg, + // Set up dev server + server: { + middlewareMode: true, + hmr: { + port: options.port, + server: devServer, + }, + fs: { + strict: true, + }, }, + appType: 'custom' as const, + optimizeDeps: await getOptimizeDeps(commonCfg, options), }; - config.appType = 'custom'; - - // TODO: find a way to avoid having to do this in a separate step. - config.optimizeDeps = await getOptimizeDeps(config, options); const finalConfig = await presets.apply('viteFinal', config, options); return createServer(finalConfig); From 41091a6407642d43e66bc11ca9754958c130b052 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 00:51:42 +0200 Subject: [PATCH 04/16] remove sveltepreprocess from svelte templates --- code/lib/cli/src/generators/SVELTE/index.ts | 30 --------------------- code/lib/cli/src/repro-templates.ts | 1 + 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/code/lib/cli/src/generators/SVELTE/index.ts b/code/lib/cli/src/generators/SVELTE/index.ts index b3f10af75674..4e8b8e515f46 100644 --- a/code/lib/cli/src/generators/SVELTE/index.ts +++ b/code/lib/cli/src/generators/SVELTE/index.ts @@ -1,43 +1,13 @@ -import fse from 'fs-extra'; -import { logger } from '@storybook/node-logger'; - import { CoreBuilder } from '../../project_types'; import { baseGenerator } from '../baseGenerator'; import { Generator } from '../types'; const generator: Generator = async (packageManager, npmOptions, options) => { - let extraMain; - // svelte.config.js ? - if (fse.existsSync('./svelte.config.js')) { - logger.info("Configuring preprocessor from 'svelte.config.js'"); - - extraMain = { - svelteOptions: { preprocess: '%%require("../svelte.config.js").preprocess%%' }, - }; - } else if (fse.existsSync('./svelte.config.cjs')) { - logger.info("Configuring preprocessor from 'svelte.config.cjs'"); - - extraMain = { - svelteOptions: { preprocess: '%%require("../svelte.config.cjs").preprocess%%' }, - }; - } else { - // svelte-preprocess dependencies ? - const packageJson = packageManager.retrievePackageJson(); - if (packageJson.devDependencies && packageJson.devDependencies['svelte-preprocess']) { - logger.info("Configuring preprocessor with 'svelte-preprocess'"); - - extraMain = { - svelteOptions: { preprocess: '%%require("svelte-preprocess")()%%' }, - }; - } - } - const extraPackages = options.builder === CoreBuilder.Webpack5 ? ['svelte', 'svelte-loader'] : []; await baseGenerator(packageManager, npmOptions, options, 'svelte', { extraPackages, extensions: ['js', 'jsx', 'ts', 'tsx', 'svelte'], - extraMain, commonJs: true, }); }; diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index 54d6e8edb3da..9fa59b8a9ce4 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -94,6 +94,7 @@ const svelteViteTemplates = { // } }; +// SvelteKit only supports Node.js >16.x, so before generating these repros you need to switch to that version const svelteKitTemplates = { 'svelte-kit/skeleton-js': { name: 'Svelte Kit (JS)', From f205c1c72bf1ebb3c6f1126931e460b8d08c6648 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 01:16:33 +0200 Subject: [PATCH 05/16] remove vite-plugin-svelte-kit in config --- code/frameworks/svelte-vite/src/preset.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index 8006514d2fde..631c02235a15 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -1,6 +1,7 @@ import path from 'path'; import fs from 'fs'; import type { StorybookConfig } from '@storybook/builder-vite'; +import { PluginOption } from 'vite'; import { svelteDocgen } from './plugins/svelte-docgen'; export const addons: StorybookConfig['addons'] = ['@storybook/svelte']; @@ -24,8 +25,23 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets plugins.push(svelteDocgen(config)); + removeSvelteKitPlugin(plugins); + return { ...config, plugins, }; }; + +const removeSvelteKitPlugin = (plugins: PluginOption[]) => { + plugins.forEach((plugin, index) => { + if (plugin && 'name' in plugin && plugin.name === 'vite-plugin-svelte-kit') { + // eslint-disable-next-line no-param-reassign -- we explicitly want to mutate the array as stated in Vite docs + plugins[index] = undefined; + } + if (Array.isArray(plugin)) { + // recursive, Vite plugins can be nested + removeSvelteKitPlugin(plugin); + } + }); +}; From 60566608e6a4cdb99d1a904772f775cb5254b1a2 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 01:48:05 +0200 Subject: [PATCH 06/16] only allow storybook and template dirs --- code/lib/builder-vite/src/vite-config.ts | 6 +++--- code/lib/cli/src/repro-templates.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index 0a40de90ec5f..8fffd86f7877 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -88,10 +88,10 @@ export async function pluginConfig(options: ExtendedOptions) { config(config) { // if there is NO allow list then Vite allows anything in the root directory // if there is an allow list then Vite only allows anything in the listed directories - // add the root directory only if there's an allow list so that we don't end up - // disallowing the other directories unless root is already disallowed + // add storybook specific directories only if there's an allow list so that we don't end up + // disallowing the root unless root is already disallowed if (config?.server?.fs?.allow) { - config.server.fs.allow.push('.'); + config.server.fs.allow.push('.storybook', 'template-stories'); } }, }, diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index d5bf2d65619f..b81f9e3fe703 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -136,6 +136,7 @@ const svelteKitTemplates = { }, }, }; + const litViteTemplates = { 'lit-vite/default-js': { name: 'Lit Vite (JS)', From 8d38821b7d3650445435e3bdebc5f321d973871d Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 15:20:07 +0200 Subject: [PATCH 07/16] allow template-stories only when sandboxing --- code/frameworks/svelte-vite/src/preset.ts | 2 +- code/lib/builder-vite/src/vite-config.ts | 4 ++-- scripts/sandbox.ts | 23 +++++++++++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index 8612a09f8878..2b1f62c4e60e 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -24,7 +24,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets const removeSvelteKitPlugin = (plugins: PluginOption[]) => { plugins.forEach((plugin, index) => { if (plugin && 'name' in plugin && plugin.name === 'vite-plugin-svelte-kit') { - // eslint-disable-next-line no-param-reassign -- we explicitly want to mutate the array as stated in Vite docs + // eslint-disable-next-line no-param-reassign -- we explicitly want to mutate the array as stated here: https://vitejs.dev/guide/api-plugin.html#config plugins[index] = undefined; } if (Array.isArray(plugin)) { diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index 8fffd86f7877..0f6efc5dd514 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -83,7 +83,7 @@ export async function pluginConfig(options: ExtendedOptions) { injectExportOrderPlugin, stripStoryHMRBoundary(), { - name: 'vite-plugin-storybook-allow-root-dir', + name: 'storybook:allow-root-dir', enforce: 'post', config(config) { // if there is NO allow list then Vite allows anything in the root directory @@ -91,7 +91,7 @@ export async function pluginConfig(options: ExtendedOptions) { // add storybook specific directories only if there's an allow list so that we don't end up // disallowing the root unless root is already disallowed if (config?.server?.fs?.allow) { - config.server.fs.allow.push('.storybook', 'template-stories'); + config.server.fs.allow.push('.storybook'); } }, }, diff --git a/scripts/sandbox.ts b/scripts/sandbox.ts index 121b1b0bdb56..3bea9dea0f5c 100644 --- a/scripts/sandbox.ts +++ b/scripts/sandbox.ts @@ -246,9 +246,13 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) { ); } -// Recompile optimized deps on each startup, so you can change @storybook/* packages and not -// have to clear caches. -function forceViteRebuilds(mainConfig: ConfigFile) { +/* + Recompile optimized deps on each startup, so you can change @storybook/* packages and not + have to clear caches. + And allow "template-stories" directory if necessary + +*/ +function setSandboxViteFinal(mainConfig: ConfigFile) { const viteFinalCode = ` (config) => ({ ...config, @@ -256,6 +260,17 @@ function forceViteRebuilds(mainConfig: ConfigFile) { ...config.optimizeDeps, force: true, }, + plugins: [ + ...config.plugins, + { + name: 'storybook:allow-template-stories', + config(config) { + if (config?.server?.fs?.allow) { + config.server.fs.allow.push('template-stories'); + } + }, + }, + ], })`; mainConfig.setFieldNode( ['viteFinal'], @@ -468,7 +483,7 @@ export async function sandbox(optionValues: OptionValues) { // Add some extra settings (see above for what these do) mainConfig.setFieldValue(['core', 'disableTelemetry'], true); if (builder === '@storybook/builder-webpack5') addEsbuildLoaderToStories(mainConfig); - if (builder === '@storybook/builder-vite') forceViteRebuilds(mainConfig); + if (builder === '@storybook/builder-vite') setSandboxViteFinal(mainConfig); await writeConfig(mainConfig); From 0a7f052663cec4420764f55763f58143250b51c2 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 15:46:06 +0200 Subject: [PATCH 08/16] publish repros via gh actions --- .github/workflows/generate-repros-next.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-repros-next.yml b/.github/workflows/generate-repros-next.yml index 43da2e6f8711..74a268321815 100644 --- a/.github/workflows/generate-repros-next.yml +++ b/.github/workflows/generate-repros-next.yml @@ -7,7 +7,7 @@ on: # To remove when the branch will be merged push: branches: - - vite-frameworks-xyz + - jeppe/sb-544-sveltekit jobs: generate: From bb3583ab7f9e6738e1e7a590a11a3b5a8a7ff6b7 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 4 Oct 2022 17:07:16 +0200 Subject: [PATCH 09/16] rename storybook vite plugin --- code/lib/builder-vite/src/vite-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index 0f6efc5dd514..382b45b2f11f 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -83,7 +83,7 @@ export async function pluginConfig(options: ExtendedOptions) { injectExportOrderPlugin, stripStoryHMRBoundary(), { - name: 'storybook:allow-root-dir', + name: 'storybook:allow-storybook-dir', enforce: 'post', config(config) { // if there is NO allow list then Vite allows anything in the root directory From 22ff5e77237cf9aab9d9dda1d5e1cb8020ccae5f Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 5 Oct 2022 08:46:45 +0200 Subject: [PATCH 10/16] always allow directories in sandboxes --- scripts/sandbox.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/sandbox.ts b/scripts/sandbox.ts index 3bea9dea0f5c..973e4fe4900d 100644 --- a/scripts/sandbox.ts +++ b/scripts/sandbox.ts @@ -249,28 +249,21 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) { /* Recompile optimized deps on each startup, so you can change @storybook/* packages and not have to clear caches. - And allow "template-stories" directory if necessary - + And allow source directories to complement any existing allow patterns + (".storybook" is already being allowed by builder-vite) */ function setSandboxViteFinal(mainConfig: ConfigFile) { const viteFinalCode = ` (config) => ({ ...config, - optimizeDeps: { - ...config.optimizeDeps, - force: true, - }, - plugins: [ - ...config.plugins, - { - name: 'storybook:allow-template-stories', - config(config) { - if (config?.server?.fs?.allow) { - config.server.fs.allow.push('template-stories'); - } - }, + optimizeDeps: { ...config.optimizeDeps, force: true }, + server: { + ...config.server, + fs: { + ...config.server?.fs, + allow: ['src', 'template-stories', 'node_modules', ...(config.server?.fs?.allow || [])], }, - ], + }, })`; mainConfig.setFieldNode( ['viteFinal'], From ea50752c51664c39adce526a9107ec51f17f502f Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 5 Oct 2022 11:52:19 +0200 Subject: [PATCH 11/16] remove generate repros workflow --- .github/workflows/generate-repros-next.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-repros-next.yml b/.github/workflows/generate-repros-next.yml index 74a268321815..e1acd7f4d844 100644 --- a/.github/workflows/generate-repros-next.yml +++ b/.github/workflows/generate-repros-next.yml @@ -5,9 +5,9 @@ on: - cron: '2 2 */1 * *' workflow_dispatch: # To remove when the branch will be merged - push: - branches: - - jeppe/sb-544-sveltekit + # push: + # branches: + # - jeppe/sb-544-sveltekit jobs: generate: From fef78505161328c03ae47f8dc5b583e8a1901c4b Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 5 Oct 2022 12:14:33 +0200 Subject: [PATCH 12/16] add create-svelte-with-args to list of verdaccio packages outside this repo --- scripts/verdaccio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/verdaccio.yaml b/scripts/verdaccio.yaml index c3dcd0b78f37..7f2073546c87 100644 --- a/scripts/verdaccio.yaml +++ b/scripts/verdaccio.yaml @@ -63,6 +63,10 @@ packages: access: $all publish: $all proxy: npmjs + '@storybook/create-svelte-with-args': + access: $all + publish: $all + proxy: npmjs '@storybook/react-docgen-typescript-plugin': access: $all publish: $all From c2ccb55995793a78acb5f3d47dd0fe0d4d2e69a7 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 5 Oct 2022 13:03:49 +0200 Subject: [PATCH 13/16] Fix CircleCI parallelism --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a3c21d9b92d..104c8b5852f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -316,7 +316,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 11 + parallelism: 13 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' From 7ecab8da790a9b6a7c8ff4e9b76454070f618277 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 13 Oct 2022 20:33:11 +0200 Subject: [PATCH 14/16] dont remove sveltekit plugins, disable sveltekit repro --- code/frameworks/svelte-vite/src/preset.ts | 15 --------------- code/lib/cli/src/repro-templates.ts | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index 5b22b9bca2cb..e7834eed6af9 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -40,23 +40,8 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, options) = } } - removeSvelteKitPlugin(plugins); - return { ...config, plugins, }; }; - -const removeSvelteKitPlugin = (plugins: PluginOption[]) => { - plugins.forEach((plugin, index) => { - if (plugin && 'name' in plugin && plugin.name === 'vite-plugin-svelte-kit') { - // eslint-disable-next-line no-param-reassign -- we explicitly want to mutate the array as stated here: https://vitejs.dev/guide/api-plugin.html#config - plugins[index] = undefined; - } - if (Array.isArray(plugin)) { - // recursive, Vite plugins can be nested - removeSvelteKitPlugin(plugin); - } - }); -}; diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index 1116761f4f2c..84c98cb5de67 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -297,7 +297,8 @@ export default { ...vue2ViteTemplates, ...vue3ViteTemplates, ...svelteViteTemplates, - ...svelteKitTemplates, + // TODO: enable this when repo has been upgraded to node@16 + // ...svelteKitTemplates, ...angularCliTemplates, ...litViteTemplates, ...vueCliTemplates, From 26a2614336815e3ac961131e872fa7fd50de2049 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 13 Oct 2022 20:37:48 +0200 Subject: [PATCH 15/16] cleanup --- code/frameworks/svelte-vite/src/preset.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index e7834eed6af9..3cdef08b4030 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -1,5 +1,4 @@ import type { StorybookConfig } from '@storybook/builder-vite'; -import { PluginOption } from 'vite'; import { hasPlugin } from './utils'; import { svelteDocgen } from './plugins/svelte-docgen'; From da547d447025036c932386da26b94053a452e1d3 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 13 Oct 2022 21:11:36 +0200 Subject: [PATCH 16/16] ensure no unused --- code/lib/cli/src/repro-templates.ts | 49 +++++++++++++++-------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index 84c98cb5de67..610985dc3e0e 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -175,31 +175,32 @@ const angularCliTemplates = { }, }; +// TODO: enable this when repo has been upgraded to node@16 // SvelteKit only supports Node.js >16.x, so before generating these repros you need to switch to that version -const svelteKitTemplates = { - 'svelte-kit/skeleton-js': { - name: 'Svelte Kit (JS)', - script: - 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright', - cadence: ['ci', 'daily', 'weekly'], - expected: { - framework: '@storybook/svelte-vite', - renderer: '@storybook/svelte', - builder: '@storybook/builder-vite', - }, - }, - 'svelte-kit/skeleton-ts': { - name: 'Svelte Kit (TS)', - script: - 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright', - cadence: ['ci', 'daily', 'weekly'], - expected: { - framework: '@storybook/svelte-vite', - renderer: '@storybook/svelte', - builder: '@storybook/builder-vite', - }, - }, -}; +// const svelteKitTemplates = { +// 'svelte-kit/skeleton-js': { +// name: 'Svelte Kit (JS)', +// script: +// 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright', +// cadence: ['ci', 'daily', 'weekly'], +// expected: { +// framework: '@storybook/svelte-vite', +// renderer: '@storybook/svelte', +// builder: '@storybook/builder-vite', +// }, +// }, +// 'svelte-kit/skeleton-ts': { +// name: 'Svelte Kit (TS)', +// script: +// 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright', +// cadence: ['ci', 'daily', 'weekly'], +// expected: { +// framework: '@storybook/svelte-vite', +// renderer: '@storybook/svelte', +// builder: '@storybook/builder-vite', +// }, +// }, +// }; const litViteTemplates = { 'lit-vite/default-js': {