Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite/Svelte: Remove addon-svelte-csf dep #20280

Merged
merged 5 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addon-svelte-csf": "^2.0.0",
"@storybook/builder-vite": "7.0.0-beta.10",
"@storybook/node-logger": "7.0.0-beta.10",
"@storybook/svelte": "7.0.0-beta.10",
Expand All @@ -67,15 +66,9 @@
"typescript": "~4.9.3"
},
"peerDependencies": {
"@storybook/addon-svelte-csf": "^2.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"@storybook/addon-svelte-csf": {
"optional": true
}
},
"engines": {
"node": "^14.18 || >=16"
},
Expand Down
64 changes: 0 additions & 64 deletions code/frameworks/svelte-vite/src/plugins/csf-plugin.ts

This file was deleted.

13 changes: 0 additions & 13 deletions code/frameworks/svelte-vite/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ export const viteFinal: NonNullable<StorybookConfig['viteFinal']> = async (confi

await handleSvelteKit(plugins, options);

// TODO: temporary until/unless https://github.com/storybookjs/addon-svelte-csf/issues/64 is fixed
// Wrapping in try-catch in case `@storybook/addon-svelte-csf is not installed
try {
const { default: svelteCsfPlugin } = await import('./plugins/csf-plugin');
plugins.push(svelteCsfPlugin(svelteConfig));
} catch (err) {
// Not all projects use `.stories.svelte` for stories, and by default 6.5+ does not auto-install @storybook/addon-svelte-csf.
// If it's any other kind of error, re-throw.
if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') {
throw err;
}
}

return {
...config,
plugins,
Expand Down
8 changes: 0 additions & 8 deletions code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@
"@types/node": "^16.0.0",
"typescript": "^4.9.3"
},
"peerDependencies": {
"@storybook/addon-svelte-csf": "^2.0.0"
},
"peerDependenciesMeta": {
"@storybook/addon-svelte-csf": {
"optional": true
}
},
"engines": {
"node": "^14.18 || >=16"
},
Expand Down
18 changes: 0 additions & 18 deletions code/lib/builder-vite/src/declarations/extract-stories.d.ts

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5737,22 +5737,6 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/addon-svelte-csf@npm:^2.0.0":
version: 2.0.10
resolution: "@storybook/addon-svelte-csf@npm:2.0.10"
dependencies:
ts-dedent: ^2.0.0
peerDependencies:
"@storybook/svelte": ">=6.4.20"
svelte: ^3.46.6
svelte-loader: ^3.1.2
peerDependenciesMeta:
svelte-loader:
optional: true
checksum: fc128896f0d7416fd671d7e392a11ced20f150dbddbac39a2e9f9948145409fdba1380d800a40ffc663a664829e01cffa71d2ec1ec4845c18f804117025a9d85
languageName: node
linkType: hard

"@storybook/[email protected], @storybook/addon-toolbars@workspace:*, @storybook/addon-toolbars@workspace:addons/toolbars":
version: 0.0.0-use.local
resolution: "@storybook/addon-toolbars@workspace:addons/toolbars"
Expand Down Expand Up @@ -7566,7 +7550,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/svelte-vite@workspace:frameworks/svelte-vite"
dependencies:
"@storybook/addon-svelte-csf": ^2.0.0
"@storybook/builder-vite": 7.0.0-beta.10
"@storybook/node-logger": 7.0.0-beta.10
"@storybook/svelte": 7.0.0-beta.10
Expand All @@ -7579,12 +7562,8 @@ __metadata:
typescript: ~4.9.3
vite: ^3.0.0
peerDependencies:
"@storybook/addon-svelte-csf": ^2.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
peerDependenciesMeta:
"@storybook/addon-svelte-csf":
optional: true
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -7639,11 +7618,6 @@ __metadata:
"@storybook/svelte-vite": 7.0.0-beta.10
"@types/node": ^16.0.0
typescript: ^4.9.3
peerDependencies:
"@storybook/addon-svelte-csf": ^2.0.0
peerDependenciesMeta:
"@storybook/addon-svelte-csf":
optional: true
languageName: unknown
linkType: soft

Expand Down