From 06ef039e61b7a30472e3fd9a053a24a17f5dc426 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 7 Dec 2022 21:59:06 +0100 Subject: [PATCH 1/4] require Storybook 7.0.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a44b643..79f563c 100644 --- a/package.json +++ b/package.json @@ -76,8 +76,8 @@ "vite": "^3.1.4" }, "peerDependencies": { - "@storybook/svelte": ">=6.4.20", - "@storybook/theming": ">=6.4.20", + "@storybook/svelte": ">=7.0.0", + "@storybook/theming": ">=7.0.0", "@sveltejs/vite-plugin-svelte": "^1.0.0", "svelte": "^3.50.0", "svelte-loader": "^3.1.2", From ceeb84398aa9541cae892447367e2717f7dc52e9 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 7 Dec 2022 22:21:36 +0100 Subject: [PATCH 2/4] add note about version support in README --- README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40f9ec7..2c43d8c 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,24 @@ It supports: # Getting Started -1. Add '@storybook/addon-svelte-csf' to your dev dependencies -2. In `.storybook/main.js`, add `*.stories.svelte` to the stories patterns -3. In `.storybook/main.js`, add `@storybook/addon-svelte-csf` to the addons array +1. `npm install --save-dev @storybook/addon-svelte-csf` or `yarn add --dev @storybook/addon-svelte-csf` +2. In `.storybook/main.js`, add `@storybook/addon-svelte-csf` to the addons array +3. In `.storybook/main.js`, add `*.stories.svelte` to the stories patterns + +An example `main.js` configuration could look like this: + +```js +module.exports = { + stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'], + addons: [ + '@storybook/addon-links', + '@storybook/addon-essentials', + '@storybook/addon-interactions', + '@storybook/addon-svelte-csf', + ], + framework: '@storybook/svelte-vite', +}; +``` + +> **Warning** +> v3 and above of this addon requires at least Storybook v7. If you're using Storybook between v6.4.20 and v7.0.0, you should instead use v2 of this addon with `npm install --save-dev @storybook/addon-svelte-csf@^2.0.10` or `yarn add --dev @storybook/addon-svelte-csf@^2.0.10` From 4ea79423d8dfa0c4f2790c66fd0cb1c5f9f12eab Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 14 Dec 2022 22:40:45 +0100 Subject: [PATCH 3/4] change deps to ^7.0.0-beta --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 79f563c..afda472 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "vite": "^3.1.4" }, "peerDependencies": { - "@storybook/svelte": ">=7.0.0", - "@storybook/theming": ">=7.0.0", - "@sveltejs/vite-plugin-svelte": "^1.0.0", + "@storybook/svelte": "^7.0.0-beta", + "@storybook/theming": "^7.0.0-beta", + "@sveltejs/vite-plugin-svelte": "^1.0.0 || ^2.0.0", "svelte": "^3.50.0", "svelte-loader": "^3.1.2", "vite": ">=3.0.0" From 9c0f315f81d686f915a481858b87c35580de73ec Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 14 Dec 2022 23:46:59 +0100 Subject: [PATCH 4/4] allow Vite 4 for SvelteKit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afda472..4d0b110 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@sveltejs/vite-plugin-svelte": "^1.0.0 || ^2.0.0", "svelte": "^3.50.0", "svelte-loader": "^3.1.2", - "vite": ">=3.0.0" + "vite": "^3.0.0 || ^4.0.0" }, "peerDependenciesMeta": { "@sveltejs/vite-plugin-svelte": {