@storybook/sveltekit 7.0.0-beta.5 → 7.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Check out our [Frameworks API](https://storybook.js.org/blog/framework-api/) ann
|
|
|
13
13
|
- [In a project with Storybook](#in-a-project-with-storybook)
|
|
14
14
|
- [Automatic migration](#automatic-migration)
|
|
15
15
|
- [Manual migration](#manual-migration)
|
|
16
|
+
- [Troubleshooting](#troubleshooting)
|
|
17
|
+
- [Error: `ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared` when starting Storybook](#error-err-syntaxerror-identifier-__esbuild_register_import_meta_url__-has-already-been-declared-when-starting-storybook)
|
|
16
18
|
- [Acknowledgements](#acknowledgements)
|
|
17
19
|
|
|
18
20
|
## Supported features
|
|
@@ -25,8 +27,8 @@ However SvelteKit has some [Kit-specific modules](https://kit.svelte.dev/docs/mo
|
|
|
25
27
|
| [`$app/environment`](https://kit.svelte.dev/docs/modules#$app-environment) | 🔜 Coming in 7.0 |
|
|
26
28
|
| [`$app/forms`](https://kit.svelte.dev/docs/modules#$app-forms) | ⏳ Planned for 7.1 |
|
|
27
29
|
| [`$app/navigation`](https://kit.svelte.dev/docs/modules#$app-navigation) | ⏳ Planned for 7.1. With mocks so the Actions addon will display when the hooks are being called. |
|
|
28
|
-
| [`$app/paths`](https://kit.svelte.dev/docs/modules#$app-paths) |
|
|
29
|
-
| [`$app/stores`](https://kit.svelte.dev/docs/modules#$app-stores) |
|
|
30
|
+
| [`$app/paths`](https://kit.svelte.dev/docs/modules#$app-paths) | ⏳ Planned for 7.1 |
|
|
31
|
+
| [`$app/stores`](https://kit.svelte.dev/docs/modules#$app-stores) | 🔜 Coming in 7.0. Mocks are planned for 7.1 so you can set different store values per story. |
|
|
30
32
|
| [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. |
|
|
31
33
|
| [`$env/dynamic/public`](https://kit.svelte.dev/docs/modules#$env-dynamic-public) | 🔜 Coming in 7.0 |
|
|
32
34
|
| [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. |
|
|
@@ -35,7 +37,7 @@ However SvelteKit has some [Kit-specific modules](https://kit.svelte.dev/docs/mo
|
|
|
35
37
|
| [`$service-worker`](https://kit.svelte.dev/docs/modules#$service-worker) | ⛔ Not supported. They are only meant to be used in service workers |
|
|
36
38
|
| [`@sveltejs/kit/*`](https://kit.svelte.dev/docs/modules#sveltejs-kit) | ✅ Supported |
|
|
37
39
|
|
|
38
|
-
This is just the beginning. We're planning on making it an even better experience to [build](https://storybook.js.org/docs/7.0/react/writing-stories/introduction), [test](https://storybook.js.org/docs/7.0/react/writing-tests/introduction) and [document](https://storybook.js.org/docs/7.0/react/writing-docs/introduction) all the SvelteKit goodies like [pages](https://kit.svelte.dev/docs/routing), [forms](https://kit.svelte.dev/docs/form-actions) and [layouts](https://kit.svelte.dev/docs/routing#layout) in Storybook, while still integrating with all the addons and workflows you know and love.
|
|
40
|
+
This is just the beginning. We're close to adding basic support for many of the SvelteKit features. Longer term we're planning on making it an even better experience to [build](https://storybook.js.org/docs/7.0/react/writing-stories/introduction), [test](https://storybook.js.org/docs/7.0/react/writing-tests/introduction) and [document](https://storybook.js.org/docs/7.0/react/writing-docs/introduction) all the SvelteKit goodies like [pages](https://kit.svelte.dev/docs/routing), [forms](https://kit.svelte.dev/docs/form-actions) and [layouts](https://kit.svelte.dev/docs/routing#layout) in Storybook, while still integrating with all the addons and workflows you know and love.
|
|
39
41
|
|
|
40
42
|
## Requirements
|
|
41
43
|
|
|
@@ -66,6 +68,8 @@ npx storybook@next upgrade --prerelease
|
|
|
66
68
|
|
|
67
69
|
When running the `upgrade` command above you should get a prompt asking you to migrate to `@storybook/sveltekit`, which should handle everything for you. In some cases it can't migrate for you, eg. if your existing Storybook setup is based on Webpack. In such cases, refer to the manual migration below.
|
|
68
70
|
|
|
71
|
+
Storybook 7.0 automatically loads your Vite config, and by extension your Svelte config. If you have a `svelteOptions` property in `.storybook/main.cjs` you need to remove that. See [Troubleshooting](#error-about-__esbuild_register_import_meta_url__-when-starting-storybook) below. We're working on doing this automatically soon.
|
|
72
|
+
|
|
69
73
|
#### Manual migration
|
|
70
74
|
|
|
71
75
|
Install the framework:
|
|
@@ -84,7 +88,7 @@ module.exports = {
|
|
|
84
88
|
};
|
|
85
89
|
```
|
|
86
90
|
|
|
87
|
-
Storybook 7.0 automatically loads your Vite config, and by extension your Svelte config. If you have a `svelteOptions` property in
|
|
91
|
+
Storybook 7.0 automatically loads your Vite config, and by extension your Svelte config. If you have a `svelteOptions` property in `.storybook/main.cjs` you need to remove that. See [Troubleshooting](#error-about-__esbuild_register_import_meta_url__-when-starting-storybook) below.
|
|
88
92
|
|
|
89
93
|
Remove any redundant dependencies, if you have them:
|
|
90
94
|
|
|
@@ -95,6 +99,18 @@ yarn remove storybook-builder-vite
|
|
|
95
99
|
yarn remove @storybook/builder-vite
|
|
96
100
|
```
|
|
97
101
|
|
|
102
|
+
## Troubleshooting
|
|
103
|
+
|
|
104
|
+
### Error: `ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared` when starting Storybook
|
|
105
|
+
|
|
106
|
+
> When starting Storybook after upgrading to v7.0, it breaks with the following error:
|
|
107
|
+
>
|
|
108
|
+
> ```
|
|
109
|
+
> ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared
|
|
110
|
+
> ```
|
|
111
|
+
|
|
112
|
+
You'll get this error when upgrading from 6.5 to 7.0. You need to remove the `svelteOptions` property in `.storybook/main.cjs`, as that is not supported by Storybook 7.0 + SvelteKit. The property is also not necessary anymore because the Vite and Svelte configurations are loaded automatically in Storybook 7.0.
|
|
113
|
+
|
|
98
114
|
## Acknowledgements
|
|
99
115
|
|
|
100
116
|
Integrating with SvelteKit would not have been possible if it weren't for the fantastic efforts by the Svelte core team - especially [Ben McCann](https://twitter.com/benjaminmccann) - to make integrations with the wider ecosystem possible.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/sveltekit",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.7",
|
|
4
4
|
"description": "Storybook for SvelteKit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/builder-vite": "7.0.0-beta.
|
|
55
|
-
"@storybook/svelte": "7.0.0-beta.
|
|
56
|
-
"@storybook/svelte-vite": "7.0.0-beta.
|
|
54
|
+
"@storybook/builder-vite": "7.0.0-beta.7",
|
|
55
|
+
"@storybook/svelte": "7.0.0-beta.7",
|
|
56
|
+
"@storybook/svelte-vite": "7.0.0-beta.7"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^16.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
],
|
|
81
81
|
"platform": "node"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "e16a8c685e22121683ac00b1bc53dbf5aa587f88"
|
|
84
84
|
}
|