mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
Merge branch 'next' into docs-addon-vitest
* next: Address feedback add link to docs for how to set feature flags. improve migration notes for globals project Fix typo ConfigFile: Fix `as const satisfies` modifiers Bump version from "8.3.0-alpha.11" to "8.3.0-beta.0" [skip ci] Update docs/versions/next.json Add description to empty 8.3.0-beta.0 release Write changelog for 8.3.0-beta.0 [skip ci] Bump version from "8.3.0-alpha.10" to "8.3.0-alpha.11" [skip ci] Write changelog for 8.3.0-alpha.11 [skip ci] Re-order sidebar Rename interaction test -> component test
This commit is contained in:
commit
99ffaccdf7
@ -1,3 +1,14 @@
|
||||
## 8.3.0-beta.0
|
||||
|
||||
Empty release identical to `v8.3.0-alpha.11`
|
||||
|
||||
## 8.3.0-alpha.11
|
||||
|
||||
- Addon Vitest: Fix tests potentially not existing in non-isolate mode - [#28993](https://github.com/storybookjs/storybook/pull/28993), thanks @yannbf!
|
||||
- Builder-Vite: Fix 'condition node never be used' warning - [#28989](https://github.com/storybookjs/storybook/pull/28989), thanks @valentinpalkovic!
|
||||
- CLI: Update spawn options in proxy.ts to support Windows - [#28990](https://github.com/storybookjs/storybook/pull/28990), thanks @valentinpalkovic!
|
||||
- Next.js-Vite: Update next and vite-plugin-storybook-nextjs dependencies - [#28994](https://github.com/storybookjs/storybook/pull/28994), thanks @valentinpalkovic!
|
||||
|
||||
## 8.3.0-alpha.10
|
||||
|
||||
- Addon Vitest: Fix postinstall file types - [#28978](https://github.com/storybookjs/storybook/pull/28978), thanks @shilman!
|
||||
|
16
MIGRATION.md
16
MIGRATION.md
@ -430,8 +430,12 @@ These APIs allowed addons to render arbitrary content in the Storybook sidebar.
|
||||
|
||||
> [!NOTE]
|
||||
> You need to set the feature flag `backgroundsStoryGlobals` to `true` in your `.storybook/main.ts` to use the new format and set the value with `globals`.
|
||||
>
|
||||
> See here how to set feature flags: https://storybook.js.org/docs/api/main-config/main-config-features
|
||||
|
||||
The `addon-backgrounds` addon now uses a new format for parameters. The `backgrounds` parameter is now an object with an `options` property that is assigned to an object of background values, where the key is used when setting the global value.
|
||||
The `addon-backgrounds` addon now uses a new format for configuring its list of selectable backgrounds.
|
||||
The `backgrounds` parameter is now an object with an `options` property.
|
||||
This `options` object is a key-value pair where the key is used when setting the global value, the value is an object with a `name` and `value` property.
|
||||
|
||||
```diff
|
||||
// .storybook/preview.js
|
||||
@ -472,8 +476,13 @@ This locks that story to the `twitter` background, it cannot be changed by the a
|
||||
|
||||
> [!NOTE]
|
||||
> You need to set the feature flag `viewportStoryGlobals` to `true` in your `.storybook/main.ts` to use the new format and set the value with `globals`.
|
||||
>
|
||||
> See here how to set feature flags: https://storybook.js.org/docs/api/main-config/main-config-features
|
||||
|
||||
The `addon-viewport` addon now uses a new format for parameters. The `viewport` parameter is now an object with an `options` property that is assigned to an object of viewport values, where the key is used when setting the global value.
|
||||
The `addon-viewport` addon now uses a new format for configuring its list of selectable viewports.
|
||||
The `viewport` parameter is now an object with an `options` property.
|
||||
This `options` object is a key-value pair where the key is used when setting the global value, the value is an object with a `name` and `styles` property.
|
||||
The `styles` property is an object with a `width` and a `height` property.
|
||||
|
||||
```diff
|
||||
// .storybook/preview.js
|
||||
@ -501,7 +510,8 @@ export const parameters = {
|
||||
};
|
||||
```
|
||||
|
||||
Setting an override value should now be done via a `globals` property on your component/meta or story itself. Also note the change from `defaultOrientation: "landscape"` to `isRotated: true`.
|
||||
Setting an override value should now be done via a `globals` property on your component/meta or story itself.
|
||||
Also note the change from `defaultOrientation: "landscape"` to `isRotated: true`.
|
||||
|
||||
```diff
|
||||
// Button.stories.ts
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-a11y",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Test component compliance with web accessibility standards",
|
||||
"keywords": [
|
||||
"a11y",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-actions",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Get UI feedback when an action is performed on an interactive element",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-backgrounds",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Switch backgrounds to view components in different settings",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-controls",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Interact with component inputs dynamically in the Storybook UI",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-docs",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Document component usage and properties in Markdown",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-essentials",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Curated addons to bring out the best of Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-mdx-gfm",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "GitHub Flavored Markdown in Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-highlight",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Highlight DOM nodes within your stories",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-interactions",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Automate, test and debug user interactions",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-jest",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "React storybook addon that show component jest report",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-links",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Link stories together to build demos and prototypes with your UI components",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-measure",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Inspect layouts by visualizing the box model",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-onboarding",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-outline",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Outline all elements with CSS to help with layout placement and alignment",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storysource",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "View a story’s source code to see how it works and paste into your app",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-themes",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Switch between multiple themes for you components in Storybook",
|
||||
"keywords": [
|
||||
"css",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-toolbars",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Create your own toolbar items that control story rendering",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-viewport",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
|
||||
"keywords": [
|
||||
"addon",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/experimental-addon-vitest",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Integrate Vitest with Storybook",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "A plugin to run and build Storybooks with Vite",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
|
||||
"bugs": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,87 +1,87 @@
|
||||
// auto generated file, do not edit
|
||||
export default {
|
||||
'@storybook/addon-a11y': '8.3.0-alpha.10',
|
||||
'@storybook/addon-actions': '8.3.0-alpha.10',
|
||||
'@storybook/addon-backgrounds': '8.3.0-alpha.10',
|
||||
'@storybook/addon-controls': '8.3.0-alpha.10',
|
||||
'@storybook/addon-docs': '8.3.0-alpha.10',
|
||||
'@storybook/addon-essentials': '8.3.0-alpha.10',
|
||||
'@storybook/addon-mdx-gfm': '8.3.0-alpha.10',
|
||||
'@storybook/addon-highlight': '8.3.0-alpha.10',
|
||||
'@storybook/addon-interactions': '8.3.0-alpha.10',
|
||||
'@storybook/addon-jest': '8.3.0-alpha.10',
|
||||
'@storybook/addon-links': '8.3.0-alpha.10',
|
||||
'@storybook/addon-measure': '8.3.0-alpha.10',
|
||||
'@storybook/addon-onboarding': '8.3.0-alpha.10',
|
||||
'@storybook/addon-outline': '8.3.0-alpha.10',
|
||||
'@storybook/addon-storysource': '8.3.0-alpha.10',
|
||||
'@storybook/addon-themes': '8.3.0-alpha.10',
|
||||
'@storybook/addon-toolbars': '8.3.0-alpha.10',
|
||||
'@storybook/addon-viewport': '8.3.0-alpha.10',
|
||||
'@storybook/experimental-addon-vitest': '8.3.0-alpha.10',
|
||||
'@storybook/builder-vite': '8.3.0-alpha.10',
|
||||
'@storybook/builder-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/core': '8.3.0-alpha.10',
|
||||
'@storybook/builder-manager': '8.3.0-alpha.10',
|
||||
'@storybook/channels': '8.3.0-alpha.10',
|
||||
'@storybook/client-logger': '8.3.0-alpha.10',
|
||||
'@storybook/components': '8.3.0-alpha.10',
|
||||
'@storybook/core-common': '8.3.0-alpha.10',
|
||||
'@storybook/core-events': '8.3.0-alpha.10',
|
||||
'@storybook/core-server': '8.3.0-alpha.10',
|
||||
'@storybook/csf-tools': '8.3.0-alpha.10',
|
||||
'@storybook/docs-tools': '8.3.0-alpha.10',
|
||||
'@storybook/manager': '8.3.0-alpha.10',
|
||||
'@storybook/manager-api': '8.3.0-alpha.10',
|
||||
'@storybook/node-logger': '8.3.0-alpha.10',
|
||||
'@storybook/preview': '8.3.0-alpha.10',
|
||||
'@storybook/preview-api': '8.3.0-alpha.10',
|
||||
'@storybook/router': '8.3.0-alpha.10',
|
||||
'@storybook/telemetry': '8.3.0-alpha.10',
|
||||
'@storybook/theming': '8.3.0-alpha.10',
|
||||
'@storybook/types': '8.3.0-alpha.10',
|
||||
'@storybook/angular': '8.3.0-alpha.10',
|
||||
'@storybook/ember': '8.3.0-alpha.10',
|
||||
'@storybook/experimental-nextjs-vite': '8.3.0-alpha.10',
|
||||
'@storybook/html-vite': '8.3.0-alpha.10',
|
||||
'@storybook/html-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/nextjs': '8.3.0-alpha.10',
|
||||
'@storybook/preact-vite': '8.3.0-alpha.10',
|
||||
'@storybook/preact-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/react-vite': '8.3.0-alpha.10',
|
||||
'@storybook/react-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/server-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/svelte-vite': '8.3.0-alpha.10',
|
||||
'@storybook/svelte-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/sveltekit': '8.3.0-alpha.10',
|
||||
'@storybook/vue3-vite': '8.3.0-alpha.10',
|
||||
'@storybook/vue3-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/web-components-vite': '8.3.0-alpha.10',
|
||||
'@storybook/web-components-webpack5': '8.3.0-alpha.10',
|
||||
'@storybook/blocks': '8.3.0-alpha.10',
|
||||
storybook: '8.3.0-alpha.10',
|
||||
sb: '8.3.0-alpha.10',
|
||||
'@storybook/cli': '8.3.0-alpha.10',
|
||||
'@storybook/codemod': '8.3.0-alpha.10',
|
||||
'@storybook/core-webpack': '8.3.0-alpha.10',
|
||||
'create-storybook': '8.3.0-alpha.10',
|
||||
'@storybook/csf-plugin': '8.3.0-alpha.10',
|
||||
'@storybook/instrumenter': '8.3.0-alpha.10',
|
||||
'@storybook/react-dom-shim': '8.3.0-alpha.10',
|
||||
'@storybook/source-loader': '8.3.0-alpha.10',
|
||||
'@storybook/test': '8.3.0-alpha.10',
|
||||
'@storybook/preset-create-react-app': '8.3.0-alpha.10',
|
||||
'@storybook/preset-html-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/preset-preact-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/preset-react-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/preset-server-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/preset-svelte-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/preset-vue3-webpack': '8.3.0-alpha.10',
|
||||
'@storybook/html': '8.3.0-alpha.10',
|
||||
'@storybook/preact': '8.3.0-alpha.10',
|
||||
'@storybook/react': '8.3.0-alpha.10',
|
||||
'@storybook/server': '8.3.0-alpha.10',
|
||||
'@storybook/svelte': '8.3.0-alpha.10',
|
||||
'@storybook/vue3': '8.3.0-alpha.10',
|
||||
'@storybook/web-components': '8.3.0-alpha.10',
|
||||
'@storybook/addon-a11y': '8.3.0-beta.0',
|
||||
'@storybook/addon-actions': '8.3.0-beta.0',
|
||||
'@storybook/addon-backgrounds': '8.3.0-beta.0',
|
||||
'@storybook/addon-controls': '8.3.0-beta.0',
|
||||
'@storybook/addon-docs': '8.3.0-beta.0',
|
||||
'@storybook/addon-essentials': '8.3.0-beta.0',
|
||||
'@storybook/addon-mdx-gfm': '8.3.0-beta.0',
|
||||
'@storybook/addon-highlight': '8.3.0-beta.0',
|
||||
'@storybook/addon-interactions': '8.3.0-beta.0',
|
||||
'@storybook/addon-jest': '8.3.0-beta.0',
|
||||
'@storybook/addon-links': '8.3.0-beta.0',
|
||||
'@storybook/addon-measure': '8.3.0-beta.0',
|
||||
'@storybook/addon-onboarding': '8.3.0-beta.0',
|
||||
'@storybook/addon-outline': '8.3.0-beta.0',
|
||||
'@storybook/addon-storysource': '8.3.0-beta.0',
|
||||
'@storybook/addon-themes': '8.3.0-beta.0',
|
||||
'@storybook/addon-toolbars': '8.3.0-beta.0',
|
||||
'@storybook/addon-viewport': '8.3.0-beta.0',
|
||||
'@storybook/experimental-addon-vitest': '8.3.0-beta.0',
|
||||
'@storybook/builder-vite': '8.3.0-beta.0',
|
||||
'@storybook/builder-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/core': '8.3.0-beta.0',
|
||||
'@storybook/builder-manager': '8.3.0-beta.0',
|
||||
'@storybook/channels': '8.3.0-beta.0',
|
||||
'@storybook/client-logger': '8.3.0-beta.0',
|
||||
'@storybook/components': '8.3.0-beta.0',
|
||||
'@storybook/core-common': '8.3.0-beta.0',
|
||||
'@storybook/core-events': '8.3.0-beta.0',
|
||||
'@storybook/core-server': '8.3.0-beta.0',
|
||||
'@storybook/csf-tools': '8.3.0-beta.0',
|
||||
'@storybook/docs-tools': '8.3.0-beta.0',
|
||||
'@storybook/manager': '8.3.0-beta.0',
|
||||
'@storybook/manager-api': '8.3.0-beta.0',
|
||||
'@storybook/node-logger': '8.3.0-beta.0',
|
||||
'@storybook/preview': '8.3.0-beta.0',
|
||||
'@storybook/preview-api': '8.3.0-beta.0',
|
||||
'@storybook/router': '8.3.0-beta.0',
|
||||
'@storybook/telemetry': '8.3.0-beta.0',
|
||||
'@storybook/theming': '8.3.0-beta.0',
|
||||
'@storybook/types': '8.3.0-beta.0',
|
||||
'@storybook/angular': '8.3.0-beta.0',
|
||||
'@storybook/ember': '8.3.0-beta.0',
|
||||
'@storybook/experimental-nextjs-vite': '8.3.0-beta.0',
|
||||
'@storybook/html-vite': '8.3.0-beta.0',
|
||||
'@storybook/html-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/nextjs': '8.3.0-beta.0',
|
||||
'@storybook/preact-vite': '8.3.0-beta.0',
|
||||
'@storybook/preact-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/react-vite': '8.3.0-beta.0',
|
||||
'@storybook/react-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/server-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/svelte-vite': '8.3.0-beta.0',
|
||||
'@storybook/svelte-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/sveltekit': '8.3.0-beta.0',
|
||||
'@storybook/vue3-vite': '8.3.0-beta.0',
|
||||
'@storybook/vue3-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/web-components-vite': '8.3.0-beta.0',
|
||||
'@storybook/web-components-webpack5': '8.3.0-beta.0',
|
||||
'@storybook/blocks': '8.3.0-beta.0',
|
||||
storybook: '8.3.0-beta.0',
|
||||
sb: '8.3.0-beta.0',
|
||||
'@storybook/cli': '8.3.0-beta.0',
|
||||
'@storybook/codemod': '8.3.0-beta.0',
|
||||
'@storybook/core-webpack': '8.3.0-beta.0',
|
||||
'create-storybook': '8.3.0-beta.0',
|
||||
'@storybook/csf-plugin': '8.3.0-beta.0',
|
||||
'@storybook/instrumenter': '8.3.0-beta.0',
|
||||
'@storybook/react-dom-shim': '8.3.0-beta.0',
|
||||
'@storybook/source-loader': '8.3.0-beta.0',
|
||||
'@storybook/test': '8.3.0-beta.0',
|
||||
'@storybook/preset-create-react-app': '8.3.0-beta.0',
|
||||
'@storybook/preset-html-webpack': '8.3.0-beta.0',
|
||||
'@storybook/preset-preact-webpack': '8.3.0-beta.0',
|
||||
'@storybook/preset-react-webpack': '8.3.0-beta.0',
|
||||
'@storybook/preset-server-webpack': '8.3.0-beta.0',
|
||||
'@storybook/preset-svelte-webpack': '8.3.0-beta.0',
|
||||
'@storybook/preset-vue3-webpack': '8.3.0-beta.0',
|
||||
'@storybook/html': '8.3.0-beta.0',
|
||||
'@storybook/preact': '8.3.0-beta.0',
|
||||
'@storybook/react': '8.3.0-beta.0',
|
||||
'@storybook/server': '8.3.0-beta.0',
|
||||
'@storybook/svelte': '8.3.0-beta.0',
|
||||
'@storybook/vue3': '8.3.0-beta.0',
|
||||
'@storybook/web-components': '8.3.0-beta.0',
|
||||
};
|
||||
|
@ -795,6 +795,26 @@ describe('ConfigFile', () => {
|
||||
export default preview;
|
||||
`);
|
||||
});
|
||||
|
||||
it('root globals as const satisfies as variable', () => {
|
||||
expect(
|
||||
removeField(
|
||||
['globals'],
|
||||
dedent`
|
||||
const preview = {
|
||||
globals: { a: 1 },
|
||||
bar: { a: 1 }
|
||||
} as const satisfies Foo;
|
||||
export default preview;
|
||||
`
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
const preview = {
|
||||
bar: { a: 1 }
|
||||
} as const satisfies Foo;
|
||||
export default preview;
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('quotes', () => {
|
||||
|
@ -51,6 +51,13 @@ const propKey = (p: t.ObjectProperty) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
const unwrap = (node: t.Node | undefined | null): any => {
|
||||
if (t.isTSAsExpression(node) || t.isTSSatisfiesExpression(node)) {
|
||||
return unwrap(node.expression);
|
||||
}
|
||||
return node;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const _getPath = (path: string[], node: t.Node): t.Node | undefined => {
|
||||
if (path.length === 0) {
|
||||
@ -191,9 +198,7 @@ export class ConfigFile {
|
||||
? _findVarInitialization(node.declaration.name, parent)
|
||||
: node.declaration;
|
||||
|
||||
if (t.isTSAsExpression(decl) || t.isTSSatisfiesExpression(decl)) {
|
||||
decl = decl.expression;
|
||||
}
|
||||
decl = unwrap(decl);
|
||||
|
||||
if (t.isObjectExpression(decl)) {
|
||||
self._exportsObject = decl;
|
||||
@ -275,9 +280,7 @@ export class ConfigFile {
|
||||
exportObject = _findVarInitialization(right.name, parent as t.Program) as any;
|
||||
}
|
||||
|
||||
if (t.isTSAsExpression(exportObject) || t.isTSSatisfiesExpression(exportObject)) {
|
||||
exportObject = exportObject.expression;
|
||||
}
|
||||
exportObject = unwrap(exportObject);
|
||||
|
||||
if (t.isObjectExpression(exportObject)) {
|
||||
self._exportsObject = exportObject;
|
||||
@ -517,9 +520,8 @@ export class ConfigFile {
|
||||
if (t.isIdentifier(decl)) {
|
||||
decl = _findVarInitialization(decl.name, this._ast.program);
|
||||
}
|
||||
if (t.isTSAsExpression(decl) || t.isTSSatisfiesExpression(decl)) {
|
||||
decl = decl.expression;
|
||||
}
|
||||
|
||||
decl = unwrap(decl);
|
||||
if (t.isObjectExpression(decl)) {
|
||||
const properties = decl.properties as t.ObjectProperty[];
|
||||
removeProperty(properties, path[0]);
|
||||
|
@ -1 +1 @@
|
||||
export const version = '8.3.0-alpha.10';
|
||||
export const version = '8.3.0-beta.0';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-manager",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook manager builder",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channels",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-logger",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/components",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook Components",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-common",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-events",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Event names used in storybook core",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-server",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/csf-tools",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Parse and manipulate CSF and Storybook config files",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/docs-tools",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Shared utility functions for frameworks to implement docs",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/manager-api",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook Manager API & Context",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/manager",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook UI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/node-logger",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preview-api",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preview",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/router",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook Router",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/telemetry",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Telemetry logging for crash reports and usage statistics",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/theming",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook Components",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/types",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Core Storybook TS Types",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/angular",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/ember",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember",
|
||||
"bugs": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/experimental-nextjs-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Next.js and Vite",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/nextjs",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Next.js",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/server-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/sveltekit",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for SvelteKit",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-vite",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-webpack5",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"lit",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/blocks",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Doc Blocks",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sb",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/cli",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "storybook",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook's CLI - install, dev, build, upgrade, and more",
|
||||
"keywords": [
|
||||
"cli",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/codemod",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "A collection of codemod scripts written with JSCodeshift",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-storybook",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Initialize Storybook into your project",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/create-storybook",
|
||||
"bugs": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/csf-plugin",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Enrich CSF files via static analysis",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/instrumenter",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-dom-shim",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/source-loader",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Source loader",
|
||||
"keywords": [
|
||||
"lib",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/test",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/root",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"private": true,
|
||||
"description": "Storybook root",
|
||||
"homepage": "https://storybook.js.org/",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-create-react-app",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Create React App preset",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-html-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-preact-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-react-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-server-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-svelte-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preset-vue3-webpack",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook HTML renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Preact renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook React renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/server",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Server renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Svelte renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook Vue 3 renderer",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components",
|
||||
"version": "8.3.0-alpha.10",
|
||||
"version": "8.3.0-beta.0",
|
||||
"description": "Storybook web-components renderer",
|
||||
"keywords": [
|
||||
"lit",
|
||||
|
@ -79,7 +79,7 @@ Because all stories render simultaneously in docs entries, play functions can pe
|
||||
However, if you know your play function is “safe” to run in docs, you can use this prop to run it automatically.
|
||||
|
||||
<Callout variant="info">
|
||||
If a story uses [`mount` in its play function](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered), it will not render in docs unless `autoplay` is set to `true`.
|
||||
If a story uses [`mount` in its play function](../../writing-tests/component-testing.mdx#run-code-before-the-component-gets-rendered), it will not render in docs unless `autoplay` is set to `true`.
|
||||
</Callout>
|
||||
|
||||
### `height`
|
||||
|
@ -168,7 +168,7 @@ sidebar:
|
||||
These are the configurations needed in the setup file:
|
||||
- preview annotations: those defined in `.storybook/preview.ts`
|
||||
- addon annotations (optional): those exported by addons
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/interaction-testing.mdx#beforeall))
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/component-testing.mdx#beforeall))
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
@ -222,7 +222,7 @@ sidebar:
|
||||
|
||||
### 3. Run
|
||||
|
||||
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.
|
||||
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/component-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/component-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.
|
||||
|
||||
👉 For this, you use the [`composeStories`](#composestories) or [`composeStory`](#composestory) API. The composed story will return a `run` method to be called.
|
||||
|
||||
|
@ -120,7 +120,7 @@ sidebar:
|
||||
These are the configurations needed in the setup file:
|
||||
- preview annotations: those defined in `.storybook/preview.ts`
|
||||
- addon annotations (optional): those exported by addons
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/interaction-testing.mdx#beforeall))
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/component-testing.mdx#beforeall))
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
|
@ -174,7 +174,7 @@ sidebar:
|
||||
These are the configurations needed in the setup file:
|
||||
- preview annotations: those defined in `.storybook/preview.ts`
|
||||
- addon annotations (optional): those exported by addons
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/interaction-testing.mdx#beforeall))
|
||||
- beforeAll: code that runs before all tests ([more info](../../writing-tests/component-testing.mdx#beforeall))
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
@ -230,7 +230,7 @@ sidebar:
|
||||
|
||||
### 3. Run
|
||||
|
||||
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.
|
||||
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/component-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/component-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.
|
||||
|
||||
👉 For this, you use the [`composeStories`](#composestories) or [`composeStory`](#composestory) API. The composed story will return a `run` method to be called.
|
||||
|
||||
|
@ -97,9 +97,9 @@ Currently, [automatic argType inference](../api/arg-types.mdx#automatic-argtype-
|
||||
|
||||
{/* prettier-ignore-end */}
|
||||
|
||||
### Interaction tests not working as expected
|
||||
### Component tests not working as expected
|
||||
|
||||
If you are migrating from a Webpack-based project, such as [CRA](https://create-react-app.dev/), to Vite, and you have enabled Interaction testing with the [`@storybook/addon-interactions`](https://storybook.js.org/addons/@storybook/addon-interactions) addon, you may run into a situation where your tests fail to execute notifying you that the `window` object is not defined. To resolve this issue, you can create a `preview-head.html` file in your Storybook configuration directory and include the following:
|
||||
If you are migrating from a Webpack-based project, such as [CRA](https://create-react-app.dev/), to Vite, and you have enabled component testing with the [`@storybook/addon-interactions`](https://storybook.js.org/addons/@storybook/addon-interactions) addon, you may run into a situation where your tests fail to execute notifying you that the `window` object is not defined. To resolve this issue, you can create a `preview-head.html` file in your Storybook configuration directory and include the following:
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
|
@ -25,7 +25,7 @@ Core frameworks have dedicated maintainers or contributors who are responsible f
|
||||
| [Outline](../../essentials/measure-and-outline.mdx#outline-addon) | ✅ | ✅ | ✅ | ✅ |
|
||||
| **Addons** | | | | |
|
||||
| [A11y](../../writing-tests/accessibility-testing.mdx) | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Interactions](../../writing-tests/interaction-testing.mdx) | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Component testing](../../writing-tests/component-testing.mdx) | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Test runner](../../writing-tests/test-runner.mdx) | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Test coverage](../../writing-tests/test-coverage.mdx) | ✅ | ✅ | ✅ | ✅ |
|
||||
| [CSS resources](https://github.com/storybookjs/addon-cssresources) | ✅ | ✅ | ✅ | ✅ |
|
||||
@ -75,7 +75,7 @@ Community frameworks have fewer contributors which means they may not be as up t
|
||||
| [Outline](../../essentials/measure-and-outline.mdx#outline-addon) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **Addons** | | | | | | |
|
||||
| [A11y](../../writing-tests/accessibility-testing.mdx) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Interactions](../../writing-tests/interaction-testing.mdx) | | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Component testing](../../writing-tests/component-testing.mdx) | | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Test runner](../../writing-tests/test-runner.mdx) | | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [Test coverage](../../writing-tests/test-coverage.mdx) | | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [CSS resources](https://github.com/storybookjs/addon-cssresources) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
|
@ -17,7 +17,7 @@ Actions work via supplying special Storybook-generated “action” arguments (r
|
||||
|
||||
### Via @storybook/test fn spy function
|
||||
|
||||
The recommended way to write actions is to use the `fn` utility from `@storybook/test` to mock and spy args. This is very useful for writing [interaction tests](../writing-tests/interaction-testing.mdx). You can mock your component's methods by assigning them to the `fn()` function:
|
||||
The recommended way to write actions is to use the `fn` utility from `@storybook/test` to mock and spy args. This is very useful for writing [component tests](../writing-tests/component-testing.mdx). You can mock your component's methods by assigning them to the `fn()` function:
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
|
@ -47,7 +47,7 @@ Now when you run Storybook, the Interactions addon will be enabled.
|
||||
|
||||

|
||||
|
||||
## Write an interaction test
|
||||
## Write a component test
|
||||
|
||||
Interactions run as part of the `play` function of your stories. We rely on Testing Library to do the heavy lifting.
|
||||
|
||||
|
@ -218,7 +218,7 @@ We're only covering versions 5.3 and 5.0 as they were important milestones for S
|
||||
| | Preview and build docs | [See current documentation](./writing-docs/build-documentation.mdx) | Non existing feature or undocumented | Non existing feature or undocumented |
|
||||
| Testing | Visual tests | [See current documentation](./writing-tests/visual-testing.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/automated-visual-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/automated-visual-testing) |
|
||||
| | Accessibility tests | [See current documentation](./writing-tests/accessibility-testing.mdx) | Non existing feature or undocumented | Non existing feature or undocumented |
|
||||
| | Interaction tests | [See current documentation](./writing-tests/interaction-testing.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/interaction-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/interaction-testing) |
|
||||
| | Component tests | [See current documentation](./writing-tests/component-testing.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/interaction-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/interaction-testing) |
|
||||
| | Snapshot tests | [See current documentation](./writing-tests/snapshot-testing/snapshot-testing.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/structural-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/structural-testing) |
|
||||
| | Import stories in tests/Unit tests | [See current documentation](./writing-tests/import-stories-in-tests/stories-in-unit-tests.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/react-ui-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/react-ui-testing) |
|
||||
| | Import stories in tests/End-to-end testing | [See current documentation](./writing-tests/import-stories-in-tests/stories-in-end-to-end-tests.mdx) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/testing/react-ui-testing) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/testing/react-ui-testing) |
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user