Skip to content

Commit

Permalink
Merge pull request #22905 from storybookjs/svelte-4
Browse files Browse the repository at this point in the history
Svelte: Support v4
(cherry picked from commit 96b838b)
  • Loading branch information
JReinhold authored and shilman committed Jun 27, 2023
1 parent 3b9f187 commit 8ae1fd2
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { global } from '@storybook/global';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - types are removed in Svelte 4 but it still works. ts-ignore is safer than ts-expect-error because it's not an error in Svelte 3
// eslint-disable-next-line import/no-unresolved
import { set_current_component } from 'svelte/internal';

const { document } = global;
Expand Down
9 changes: 4 additions & 5 deletions code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@
"@storybook/builder-vite": "7.0.24",
"@storybook/node-logger": "7.0.24",
"@storybook/svelte": "7.0.24",
"@sveltejs/vite-plugin-svelte": "^2.0.0",
"magic-string": "^0.27.0",
"svelte": "^3.0.0",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"magic-string": "^0.30.0",
"sveltedoc-parser": "^4.2.1",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
"@types/node": "^16.0.0",
"svelte": "^4.0.0",
"typescript": "~4.9.3",
"vite": "^4.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"svelte": "^3.0.0 || ^4.0.0",
"vite": "^3.0.0 || ^4.0.0"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"vite": "^4.0.0"
},
"peerDependencies": {
"svelte": "^3.0.0 || ^4.0.0",
"vite": "^4.0.0"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions code/renderers/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
},
"devDependencies": {
"expect-type": "^0.14.2",
"svelte": "^3.31.2",
"svelte-check": "^2.9.2",
"svelte": "^4.0.0",
"svelte-check": "^3.4.3",
"typescript": "~4.9.3"
},
"peerDependencies": {
"svelte": "^3.1.0"
"svelte": "^3.1.0 || ^4.0.0"
},
"engines": {
"node": ">=16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/svelte/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ProjectAnnotations,
} from '@storybook/types';

import type { ComponentProps, ComponentType, SvelteComponentTyped } from 'svelte';
import type { ComponentType, ComponentProps, SvelteComponentTyped } from 'svelte';
import type { SetOptional, Simplify } from 'type-fest';
import type { SvelteRenderer } from './types';

Expand Down

0 comments on commit 8ae1fd2

Please sign in to comment.