From 3c64ccb52e1bf9586510047857ecfcb213256a9e Mon Sep 17 00:00:00 2001 From: Ian Mungai Date: Wed, 14 Dec 2022 16:26:19 +0300 Subject: [PATCH 1/2] fix: storybook --- starters/svelte-kit-scss/.storybook/main.cjs | 42 +++++++------------ .../.storybook/preview-head.html | 2 +- .../svelte-kit-scss/.storybook/preview.js | 9 ++++ starters/svelte-kit-scss/package.json | 30 ++++++------- 4 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 starters/svelte-kit-scss/.storybook/preview.js diff --git a/starters/svelte-kit-scss/.storybook/main.cjs b/starters/svelte-kit-scss/.storybook/main.cjs index b5fa0ddd5..6f339b7d3 100644 --- a/starters/svelte-kit-scss/.storybook/main.cjs +++ b/starters/svelte-kit-scss/.storybook/main.cjs @@ -1,31 +1,19 @@ -const sveltePreprocess = require('svelte-preprocess'); -const { mergeConfig } = require('vite'); const path = require('path'); - module.exports = { - stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - '@storybook/addon-interactions', - '@storybook/addon-svelte-csf', - '@storybook/preset-scss', + "stories": [ + "../src/**/*.mdx", + "../src/**/*.stories.@(js|jsx|ts|tsx)" ], - framework: '@storybook/svelte', - core: { - builder: '@storybook/builder-vite', - }, - svelteOptions: { - preprocess: sveltePreprocess({ typescript: true, scss: true }), - }, - features: { - storyStoreV7: true, - }, - async viteFinal(config) { - return mergeConfig(config, { - resolve: { - alias: { $lib: path.resolve(__dirname, '../src/lib') }, - }, - }); + "addons": [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@storybook/addon-interactions" + ], + "framework": { + "name": "@storybook/sveltekit", + "options": {} }, -}; + "docs": { + "docsPage": true + } +} \ No newline at end of file diff --git a/starters/svelte-kit-scss/.storybook/preview-head.html b/starters/svelte-kit-scss/.storybook/preview-head.html index e55104010..05da1e9df 100644 --- a/starters/svelte-kit-scss/.storybook/preview-head.html +++ b/starters/svelte-kit-scss/.storybook/preview-head.html @@ -1,3 +1,3 @@ + \ No newline at end of file diff --git a/starters/svelte-kit-scss/.storybook/preview.js b/starters/svelte-kit-scss/.storybook/preview.js new file mode 100644 index 000000000..48afd568a --- /dev/null +++ b/starters/svelte-kit-scss/.storybook/preview.js @@ -0,0 +1,9 @@ +export const parameters = { + actions: { argTypesRegex: "^on[A-Z].*" }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, +} \ No newline at end of file diff --git a/starters/svelte-kit-scss/package.json b/starters/svelte-kit-scss/package.json index 48369db76..5f4e83d73 100644 --- a/starters/svelte-kit-scss/package.json +++ b/starters/svelte-kit-scss/package.json @@ -21,27 +21,25 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --plugin-search-dir . --check . && eslint .", "format": "prettier --plugin-search-dir . --write .", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" }, "devDependencies": { "@babel/core": "7.20.5", "@fontsource/fira-mono": "4.5.10", "@neoconfetti/svelte": "1.0.0", "@playwright/test": "1.28.1", - "@storybook/addon-actions": "6.5.14", - "@storybook/addon-essentials": "6.5.14", - "@storybook/addon-interactions": "6.5.14", - "@storybook/addon-links": "6.5.14", - "@storybook/addon-svelte-csf": "2.0.10", - "@storybook/builder-vite": "0.2.5", - "@storybook/preset-scss": "1.0.3", - "@storybook/svelte": "6.5.14", + "@storybook/addon-essentials": "7.0.0-beta.6", + "@storybook/addon-interactions": "7.0.0-beta.6", + "@storybook/addon-links": "7.0.0-beta.6", + "@storybook/blocks": "7.0.0-beta.6", + "@storybook/svelte": "7.0.0-beta.6", + "@storybook/sveltekit": "7.0.0-beta.6", "@storybook/testing-library": "0.0.13", "@sveltejs/adapter-auto": "1.0.0-next.90", "@sveltejs/kit": "1.0.0-next.572", - "@sveltejs/vite-plugin-svelte": "^1.4.0", - "@testing-library/jest-dom": "^5.16.5", + "@sveltejs/vite-plugin-svelte": "1.4.0", + "@testing-library/jest-dom": "5.16.5", "@testing-library/svelte": "3.2.2", "@types/cookie": "0.5.1", "@typescript-eslint/eslint-plugin": "5.45.1", @@ -52,11 +50,14 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-storybook": "0.6.8", "eslint-plugin-svelte3": "4.0.0", - "html-webpack-plugin": "^5.5.0", + "html-webpack-plugin": "5.5.0", "jsdom": "20.0.3", "prettier": "2.8.0", "prettier-plugin-svelte": "2.8.1", + "react": "18.2.0", + "react-dom": "18.2.0", "sass": "1.56.1", + "storybook": "7.0.0-beta.6", "svelte": "3.53.1", "svelte-check": "2.10.1", "svelte-loader": "3.1.4", @@ -66,5 +67,6 @@ "vite": "3.2.5", "vitest": "0.25.4" }, - "type": "module" + "type": "module", + "dependencies": {} } From b2b6e19cec1f836cc0c591a159bf4922309e48c1 Mon Sep 17 00:00:00 2001 From: Ian Mungai Date: Wed, 14 Dec 2022 19:26:06 +0300 Subject: [PATCH 2/2] fix: lock dep --- starters/svelte-kit-scss/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starters/svelte-kit-scss/package.json b/starters/svelte-kit-scss/package.json index 5f4e83d73..5024aa92a 100644 --- a/starters/svelte-kit-scss/package.json +++ b/starters/svelte-kit-scss/package.json @@ -47,7 +47,7 @@ "babel-loader": "9.1.0", "eslint": "8.29.0", "eslint-config-prettier": "8.5.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "4.2.1", "eslint-plugin-storybook": "0.6.8", "eslint-plugin-svelte3": "4.0.0", "html-webpack-plugin": "5.5.0",