Merge branch 'next' into upgrade-babel-loader

This commit is contained in:
Norbert de Langen 2023-01-16 10:10:32 +01:00
commit ce2a06233c
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762
133 changed files with 1610 additions and 1896 deletions

View File

@ -1,3 +1,37 @@
## 7.0.0-beta.28 (January 14, 2023)
#### Maintenance
- CSF: Remove deprecated ArgTypes.defaultValue [#19492](https://github.com/storybooks/storybook/pull/19492)
#### Dependency Upgrades
- Addon-controls: Fix version of preview api [#20622](https://github.com/storybooks/storybook/pull/20622)
## 7.0.0-beta.27 (January 14, 2023)
#### Features
- CLI: Add "missing-babelrc" automigration [#20341](https://github.com/storybooks/storybook/pull/20341)
#### Bug Fixes
- Angular: Fix isStandaloneComponent check [#20295](https://github.com/storybooks/storybook/pull/20295)
- Blocks: Do not copy code snippet when text inside preview is selected [#19788](https://github.com/storybooks/storybook/pull/19788)
- Vue: Fix type.name check in extractArgTypes [#19956](https://github.com/storybooks/storybook/pull/19956)
- TypeScript: Add children to CanvasProps [#20451](https://github.com/storybooks/storybook/pull/20451)
- CLI: Fix angular/core version in init using devDependencies [#20609](https://github.com/storybooks/storybook/pull/20609)
#### Maintenance
- Svelte: don't add `svelte-loader` nor `svelte` when initializing Svelte projects [#18799](https://github.com/storybooks/storybook/pull/18799)
- Core: prepareMeta function similar to prepareStory [#20592](https://github.com/storybooks/storybook/pull/20592)
#### Build
- Build: Enable Scorecard Github Action and Badge [#19755](https://github.com/storybooks/storybook/pull/19755)
- Build: Add e2e test for static JSON files [#19463](https://github.com/storybooks/storybook/pull/19463)
## 7.0.0-beta.26 (January 14, 2023)
#### Features

View File

@ -543,6 +543,7 @@ In 7.0, frameworks also specify the builder to be used. For example, The current
- `@storybook/angular`
- `@storybook/html-webpack5`
- `@storybook/nextjs`
- `@storybook/preact-webpack5`
- `@storybook/react-webpack5`
- `@storybook/react-vite`

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
@ -63,16 +63,16 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addon-highlight": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/addon-highlight": "7.0.0-beta.28",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"axe-core": "^4.2.0",
"lodash": "^4.17.21",
"react-resize-detector": "^7.1.2"
@ -104,7 +104,7 @@
"./src/preview.tsx"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Accessibility",
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
@ -77,14 +77,14 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"dequal": "^2.0.2",
"lodash": "^4.17.21",
"polished": "^4.2.2",
@ -121,7 +121,7 @@
"./src/preview.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Actions",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
@ -76,14 +76,14 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"memoizerific": "^1.11.3",
"ts-dedent": "^2.0.0"
},
@ -112,7 +112,7 @@
"./src/preview.tsx"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Backgrounds",
"icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
@ -68,15 +68,15 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/blocks": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.8",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/blocks": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"lodash": "^4.17.21",
"ts-dedent": "^2.0.0"
},
@ -102,7 +102,7 @@
],
"platform": "browser"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Controls",
"icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
@ -103,18 +103,18 @@
"@babel/plugin-transform-react-jsx": "^7.19.0",
"@jest/transform": "^29.3.1",
"@mdx-js/react": "^2.1.5",
"@storybook/blocks": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/csf-plugin": "7.0.0-beta.26",
"@storybook/csf-tools": "7.0.0-beta.26",
"@storybook/blocks": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/csf-plugin": "7.0.0-beta.28",
"@storybook/csf-tools": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/mdx2-csf": "next",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/postinstall": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/postinstall": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"fs-extra": "^9.0.1",
"remark-external-links": "^8.0.0",
"remark-slug": "^6.0.0",
@ -141,7 +141,7 @@
"./src/shims/mdx-react-shim.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Docs",
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@ -119,23 +119,23 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addon-actions": "7.0.0-beta.26",
"@storybook/addon-backgrounds": "7.0.0-beta.26",
"@storybook/addon-controls": "7.0.0-beta.26",
"@storybook/addon-docs": "7.0.0-beta.26",
"@storybook/addon-highlight": "7.0.0-beta.26",
"@storybook/addon-measure": "7.0.0-beta.26",
"@storybook/addon-outline": "7.0.0-beta.26",
"@storybook/addon-toolbars": "7.0.0-beta.26",
"@storybook/addon-viewport": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/addon-actions": "7.0.0-beta.28",
"@storybook/addon-backgrounds": "7.0.0-beta.28",
"@storybook/addon-controls": "7.0.0-beta.28",
"@storybook/addon-docs": "7.0.0-beta.28",
"@storybook/addon-highlight": "7.0.0-beta.28",
"@storybook/addon-measure": "7.0.0-beta.28",
"@storybook/addon-outline": "7.0.0-beta.28",
"@storybook/addon-toolbars": "7.0.0-beta.28",
"@storybook/addon-viewport": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@storybook/vue": "7.0.0-beta.26",
"@storybook/vue": "7.0.0-beta.28",
"typescript": "^4.9.3"
},
"peerDependencies": {
@ -166,5 +166,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",
@ -61,9 +61,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "7.0.0-beta.26"
"@storybook/preview-api": "7.0.0-beta.28"
},
"devDependencies": {
"@types/webpack-env": "^1.16.0",
@ -78,7 +78,7 @@
"./src/preview.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"sbmodern": "dist/modern/index.js",
"storybook": {
"displayName": "Highlight",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",
@ -72,16 +72,16 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/instrumenter": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/instrumenter": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"jest-mock": "^27.0.6",
"polished": "^4.2.2",
"ts-dedent": "^2.2.0"
@ -118,7 +118,7 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Interactions",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
@ -70,13 +70,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"react-resize-detector": "^7.1.2",
"upath": "^1.2.0"
},
@ -105,7 +105,7 @@
],
"platform": "browser"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Jest",
"icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",
@ -77,14 +77,14 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/csf": "next",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/router": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/router": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"prop-types": "^15.7.2",
"ts-dedent": "^2.0.0"
},
@ -114,7 +114,7 @@
"./src/react/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Links",
"icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",
@ -75,13 +75,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26"
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28"
},
"devDependencies": {
"typescript": "~4.9.3"
@ -108,7 +108,7 @@
"./src/preview.tsx"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Measure",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",
@ -78,13 +78,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
@ -112,7 +112,7 @@
"./src/preview.tsx"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Outline",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Take a code snapshot of every story automatically with Jest",
"keywords": [
"addon",
@ -37,12 +37,12 @@
"dependencies": {
"@jest/transform": "^29.3.1",
"@storybook/babel-plugin-require-context-hook": "1.0.1",
"@storybook/client-api": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-webpack": "7.0.0-beta.26",
"@storybook/client-api": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-webpack": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/glob": "^7.1.3",
"@types/jest-specific-snapshot": "^0.5.6",
"core-js": "^3.8.2",
@ -58,11 +58,11 @@
"@angular/core": "^13.3.6",
"@angular/platform-browser-dynamic": "^13.3.6",
"@emotion/jest": "^11.8.0",
"@storybook/addon-docs": "7.0.0-beta.26",
"@storybook/angular": "7.0.0-beta.26",
"@storybook/react": "7.0.0-beta.26",
"@storybook/vue": "7.0.0-beta.26",
"@storybook/vue3": "7.0.0-beta.26",
"@storybook/addon-docs": "7.0.0-beta.28",
"@storybook/angular": "7.0.0-beta.28",
"@storybook/react": "7.0.0-beta.28",
"@storybook/vue": "7.0.0-beta.28",
"@storybook/vue3": "7.0.0-beta.28",
"babel-loader": "^8.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
@ -143,7 +143,7 @@
"access": "public"
},
"bundler": {},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Storyshots",
"icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots-puppeteer",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Image snapshots addition to StoryShots based on puppeteer",
"keywords": [
"addon",
@ -36,8 +36,8 @@
"dependencies": {
"@axe-core/puppeteer": "^4.2.0",
"@storybook/csf": "next",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/jest-image-snapshot": "^5.1.0",
"jest-image-snapshot": "^6.0.0"
},
@ -49,7 +49,7 @@
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@storybook/addon-storyshots": "7.0.0-beta.26",
"@storybook/addon-storyshots": "7.0.0-beta.28",
"puppeteer": ">=2.0.0"
},
"peerDependenciesMeta": {
@ -61,5 +61,5 @@
"access": "public"
},
"bundler": {},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "View a storys source code to see how it works and paste into your app",
"keywords": [
"addon",
@ -54,13 +54,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/router": "7.0.0-beta.26",
"@storybook/source-loader": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/router": "7.0.0-beta.28",
"@storybook/source-loader": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"estraverse": "^5.2.0",
"prop-types": "^15.7.2",
"react-syntax-highlighter": "^15.5.0"
@ -92,7 +92,7 @@
"./src/preset.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Storysource",
"icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",
@ -68,11 +68,11 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28"
},
"devDependencies": {
"typescript": "~4.9.3"
@ -99,7 +99,7 @@
],
"platform": "browser"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Toolbars",
"icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Build responsive components by adjusting Storybooks viewport size and orientation",
"keywords": [
"addon",
@ -73,13 +73,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"memoizerific": "^1.11.3",
"prop-types": "^15.7.2"
},
@ -109,7 +109,7 @@
"./src/preview.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1",
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de",
"storybook": {
"displayName": "Viewport",
"icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
"keywords": [
"storybook",
@ -36,19 +36,19 @@
"prep": "../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-client": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/core-webpack": "7.0.0-beta.26",
"@storybook/docs-tools": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-client": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/core-webpack": "7.0.0-beta.28",
"@storybook/docs-tools": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/node": "^16.0.0",
"@types/react": "^16.14.34",
"@types/react-dom": "^16.9.14",
@ -127,5 +127,5 @@
"bundler": {
"tsConfig": "tsconfig.build.json"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -268,12 +268,57 @@ describe('isStandaloneComponent', () => {
expect(isStandaloneComponent(FooPipe)).toEqual(false);
});
it('should return false with Directive', () => {
it('should return true with a Directive with "standalone: true"', () => {
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
// Angular deps are updated to v14.x.x.
@Directive({ standalone: true } as any)
class FooDirective {}
expect(isStandaloneComponent(FooDirective)).toEqual(true);
});
it('should return false with a Directive with "standalone: false"', () => {
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
// Angular deps are updated to v14.x.x.
@Directive({ standalone: false } as any)
class FooDirective {}
expect(isStandaloneComponent(FooDirective)).toEqual(false);
});
it('should return false with Directive without the "standalone" property', () => {
@Directive()
class FooDirective {}
expect(isStandaloneComponent(FooDirective)).toEqual(false);
});
it('should return true with a Pipe with "standalone: true"', () => {
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
// Angular deps are updated to v14.x.x.
@Pipe({ standalone: true } as any)
class FooPipe {}
expect(isStandaloneComponent(FooPipe)).toEqual(true);
});
it('should return false with a Pipe with "standalone: false"', () => {
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
// Angular deps are updated to v14.x.x.
@Pipe({ standalone: false } as any)
class FooPipe {}
expect(isStandaloneComponent(FooPipe)).toEqual(false);
});
it('should return false with Pipe without the "standalone" property', () => {
@Pipe({
name: 'fooPipe',
})
class FooPipe {}
expect(isStandaloneComponent(FooPipe)).toEqual(false);
});
});
describe('getComponentDecoratorMetadata', () => {

View File

@ -116,7 +116,11 @@ export const isStandaloneComponent = (component: any): component is Type<unknown
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
// Angular deps are updated to v14.x.x.
return (decorators || []).some((d) => d instanceof Component && (d as any).standalone);
return (decorators || []).some(
(d) =>
(d instanceof Component || d instanceof Directive || d instanceof Pipe) &&
(d as any).standalone
);
};
/**

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
"bugs": {
@ -31,12 +31,12 @@
"prep": "../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/docs-tools": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/docs-tools": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
@ -59,5 +59,5 @@
"access": "public"
},
"bundler": {},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,15 +48,15 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addons": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/channel-postmessage": "7.0.0-beta.26",
"@storybook/channel-websocket": "7.0.0-beta.26",
"@storybook/client-api": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/html": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview-web": "7.0.0-beta.26",
"@storybook/addons": "7.0.0-beta.28",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/channel-postmessage": "7.0.0-beta.28",
"@storybook/channel-websocket": "7.0.0-beta.28",
"@storybook/client-api": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/html": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview-web": "7.0.0-beta.28",
"magic-string": "^0.26.1"
},
"devDependencies": {
@ -76,5 +76,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,11 +48,11 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/html": "7.0.0-beta.26",
"@storybook/preset-html-webpack": "7.0.0-beta.26",
"@storybook/html": "7.0.0-beta.28",
"@storybook/preset-html-webpack": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -76,5 +76,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/nextjs",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Next.js",
"keywords": [
"storybook",
@ -60,13 +60,13 @@
},
"dependencies": {
"@next/font": "^13.0.7",
"@storybook/addon-actions": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preset-react-webpack": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/react": "7.0.0-beta.26",
"@storybook/addon-actions": "7.0.0-beta.28",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preset-react-webpack": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/react": "7.0.0-beta.28",
"@types/node": "^16.0.0",
"find-up": "^5.0.0",
"fs-extra": "^9.0.1",
@ -123,5 +123,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -28,4 +28,4 @@ const nextImageLoaderStub: RawLoaderDefinition<LoaderOptions> = function (conten
nextImageLoaderStub.raw = true;
export default nextImageLoaderStub;
export = nextImageLoaderStub;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,8 +48,8 @@
},
"dependencies": {
"@preact/preset-vite": "^2.0.0",
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/preact": "7.0.0-beta.26"
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/preact": "7.0.0-beta.28"
},
"devDependencies": {
"@types/node": "^16.0.0",
@ -73,5 +73,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preact": "7.0.0-beta.26",
"@storybook/preset-preact-webpack": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preact": "7.0.0-beta.28",
"@storybook/preset-preact-webpack": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -77,5 +77,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -50,8 +50,8 @@
"dependencies": {
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.2.1",
"@rollup/pluginutils": "^4.2.0",
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/react": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/react": "7.0.0-beta.28",
"@vitejs/plugin-react": "^3.0.0",
"ast-types": "^0.14.2",
"magic-string": "^0.26.1",
@ -80,5 +80,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,9 +48,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/preset-react-webpack": "7.0.0-beta.26",
"@storybook/react": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/preset-react-webpack": "7.0.0-beta.28",
"@storybook/react": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -83,5 +83,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/server-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preset-server-webpack": "7.0.0-beta.26",
"@storybook/server": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preset-server-webpack": "7.0.0-beta.28",
"@storybook/server": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -74,5 +74,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,9 +48,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/svelte": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/svelte": "7.0.0-beta.28",
"@sveltejs/vite-plugin-svelte": "^2.0.0",
"magic-string": "^0.26.1",
"svelte": "^3.0.0",
@ -80,5 +80,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preset-svelte-webpack": "7.0.0-beta.26",
"@storybook/svelte": "7.0.0-beta.26"
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preset-svelte-webpack": "7.0.0-beta.28",
"@storybook/svelte": "7.0.0-beta.28"
},
"devDependencies": {
"svelte": "^3.48.0",
@ -78,5 +78,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/sveltekit",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for SvelteKit",
"keywords": [
"storybook",
@ -51,9 +51,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/svelte": "7.0.0-beta.26",
"@storybook/svelte-vite": "7.0.0-beta.26"
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/svelte": "7.0.0-beta.28",
"@storybook/svelte-vite": "7.0.0-beta.28"
},
"devDependencies": {
"@types/node": "^16.0.0",
@ -76,5 +76,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/vue": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/vue": "7.0.0-beta.28",
"magic-string": "^0.26.1",
"vue-docgen-api": "^4.40.0"
},
@ -79,5 +79,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preset-vue-webpack": "7.0.0-beta.26",
"@storybook/vue": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preset-vue-webpack": "7.0.0-beta.28",
"@storybook/vue": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -83,5 +83,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,9 +48,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/vue3": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/vue3": "7.0.0-beta.28",
"magic-string": "^0.26.1",
"vue-docgen-api": "^4.40.0"
},
@ -83,5 +83,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preset-vue3-webpack": "7.0.0-beta.26",
"@storybook/vue3": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preset-vue3-webpack": "7.0.0-beta.28",
"@storybook/vue3": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -80,5 +80,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -48,10 +48,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-vite": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/web-components": "7.0.0-beta.26",
"@storybook/builder-vite": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/web-components": "7.0.0-beta.28",
"magic-string": "^0.26.1"
},
"devDependencies": {
@ -75,5 +75,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit-html",
@ -51,10 +51,10 @@
},
"dependencies": {
"@babel/preset-env": "^7.20.2",
"@storybook/builder-webpack5": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preset-web-components-webpack": "7.0.0-beta.26",
"@storybook/web-components": "7.0.0-beta.26",
"@storybook/builder-webpack5": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preset-web-components-webpack": "7.0.0-beta.28",
"@storybook/web-components": "7.0.0-beta.28",
"@types/node": "^16.0.0"
},
"devDependencies": {
@ -79,5 +79,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -13,6 +13,7 @@ const skipOnWindows = [
'addons/storyshots-core/src/frameworks/configure.test.ts',
'lib/core-common/src/utils/__tests__/interpret-files.test.ts',
'lib/cli/src/helpers.test.ts',
'lib/csf-tools/src/enrichCsf.test.ts',
];
module.exports = {

View File

@ -2,5 +2,5 @@
"npmClient": "yarn",
"useWorkspaces": true,
"registry": "https://registry.npmjs.org",
"version": "7.0.0-beta.26"
"version": "7.0.0-beta.28"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addons",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook addons store",
"keywords": [
"storybook"
@ -44,9 +44,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26"
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@ -60,5 +60,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-manager",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook manager builder",
"keywords": [
"storybook"
@ -44,9 +44,9 @@
},
"dependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/manager": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/manager": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@types/ejs": "^3.1.1",
"@types/find-cache-dir": "^3.2.1",
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
@ -73,5 +73,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "A plugin to run and build Storybooks with Vite",
"homepage": "https://github.com/storybookjs/storybook/tree/main/code/lib/builder-vite/#readme",
"bugs": {
@ -43,14 +43,14 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/csf-plugin": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/csf-plugin": "7.0.0-beta.28",
"@storybook/mdx2-csf": "next",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"browser-assert": "^1.2.1",
"es-module-lexer": "^0.9.3",
"express": "^4.17.3",
@ -95,5 +95,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -58,25 +58,25 @@
},
"dependencies": {
"@babel/core": "^7.12.10",
"@storybook/addons": "7.0.0-beta.26",
"@storybook/api": "7.0.0-beta.26",
"@storybook/channel-postmessage": "7.0.0-beta.26",
"@storybook/channel-websocket": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-api": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/components": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/core-webpack": "7.0.0-beta.26",
"@storybook/addons": "7.0.0-beta.28",
"@storybook/api": "7.0.0-beta.28",
"@storybook/channel-postmessage": "7.0.0-beta.28",
"@storybook/channel-websocket": "7.0.0-beta.28",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-api": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/components": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/core-webpack": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/router": "7.0.0-beta.26",
"@storybook/store": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/router": "7.0.0-beta.28",
"@storybook/store": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@types/node": "^16.0.0",
"@types/semver": "^7.3.4",
"babel-loader": "^8.3.0",
@ -131,5 +131,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channel-postmessage",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -43,9 +43,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"qs": "^6.10.0",
"telejson": "^7.0.3"
@ -61,5 +61,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channel-websocket",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -43,8 +43,8 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"telejson": "^7.0.3"
},
@ -59,5 +59,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -53,5 +53,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "sb",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook CLI",
"keywords": [
"storybook"
@ -21,10 +21,10 @@
"license": "MIT",
"bin": "./index.js",
"dependencies": {
"@storybook/cli": "7.0.0-beta.26"
"@storybook/cli": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "storybook",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook CLI",
"keywords": [
"storybook"
@ -24,10 +24,10 @@
"storybook": "./index.js"
},
"dependencies": {
"@storybook/cli": "7.0.0-beta.26"
"@storybook/cli": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/cli",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
"keywords": [
"cli",
@ -43,13 +43,13 @@
"dependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@storybook/codemod": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-server": "7.0.0-beta.26",
"@storybook/csf-tools": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/telemetry": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/codemod": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-server": "7.0.0-beta.28",
"@storybook/csf-tools": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/telemetry": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/semver": "^7.3.4",
"boxen": "^5.1.2",
"chalk": "^4.1.0",
@ -78,7 +78,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@storybook/client-api": "7.0.0-beta.26",
"@storybook/client-api": "7.0.0-beta.28",
"@types/cross-spawn": "^6.0.2",
"@types/prompts": "^2.0.9",
"@types/puppeteer-core": "^2.1.0",
@ -97,5 +97,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -55,12 +55,10 @@ export const mdx1to2: Fix<Mdx1to2Options> = {
We've found ${chalk.yellow(storiesMdxFiles.length)} '.stories.mdx' files in your project.
Storybook has upgraded to MDX2 (https://mdxjs.com/blog/v2/), which contains breaking changes from V1.
We can try to automatically upgrade your MDX files to MDX2 format using some common patterns.
For a full guide for how to manually upgrade your files, see the MDX2 migration guide:
${chalk.cyan('https://mdxjs.com/migrating/v2/#update-mdx-files')}
Some steps might require manual intervention. You can find a full guide for how to manually upgrade your files here:
${chalk.cyan('https://storybook.js.org/docs/7.0/react/writing-docs/mdx#breaking-changes')}
`;
},

View File

@ -1,90 +1,90 @@
// auto generated file, do not edit
export default {
'@storybook/addon-a11y': '7.0.0-beta.26',
'@storybook/addon-actions': '7.0.0-beta.26',
'@storybook/addon-backgrounds': '7.0.0-beta.26',
'@storybook/addon-controls': '7.0.0-beta.26',
'@storybook/addon-docs': '7.0.0-beta.26',
'@storybook/addon-essentials': '7.0.0-beta.26',
'@storybook/addon-highlight': '7.0.0-beta.26',
'@storybook/addon-interactions': '7.0.0-beta.26',
'@storybook/addon-jest': '7.0.0-beta.26',
'@storybook/addon-links': '7.0.0-beta.26',
'@storybook/addon-measure': '7.0.0-beta.26',
'@storybook/addon-outline': '7.0.0-beta.26',
'@storybook/addon-storyshots': '7.0.0-beta.26',
'@storybook/addon-storyshots-puppeteer': '7.0.0-beta.26',
'@storybook/addon-storysource': '7.0.0-beta.26',
'@storybook/addon-toolbars': '7.0.0-beta.26',
'@storybook/addon-viewport': '7.0.0-beta.26',
'@storybook/addons': '7.0.0-beta.26',
'@storybook/angular': '7.0.0-beta.26',
'@storybook/manager-api': '7.0.0-beta.26',
'@storybook/blocks': '7.0.0-beta.26',
'@storybook/builder-manager': '7.0.0-beta.26',
'@storybook/builder-vite': '7.0.0-beta.26',
'@storybook/builder-webpack5': '7.0.0-beta.26',
'@storybook/channel-postmessage': '7.0.0-beta.26',
'@storybook/channel-websocket': '7.0.0-beta.26',
'@storybook/channels': '7.0.0-beta.26',
'@storybook/cli': '7.0.0-beta.26',
'@storybook/client-api': '7.0.0-beta.26',
'@storybook/client-logger': '7.0.0-beta.26',
'@storybook/codemod': '7.0.0-beta.26',
'@storybook/components': '7.0.0-beta.26',
'@storybook/core-client': '7.0.0-beta.26',
'@storybook/core-common': '7.0.0-beta.26',
'@storybook/core-events': '7.0.0-beta.26',
'@storybook/core-server': '7.0.0-beta.26',
'@storybook/core-webpack': '7.0.0-beta.26',
'@storybook/csf-tools': '7.0.0-beta.26',
'@storybook/docs-tools': '7.0.0-beta.26',
'@storybook/ember': '7.0.0-beta.26',
'@storybook/html': '7.0.0-beta.26',
'@storybook/html-webpack5': '7.0.0-beta.26',
'@storybook/html-vite': '7.0.0-beta.26',
'@storybook/instrumenter': '7.0.0-beta.26',
'@storybook/nextjs': '7.0.0-beta.26',
'@storybook/node-logger': '7.0.0-beta.26',
'@storybook/postinstall': '7.0.0-beta.26',
'@storybook/preact': '7.0.0-beta.26',
'@storybook/preact-vite': '7.0.0-beta.26',
'@storybook/preact-webpack5': '7.0.0-beta.26',
'@storybook/preset-html-webpack': '7.0.0-beta.26',
'@storybook/preset-preact-webpack': '7.0.0-beta.26',
'@storybook/preset-react-webpack': '7.0.0-beta.26',
'@storybook/preset-server-webpack': '7.0.0-beta.26',
'@storybook/preset-svelte-webpack': '7.0.0-beta.26',
'@storybook/preset-vue-webpack': '7.0.0-beta.26',
'@storybook/preset-vue3-webpack': '7.0.0-beta.26',
'@storybook/preset-web-components-webpack': '7.0.0-beta.26',
'@storybook/preview': '7.0.0-beta.26',
'@storybook/preview-api': '7.0.0-beta.26',
'@storybook/preview-web': '7.0.0-beta.26',
'@storybook/react': '7.0.0-beta.26',
'@storybook/react-vite': '7.0.0-beta.26',
'@storybook/react-webpack5': '7.0.0-beta.26',
'@storybook/router': '7.0.0-beta.26',
'@storybook/server': '7.0.0-beta.26',
'@storybook/server-webpack5': '7.0.0-beta.26',
'@storybook/source-loader': '7.0.0-beta.26',
'@storybook/store': '7.0.0-beta.26',
'@storybook/svelte': '7.0.0-beta.26',
'@storybook/sveltekit': '7.0.0-beta.26',
'@storybook/svelte-vite': '7.0.0-beta.26',
'@storybook/svelte-webpack5': '7.0.0-beta.26',
'@storybook/telemetry': '7.0.0-beta.26',
'@storybook/theming': '7.0.0-beta.26',
'@storybook/manager': '7.0.0-beta.26',
'@storybook/vue': '7.0.0-beta.26',
'@storybook/vue-vite': '7.0.0-beta.26',
'@storybook/vue-webpack5': '7.0.0-beta.26',
'@storybook/vue3': '7.0.0-beta.26',
'@storybook/vue3-vite': '7.0.0-beta.26',
'@storybook/vue3-webpack5': '7.0.0-beta.26',
'@storybook/web-components': '7.0.0-beta.26',
'@storybook/web-components-webpack5': '7.0.0-beta.26',
'@storybook/web-components-vite': '7.0.0-beta.26',
sb: '7.0.0-beta.26',
storybook: '7.0.0-beta.26',
'@storybook/addon-a11y': '7.0.0-beta.28',
'@storybook/addon-actions': '7.0.0-beta.28',
'@storybook/addon-backgrounds': '7.0.0-beta.28',
'@storybook/addon-controls': '7.0.0-beta.28',
'@storybook/addon-docs': '7.0.0-beta.28',
'@storybook/addon-essentials': '7.0.0-beta.28',
'@storybook/addon-highlight': '7.0.0-beta.28',
'@storybook/addon-interactions': '7.0.0-beta.28',
'@storybook/addon-jest': '7.0.0-beta.28',
'@storybook/addon-links': '7.0.0-beta.28',
'@storybook/addon-measure': '7.0.0-beta.28',
'@storybook/addon-outline': '7.0.0-beta.28',
'@storybook/addon-storyshots': '7.0.0-beta.28',
'@storybook/addon-storyshots-puppeteer': '7.0.0-beta.28',
'@storybook/addon-storysource': '7.0.0-beta.28',
'@storybook/addon-toolbars': '7.0.0-beta.28',
'@storybook/addon-viewport': '7.0.0-beta.28',
'@storybook/addons': '7.0.0-beta.28',
'@storybook/angular': '7.0.0-beta.28',
'@storybook/manager-api': '7.0.0-beta.28',
'@storybook/blocks': '7.0.0-beta.28',
'@storybook/builder-manager': '7.0.0-beta.28',
'@storybook/builder-vite': '7.0.0-beta.28',
'@storybook/builder-webpack5': '7.0.0-beta.28',
'@storybook/channel-postmessage': '7.0.0-beta.28',
'@storybook/channel-websocket': '7.0.0-beta.28',
'@storybook/channels': '7.0.0-beta.28',
'@storybook/cli': '7.0.0-beta.28',
'@storybook/client-api': '7.0.0-beta.28',
'@storybook/client-logger': '7.0.0-beta.28',
'@storybook/codemod': '7.0.0-beta.28',
'@storybook/components': '7.0.0-beta.28',
'@storybook/core-client': '7.0.0-beta.28',
'@storybook/core-common': '7.0.0-beta.28',
'@storybook/core-events': '7.0.0-beta.28',
'@storybook/core-server': '7.0.0-beta.28',
'@storybook/core-webpack': '7.0.0-beta.28',
'@storybook/csf-tools': '7.0.0-beta.28',
'@storybook/docs-tools': '7.0.0-beta.28',
'@storybook/ember': '7.0.0-beta.28',
'@storybook/html': '7.0.0-beta.28',
'@storybook/html-webpack5': '7.0.0-beta.28',
'@storybook/html-vite': '7.0.0-beta.28',
'@storybook/instrumenter': '7.0.0-beta.28',
'@storybook/nextjs': '7.0.0-beta.28',
'@storybook/node-logger': '7.0.0-beta.28',
'@storybook/postinstall': '7.0.0-beta.28',
'@storybook/preact': '7.0.0-beta.28',
'@storybook/preact-vite': '7.0.0-beta.28',
'@storybook/preact-webpack5': '7.0.0-beta.28',
'@storybook/preset-html-webpack': '7.0.0-beta.28',
'@storybook/preset-preact-webpack': '7.0.0-beta.28',
'@storybook/preset-react-webpack': '7.0.0-beta.28',
'@storybook/preset-server-webpack': '7.0.0-beta.28',
'@storybook/preset-svelte-webpack': '7.0.0-beta.28',
'@storybook/preset-vue-webpack': '7.0.0-beta.28',
'@storybook/preset-vue3-webpack': '7.0.0-beta.28',
'@storybook/preset-web-components-webpack': '7.0.0-beta.28',
'@storybook/preview': '7.0.0-beta.28',
'@storybook/preview-api': '7.0.0-beta.28',
'@storybook/preview-web': '7.0.0-beta.28',
'@storybook/react': '7.0.0-beta.28',
'@storybook/react-vite': '7.0.0-beta.28',
'@storybook/react-webpack5': '7.0.0-beta.28',
'@storybook/router': '7.0.0-beta.28',
'@storybook/server': '7.0.0-beta.28',
'@storybook/server-webpack5': '7.0.0-beta.28',
'@storybook/source-loader': '7.0.0-beta.28',
'@storybook/store': '7.0.0-beta.28',
'@storybook/svelte': '7.0.0-beta.28',
'@storybook/sveltekit': '7.0.0-beta.28',
'@storybook/svelte-vite': '7.0.0-beta.28',
'@storybook/svelte-webpack5': '7.0.0-beta.28',
'@storybook/telemetry': '7.0.0-beta.28',
'@storybook/theming': '7.0.0-beta.28',
'@storybook/manager': '7.0.0-beta.28',
'@storybook/vue': '7.0.0-beta.28',
'@storybook/vue-vite': '7.0.0-beta.28',
'@storybook/vue-webpack5': '7.0.0-beta.28',
'@storybook/vue3': '7.0.0-beta.28',
'@storybook/vue3-vite': '7.0.0-beta.28',
'@storybook/vue3-webpack5': '7.0.0-beta.28',
'@storybook/web-components': '7.0.0-beta.28',
'@storybook/web-components-webpack5': '7.0.0-beta.28',
'@storybook/web-components-vite': '7.0.0-beta.28',
sb: '7.0.0-beta.28',
storybook: '7.0.0-beta.28',
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/client-api",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook Client API",
"keywords": [
"storybook"
@ -42,8 +42,8 @@
"prep": "../../../scripts/prepare/facade.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
@ -54,5 +54,5 @@
],
"shim": "@storybook/preview-api/dist/client-api"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/client-logger",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -56,5 +56,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -201,45 +201,6 @@ Heuristics:
- If a file has any default export, it will be skipped
- If a file has multiple `storiesOf` declarations, it will convert each one separately. This generates invalid ES6, but you can edit the file by hand to split it into multiple files (or whatever is appropriate).
### csf-to-mdx
This converts all of your CSF Component Stories into MDX syntax, which integrates story examples and long-form documentation.
> NOTE: The output of this transformation may require manual editing after running the transformation. MDX is finnicky about the top-level statements it allows. For example, [variables should be defined with exports](https://mdxjs.com/getting-started/#defining-variables-with-exports), meaning `const foo = 5;` should be rewritten as `export const foo = 5;`. We don't do this transformation automatically, since you may prefer to refactor your stories.
```sh
./node_modules/.bin/jscodeshift -t ./node_modules/@storybook/codemod/dist/transforms/csf-to-mdx.js . --ignore-pattern "node_modules|dist"
```
For example:
```js
export default {
title: 'Button',
};
export const story = () => <Button label="Story 1" />;
export const story2 = () => <Button label="Story 2" onClick={action('click')} />;
story2.story = { name: 'second story' };
```
Becomes:
```md
import { Meta, Story } from '@storybook/addon-docs';
# Button
<Meta title='Button'>
<Story name='story'><Button label="Story 1" /></Story>
<Story name='second story'>
<Button label="Story 2" onClick={action('click')} />
</Story>
```
### upgrade-hierarchy-separators
Starting in 5.3, Storybook is moving to using a single path separator, `/`, to specify the story hierarchy. It previously defaulted to `|` for story "roots" (optional) and either `/` or `.` for denoting paths. This codemod updates the old default to the new default.

View File

@ -1,6 +1,7 @@
const path = require('path');
const baseConfig = require('../../jest.config.node');
/** @type {import('jest').Config} */
module.exports = {
...baseConfig,
displayName: __dirname.split(path.sep).slice(-2).join(path.posix.sep),

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/codemod",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "A collection of codemod scripts written with JSCodeshift",
"keywords": [
"storybook"
@ -30,7 +30,6 @@
"./dist/transforms/add-component-parameters.js": "./dist/transforms/add-component-parameters.js",
"./dist/transforms/csf-2-to-3.js": "./dist/transforms/csf-2-to-3.js",
"./dist/transforms/csf-hoist-story-annotations.js": "./dist/transforms/csf-hoist-story-annotations.js",
"./dist/transforms/csf-to-mdx.js": "./dist/transforms/csf-to-mdx.js",
"./dist/transforms/move-builtin-addons.js": "./dist/transforms/move-builtin-addons.js",
"./dist/transforms/storiesof-to-csf.js": "./dist/transforms/storiesof-to-csf.js",
"./dist/transforms/update-addon-info.js": "./dist/transforms/update-addon-info.js",
@ -48,21 +47,22 @@
"dependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/types": "^7.20.2",
"@babel/types": "^7.20.7",
"@storybook/csf": "next",
"@storybook/csf-tools": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/csf-tools": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"cross-spawn": "^7.0.3",
"globby": "^11.0.2",
"jscodeshift": "^0.13.1",
"lodash": "^4.17.21",
"prettier": "^2.8.0",
"recast": "^0.19.0",
"recast": "^0.23.1",
"util": "^0.12.4"
},
"devDependencies": {
"@types/jscodeshift": "^0.11.6",
"ansi-regex": "^5.0.1",
"jest": "^29.3.1",
"jest-specific-snapshot": "^7.0.0",
"typescript": "~4.9.3"
@ -77,7 +77,6 @@
"./src/transforms/add-component-parameters.js",
"./src/transforms/csf-2-to-3.ts",
"./src/transforms/csf-hoist-story-annotations.js",
"./src/transforms/csf-to-mdx.js",
"./src/transforms/move-builtin-addons.js",
"./src/transforms/storiesof-to-csf.js",
"./src/transforms/update-addon-info.js",
@ -85,5 +84,5 @@
"./src/transforms/upgrade-hierarchy-separators.js"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,20 +0,0 @@
import React from 'react';
import Button from './Button';
import { action } from '@storybook/addon-actions';
export default {
title: 'Button',
};
export const story1 = () => <Button label="Story 1" />;
export const story2 = () => <Button label="Story 2" onClick={action('click')} />;
story2.story = { name: 'second story' };
export const story3 = () => (
<div>
<Button label="The Button" onClick={action('onClick')} />
<br />
</div>
);
story3.story = { name: 'complex story' };

View File

@ -1,18 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "basic.input.js" data 1`] = `
"import Button from './Button';
import { action } from '@storybook/addon-actions';
import { Meta, Story } from '@storybook/addon-docs';
<Meta title='Button' />
<Story name='story1'><Button label='Story 1' /></Story>
<Story name='second story'><Button label='Story 2' onClick={action('click')} /></Story>
<Story name='complex story'><div>
<Button label='The Button' onClick={action('onClick')} />
<br />
</div></Story>"
`;

View File

@ -1,9 +0,0 @@
import React from 'react';
import Button from './Button';
export default {
title: 'Button',
id: 'button-id',
};
export const someStory = () => <Button label="Story 1" />;

View File

@ -1,10 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "component-id.input.js" data 1`] = `
"import Button from './Button';
import { Meta, Story } from '@storybook/addon-docs';
<Meta title='Button' id='button-id' />
<Story name='someStory'><Button label='Story 1' /></Story>"
`;

View File

@ -1,13 +0,0 @@
import React from 'react';
import Button from './Button';
export default {
title: 'Some.Button',
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
};
export const story1 = () => <Button label="The Button" />;
story1.story = {
name: 'with decorator',
decorators: [withKnobs],
};

View File

@ -1,12 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "decorators.input.js" data 1`] = `
"import Button from './Button';
import { Meta, Story } from '@storybook/addon-docs';
<Meta
title='Some.Button'
decorators={[withKnobs, storyFn => <div className='foo'>{storyFn}</div>]} />
<Story name='with decorator' decorators={[withKnobs]}><Button label='The Button' /></Story>"
`;

View File

@ -1,23 +0,0 @@
import React from 'react';
import Button from './Button';
import { action } from '@storybook/addon-actions';
export default {
title: 'Button',
excludeStories: /.*Data$/,
};
export const rowData = { col1: 'a', col2: 2 };
export const story1 = () => <Button label="Story 1" />;
export const story2 = () => <Button label="Story 2" onClick={action('click')} />;
story2.story = { name: 'second story' };
export const story3 = () => (
<div>
<Button label="The Button" onClick={action('onClick')} />
<br />
</div>
);
story3.story = { name: 'complex story' };

View File

@ -1,22 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "exclude-stories.input.js" data 1`] = `
"import Button from './Button';
import { action } from '@storybook/addon-actions';
import { Meta, Story } from '@storybook/addon-docs';
<Meta title='Button' />
export const rowData = {
col1: 'a',
col2: 2,
};
<Story name='story1'><Button label='Story 1' /></Story>
<Story name='second story'><Button label='Story 2' onClick={action('click')} /></Story>
<Story name='complex story'><div>
<Button label='The Button' onClick={action('onClick')} />
<br />
</div></Story>"
`;

View File

@ -1,16 +0,0 @@
import React from 'react';
import Button from './Button';
import { storiesOf } from '@storybook/react';
export default {
title: 'Button',
component: Button,
parameters: {
foo: 1,
bar: 2,
},
};
export const story1 = () => <Button label="The Button" />;
story1.story = { name: 'with kind parameters' };

View File

@ -1,17 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "parameters.input.js" data 1`] = `
"import Button from './Button';
import { storiesOf } from '@storybook/react';
import { Meta, Story } from '@storybook/addon-docs';
<Meta
title='Button'
component={Button}
parameters={{
foo: 1,
bar: 2,
}} />
<Story name='with kind parameters'><Button label='The Button' /></Story>"
`;

View File

@ -1,19 +0,0 @@
import { global } from '@storybook/global';
const { document } = global;
export default {
title: 'Function',
};
export const functionStory = () => {
const btn = document.createElement('button');
btn.innerHTML = 'Hello Button';
btn.addEventListener('click', action('Click'));
return btn;
};
functionStory.story = {
name: 'function',
height: '100px',
};

View File

@ -1,18 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "story-function.input.js" data 1`] = `
"import { global } from '@storybook/global';
import { Meta, Story } from '@storybook/addon-docs';
const {
document,
} = global;
<Meta title='Function' />
<Story name='function' height='100px'>{() => {
const btn = document.createElement('button');
btn.innerHTML = 'Hello Button';
btn.addEventListener('click', action('Click'));
return btn;
}}</Story>"
`;

View File

@ -1,24 +0,0 @@
import React from 'react';
import Button from './Button';
import { storiesOf } from '@storybook/react';
export default {
title: 'Button',
};
export const story1 = () => <Button label="The Button" />;
story1.story = {
name: 'with story parameters',
parameters: {
header: false,
inline: true,
},
};
export const foo = () => <Button label="Foo" />;
foo.story = {
parameters: {
bar: 1,
},
};

View File

@ -1,22 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`csf-to-mdx transforms correctly using "story-parameters.input.js" data 1`] = `
"import Button from './Button';
import { storiesOf } from '@storybook/react';
import { Meta, Story } from '@storybook/addon-docs';
<Meta title='Button' />
<Story
name='with story parameters'
parameters={{
header: false,
inline: true,
}}><Button label='The Button' /></Story>
<Story
name='foo'
parameters={{
bar: 1,
}}><Button label='Foo' /></Story>"
`;

View File

@ -1,5 +1,7 @@
// import { describe, it, expect } from '@jest/globals';
import { describe, it, expect } from '@jest/globals';
import { dedent } from 'ts-dedent';
import type { API } from 'jscodeshift';
import ansiRegex from 'ansi-regex';
import _transform from '../csf-2-to-3';
expect.addSnapshotSerializer({
@ -8,9 +10,9 @@ expect.addSnapshotSerializer({
});
const jsTransform = (source: string) =>
_transform({ source, path: 'Component.stories.js' }, null, {}).trim();
_transform({ source, path: 'Component.stories.js' }, {} as API, {}).trim();
const tsTransform = (source: string) =>
_transform({ source, path: 'Component.stories.ts' }, null, { parser: 'tsx' }).trim();
_transform({ source, path: 'Component.stories.ts' }, {} as API, { parser: 'tsx' }).trim();
describe('csf-2-to-3', () => {
describe('javascript', () => {
@ -22,9 +24,7 @@ describe('csf-2-to-3', () => {
export const B = (args) => <Button {...args} />;
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
};
export default { title: 'Cat' };
export const A = () => <Cat />;
export const B = {
render: (args) => <Button {...args} />,
@ -36,21 +36,19 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export default { title: 'Cat' };
export const A = () => <Cat />;
A.storyName = 'foo';
A.parameters = { bar: 2 };
A.play = () => {};
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
};
export default { title: 'Cat' };
export const A = {
render: () => <Cat />,
name: 'foo',
parameters: {
bar: 2,
},
parameters: { bar: 2 },
play: () => {},
};
`);
@ -60,19 +58,22 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export default { title: 'components/Fruit', includeStories: ['A'] };
export const A = (args) => <Apple {...args} />;
export const B = (args) => <Banana {...args} />;
const C = (args) => <Cherry {...args} />;
`)
).toMatchInlineSnapshot(`
export default {
title: 'components/Fruit',
includeStories: ['A'],
};
export default { title: 'components/Fruit', includeStories: ['A'] };
export const A = {
render: (args) => <Apple {...args} />,
};
export const B = (args) => <Banana {...args} />;
const C = (args) => <Cherry {...args} />;
`);
});
@ -81,10 +82,12 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export const A = () => <Apple />;
export const B = (args) => <Banana {...args} />;
`)
).toMatchInlineSnapshot(`
export const A = () => <Apple />;
export const B = (args) => <Banana {...args} />;
`);
});
@ -97,10 +100,7 @@ describe('csf-2-to-3', () => {
export const B = (args) => <Banana {...args} />;
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
component: Cat,
};
export default { title: 'Cat', component: Cat };
export const A = {};
export const B = {
render: (args) => <Banana {...args} />,
@ -112,15 +112,14 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
export const A = {
render: (args) => <Cat {...args} />
};
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
component: Cat,
};
export default { title: 'Cat', component: Cat };
export const A = {
render: (args) => <Cat {...args} />,
};
@ -136,14 +135,11 @@ describe('csf-2-to-3', () => {
A.args = { isPrimary: false };
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
};
export default { title: 'Cat' };
export const A = {
render: (args) => <Cat {...args} />,
args: {
isPrimary: false,
},
args: { isPrimary: false },
};
`);
});
@ -152,28 +148,27 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
const Template = (args) => <Cat {...args} />;
export const A = Template.bind({});
A.args = { isPrimary: false };
const Template2 = (args) => <Banana {...args} />;
export const B = Template2.bind({});
B.args = { isPrimary: true };
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
component: Cat,
};
export default { title: 'Cat', component: Cat };
export const A = {
args: {
isPrimary: false,
},
args: { isPrimary: false },
};
export const B = {
render: (args) => <Banana {...args} />,
args: {
isPrimary: true,
},
args: { isPrimary: true },
};
`);
});
@ -182,23 +177,21 @@ describe('csf-2-to-3', () => {
expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
export const A = (args) => <Cat {...args} />;
export const B = () => <Cat name="frisky" />;
export const C = () => <Cat name="fluffy" />;
C.parameters = { foo: 2 };
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
component: Cat,
};
export default { title: 'Cat', component: Cat };
export const A = {};
export const B = () => <Cat name="frisky" />;
export const C = {
render: () => <Cat name="fluffy" />,
parameters: {
foo: 2,
},
parameters: { foo: 2 },
};
`);
});
@ -213,39 +206,151 @@ describe('csf-2-to-3', () => {
};
`)
).toMatchInlineSnapshot(`
export default {
title: 'Cat',
};
export default { title: 'Cat' };
export const A = {
render: (args) => <Cat {...args} />,
parameters: {
foo: 2,
},
parameters: { foo: 2 },
};
`);
});
});
describe('typescript', () => {
it('should replace function exports with objects', () => {
it('should error with namespace imports', () => {
expect.addSnapshotSerializer({
serialize: (value) => value.replace(ansiRegex(), ''),
test: () => true,
});
expect(() =>
tsTransform(dedent`
import * as SB from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } as Meta<CatProps>
export default meta;
export const A: SB.StoryFn<CatProps> = () => <Cat />;
`)
).toThrowErrorMatchingInlineSnapshot(`
This codemod does not support namespace imports for a @storybook/react package.
Replace the namespace import with named imports and try again.
> 1 | import * as SB from '@storybook/react';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | import { CatProps } from './Cat';
3 |
4 | const meta = { title: 'Cat', component: Cat } as Meta<CatProps>
`);
});
it('should keep local names', () => {
expect(
tsTransform(dedent`
export default { title: 'Cat' } as Meta<CatProps>;
export const A: Story<CatProps> = (args) => <Cat {...args} />;
export const B: any = (args) => <Button {...args} />;
export const C: Story<CatProps> = () => <Cat />;
import { Meta, StoryObj as CSF3, StoryFn as CSF2 } from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>
export default meta;
export const A: CSF2<CatProps> = () => <Cat />;
export const B: CSF3<CatProps> = {
args: { name: "already csf3" }
};
export const C: CSF2<CatProps> = (args) => <Cat {...args} />;
C.args = {
name: "Fluffy"
};
`)
).toMatchInlineSnapshot(`
import { Meta, StoryObj as CSF3, StoryFn as CSF2 } from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>;
export default meta;
export const A: CSF2<CatProps> = () => <Cat />;
export const B: CSF3<CatProps> = {
args: { name: 'already csf3' },
};
export const C: CSF3<CatProps> = {
args: {
name: 'Fluffy',
},
};
`);
});
it('should replace function exports with objects and update type', () => {
expect(
tsTransform(dedent`
import { Story, StoryFn, ComponentStory } from '@storybook/react';
// some extra whitespace to test
export default {
title: 'Cat',
component: Cat,
} as Meta<CatProps>;
export const A: Story<CatProps> = (args) => <Cat {...args} />;
A.args = { name: "Fluffy" };
export const B: any = (args) => <Button {...args} />;
export const C: Story<CatProps> = () => <Cat />;
export const D: StoryFn<CatProps> = (args) => <Cat {...args} />;
D.args = {
name: "Fluffy"
};
export const E: ComponentStory<Cat> = (args) => <Cat {...args} />;
E.args = { name: "Fluffy" };
export const F: Story = (args) => <Cat {...args} />;
F.args = {
name: "Fluffy"
};
`)
).toMatchInlineSnapshot(`
import { StoryObj, StoryFn, ComponentStory } from '@storybook/react';
// some extra whitespace to test
export default {
title: 'Cat',
component: Cat,
} as Meta<CatProps>;
export const A: Story<CatProps> = {
render: (args) => <Cat {...args} />,
export const A: StoryObj<CatProps> = {
args: { name: 'Fluffy' },
};
export const B: any = {
render: (args) => <Button {...args} />,
};
export const C: Story<CatProps> = () => <Cat />;
export const C: StoryFn<CatProps> = () => <Cat />;
export const D: StoryObj<CatProps> = {
args: {
name: 'Fluffy',
},
};
export const E: StoryObj<Cat> = {
args: { name: 'Fluffy' },
};
export const F: StoryObj = {
args: {
name: 'Fluffy',
},
};
`);
});
});

View File

@ -1,9 +1,13 @@
/* eslint-disable no-underscore-dangle */
import prettier from 'prettier';
import * as t from '@babel/types';
import { isIdentifier, isTSTypeAnnotation, isTSTypeReference } from '@babel/types';
import type { CsfFile } from '@storybook/csf-tools';
import { formatCsf, loadCsf } from '@storybook/csf-tools';
import type { API, FileInfo, Options } from 'jscodeshift';
import { loadCsf } from '@storybook/csf-tools';
import type { API, FileInfo } from 'jscodeshift';
import type { BabelFile, NodePath } from '@babel/core';
import * as babel from '@babel/core';
import * as recast from 'recast';
const logger = console;
@ -89,19 +93,21 @@ const isReactGlobalRenderFn = (csf: CsfFile, storyFn: t.Expression) => {
const isSimpleCSFStory = (init: t.Expression, annotations: t.ObjectProperty[]) =>
annotations.length === 0 && t.isArrowFunctionExpression(init) && init.params.length === 0;
export default function transform({ source, path }: FileInfo, api: API, options: Options) {
export default function transform(info: FileInfo, api: API, options: { parser?: string }) {
const makeTitle = (userTitle?: string) => {
return userTitle || 'FIXME';
};
const csf = loadCsf(source, { makeTitle });
const csf = loadCsf(info.source, { makeTitle });
try {
csf.parse();
} catch (err) {
logger.log(`Error ${err}, skipping`);
return source;
return info.source;
}
const importHelper = new StorybookImportHelper(csf, info);
const objectExports: Record<string, t.Statement> = {};
Object.entries(csf._storyExports).forEach(([key, decl]) => {
const annotations = Object.entries(csf._storyAnnotations[key]).map(([annotation, val]) => {
@ -111,12 +117,15 @@ export default function transform({ source, path }: FileInfo, api: API, options:
if (t.isVariableDeclarator(decl)) {
const { init, id } = decl;
// only replace arrow function expressions && template
// ignore no-arg stories without annotations
const template = getTemplateBindVariable(init);
if (
(!t.isArrowFunctionExpression(init) && !template) ||
isSimpleCSFStory(init, annotations)
) {
if (!t.isArrowFunctionExpression(init) && !template) return;
// Do change the type of no-arg stories without annotations to StoryFn when applicable
if (isSimpleCSFStory(init, annotations)) {
objectExports[key] = t.exportNamedDeclaration(
t.variableDeclaration('const', [
t.variableDeclarator(importHelper.updateTypeTo(id, 'StoryFn'), init),
])
);
return;
}
@ -128,26 +137,24 @@ export default function transform({ source, path }: FileInfo, api: API, options:
storyFn = init;
}
const keyId = t.identifier(key);
// @ts-expect-error (Converted from ts-ignore)
const { typeAnnotation } = id;
if (typeAnnotation) {
keyId.typeAnnotation = typeAnnotation;
}
const renderAnnotation = isReactGlobalRenderFn(csf, storyFn)
? []
: [t.objectProperty(t.identifier('render'), storyFn)];
objectExports[key] = t.exportNamedDeclaration(
t.variableDeclaration('const', [
t.variableDeclarator(keyId, t.objectExpression([...renderAnnotation, ...annotations])),
t.variableDeclarator(
importHelper.updateTypeTo(id, 'StoryObj'),
t.objectExpression([...renderAnnotation, ...annotations])
),
])
);
}
});
const updatedBody = csf._ast.program.body.reduce((acc, stmt) => {
importHelper.removeDeprecatedStoryImport();
csf._ast.program.body = csf._ast.program.body.reduce((acc, stmt) => {
// remove story annotations & template declarations
if (isStoryAnnotation(stmt, objectExports) || isTemplateDeclaration(stmt, csf._templates)) {
return acc;
@ -164,8 +171,8 @@ export default function transform({ source, path }: FileInfo, api: API, options:
acc.push(stmt);
return acc;
}, []);
csf._ast.program.body = updatedBody;
let output = formatCsf(csf);
let output = recast.print(csf._ast, {}).code;
try {
const prettierConfig = prettier.resolveConfig.sync('.', { editorconfig: true }) || {
@ -179,13 +186,123 @@ export default function transform({ source, path }: FileInfo, api: API, options:
output = prettier.format(output, {
...prettierConfig,
// This will infer the parser from the filename.
filepath: path,
filepath: info.path,
});
} catch (e) {
logger.log(`Failed applying prettier to ${path}.`);
logger.log(`Failed applying prettier to ${info.path}.`);
}
return output;
}
class StorybookImportHelper {
constructor(csf: CsfFile, info: FileInfo) {
// This allows for showing buildCodeFrameError messages
// @ts-expect-error File is not yet exposed, see https://github.com/babel/babel/issues/11350#issuecomment-644118606
const file: BabelFile = new babel.File(
{ filename: info.path },
{ code: info.source, ast: csf._ast }
);
this.sbImportDeclarations = this.getAllSbImportDeclarations(file);
}
private sbImportDeclarations: NodePath<t.ImportDeclaration>[];
private getAllSbImportDeclarations = (file: BabelFile) => {
const found: NodePath<t.ImportDeclaration>[] = [];
file.path.traverse({
ImportDeclaration: (path) => {
const source = path.node.source.value;
if (source.startsWith('@storybook/csf') || !source.startsWith('@storybook')) return;
const isRendererImport = path.get('specifiers').some((specifier) => {
if (specifier.isImportNamespaceSpecifier()) {
throw path.buildCodeFrameError(
`This codemod does not support namespace imports for a ${path.node.source.value} package.
Replace the namespace import with named imports and try again.`
);
}
if (!specifier.isImportSpecifier()) return false;
const imported = specifier.get('imported');
if (!imported.isIdentifier()) return false;
return [
'Story',
'StoryFn',
'StoryObj',
'Meta',
'ComponentStory',
'ComponentStoryFn',
'ComponentStoryObj',
'ComponentMeta',
].includes(imported.node.name);
});
if (isRendererImport) found.push(path);
},
});
return found;
};
getOrAddImport = (type: string): string | undefined => {
// prefer type import
const sbImport =
this.sbImportDeclarations.find((path) => path.node.importKind === 'type') ??
this.sbImportDeclarations[0];
if (sbImport == null) return undefined;
const specifiers = sbImport.get('specifiers');
const importSpecifier = specifiers.find((specifier) => {
if (!specifier.isImportSpecifier()) return false;
const imported = specifier.get('imported');
if (!imported.isIdentifier()) return false;
return imported.node.name === type;
});
if (importSpecifier) return importSpecifier.node.local.name;
specifiers[0].insertBefore(t.importSpecifier(t.identifier(type), t.identifier(type)));
return type;
};
removeDeprecatedStoryImport = () => {
const specifiers = this.sbImportDeclarations.flatMap((it) => it.get('specifiers'));
const storyImports = specifiers.filter((specifier) => {
if (!specifier.isImportSpecifier()) return false;
const imported = specifier.get('imported');
if (!imported.isIdentifier()) return false;
return imported.node.name === 'Story';
});
storyImports.forEach((path) => path.remove());
};
getAllLocalImports = () => {
return this.sbImportDeclarations
.flatMap((it) => it.get('specifiers'))
.map((it) => it.node.local.name);
};
updateTypeTo = (id: t.LVal, type: string): t.LVal => {
if (
isIdentifier(id) &&
isTSTypeAnnotation(id.typeAnnotation) &&
isTSTypeReference(id.typeAnnotation.typeAnnotation) &&
isIdentifier(id.typeAnnotation.typeAnnotation.typeName)
) {
const { name } = id.typeAnnotation.typeAnnotation.typeName;
if (this.getAllLocalImports().includes(name)) {
const localTypeImport = this.getOrAddImport(type);
return {
...id,
typeAnnotation: t.tsTypeAnnotation(
t.tsTypeReference(
t.identifier(localTypeImport),
id.typeAnnotation.typeAnnotation.typeParameters
)
),
};
}
}
return id;
};
}
export const parser = 'tsx';

View File

@ -1,190 +0,0 @@
import { prettyPrint } from 'recast';
import { isExportStory } from '@storybook/csf';
function exportMdx(root, options) {
// eslint-disable-next-line no-underscore-dangle
const path = root.__paths[0];
// FIXME: insert the title as markdown after all of the imports
return path.node.program.body
.map((n) => {
const { code } = prettyPrint(n, options);
if (n.type === 'JSXElement') {
return `${code}\n`;
}
return code;
})
.join('\n');
}
function parseIncludeExclude(prop) {
const { code } = prettyPrint(prop, {});
// eslint-disable-next-line no-eval
return (0, eval)(code);
}
/**
* Convert a component's module story file into an MDX file
*
* For example:
*
* ```
* input { Button } from './Button';
* export default {
* title: 'Button'
* }
* export const story = () => <Button label="The Button" />;
* ```
*
* Becomes:
*
* ```
* import { Meta, Story } from '@storybook/addon-docs';
* input { Button } from './Button';
*
* <Meta title='Button' />
*
* <Story name='story'>
* <Button label="The Button" />
* </Story>
* ```
*/
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
// FIXME: save out all the storyFn.story = { ... }
const storyKeyToStory = {};
// save out includeStories / excludeStories
const meta = {};
function makeAttr(key, val) {
return j.jsxAttribute(
j.jsxIdentifier(key),
val.type === 'Literal' ? val : j.jsxExpressionContainer(val)
);
}
function getStoryContents(node) {
return node.type === 'ArrowFunctionExpression' && node.body.type === 'JSXElement'
? node.body
: j.jsxExpressionContainer(node);
}
function getName(storyKey) {
const story = storyKeyToStory[storyKey];
if (story) {
const name = story.properties.find((prop) => prop.key.name === 'name');
if (name && name.value.type === 'Literal') {
return name.value.value;
}
}
return storyKey;
}
function getStoryAttrs(storyKey) {
const attrs = [];
const story = storyKeyToStory[storyKey];
if (story) {
story.properties.forEach((prop) => {
const { key, value } = prop;
if (key.name !== 'name') {
attrs.push(makeAttr(key.name, value));
}
});
}
return attrs;
}
// 1. If the program does not have `export default { title: '....' }, skip it
const defaultExportWithTitle = root
.find(j.ExportDefaultDeclaration)
.filter((def) => def.node.declaration.properties.map((p) => p.key.name).includes('title'));
if (defaultExportWithTitle.size() === 0) {
return root.toSource();
}
// 2a. Add imports from '@storybook/addon-docs'
root
.find(j.ImportDeclaration)
.at(-1)
.insertAfter(j.emptyStatement())
.insertAfter(
j.importDeclaration(
[j.importSpecifier(j.identifier('Meta')), j.importSpecifier(j.identifier('Story'))],
j.literal('@storybook/addon-docs')
)
);
// 2b. Remove react import which is implicit
root
.find(j.ImportDeclaration)
.filter((decl) => decl.node.source.value === 'react')
.remove();
// 3. Save out all the excluded stories
defaultExportWithTitle.forEach((exp) => {
exp.node.declaration.properties.forEach((p) => {
if (['includeStories', 'excludeStories'].includes(p.key.name)) {
meta[p.key.name] = parseIncludeExclude(p.value);
}
});
});
// 4. Collect all the story exports in storyKeyToStory[key] = null;
const namedExports = root.find(j.ExportNamedDeclaration);
namedExports.forEach((exp) => {
const storyKey = exp.node.declaration.declarations[0].id.name;
if (isExportStory(storyKey, meta)) {
storyKeyToStory[storyKey] = null;
}
});
// 5. Collect all the storyKey.story in storyKeyToStory and also remove them
const storyAssignments = root.find(j.AssignmentExpression).filter((exp) => {
const { left } = exp.node;
return (
left.type === 'MemberExpression' &&
left.object.type === 'Identifier' &&
left.object.name in storyKeyToStory &&
left.property.type === 'Identifier' &&
left.property.name === 'story'
);
});
storyAssignments.forEach((exp) => {
const { left, right } = exp.node;
storyKeyToStory[left.object.name] = right;
});
storyAssignments.remove();
// 6. Convert the default export to <Meta />
defaultExportWithTitle.replaceWith((exp) => {
const jsxId = j.jsxIdentifier('Meta');
const attrs = [];
exp.node.declaration.properties.forEach((prop) => {
const { key, value } = prop;
if (!['includeStories', 'excludeStories'].includes(key.name)) {
attrs.push(makeAttr(key.name, value));
}
});
const opening = j.jsxOpeningElement(jsxId, attrs);
opening.selfClosing = true;
return j.jsxElement(opening);
});
// 7. Convert all the named exports to <Story>...</Story>
namedExports.replaceWith((exp) => {
const storyKey = exp.node.declaration.declarations[0].id.name;
if (!isExportStory(storyKey, meta)) {
return exp.node;
}
const jsxId = j.jsxIdentifier('Story');
const name = getName(storyKey);
const attributes = [makeAttr('name', j.literal(name)), ...getStoryAttrs(storyKey)];
const opening = j.jsxOpeningElement(jsxId, attributes);
const closing = j.jsxClosingElement(jsxId);
const children = [getStoryContents(exp.node.declaration.declarations[0].init)];
return j.jsxElement(opening, closing, children);
});
return exportMdx(root, { quote: 'single', trailingComma: 'true', tabWidth: 2 });
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-client",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -35,8 +35,8 @@
"prep": "../../../scripts/prepare/facade.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
@ -47,5 +47,5 @@
],
"shim": "@storybook/preview-api/dist/core-client"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-common",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -44,8 +44,8 @@
},
"dependencies": {
"@babel/core": "^7.20.2",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/babel__core": "^7.1.20",
"@types/express": "^4.7.0",
"@types/node": "^16.0.0",
@ -83,5 +83,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-events",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Event names used in storybook core",
"keywords": [
"storybook"
@ -53,5 +53,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-server",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -58,17 +58,17 @@
"dependencies": {
"@aw-web-design/x-default-browser": "1.4.88",
"@discoveryjs/json-ext": "^0.5.3",
"@storybook/builder-manager": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/builder-manager": "7.0.0-beta.28",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/csf": "next",
"@storybook/csf-tools": "7.0.0-beta.26",
"@storybook/csf-tools": "7.0.0-beta.28",
"@storybook/docs-mdx": "next",
"@storybook/global": "^5.0.0",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/telemetry": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/telemetry": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/detect-port": "^1.3.0",
"@types/node": "^16.0.0",
"@types/node-fetch": "^2.5.7",
@ -119,5 +119,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-webpack",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -43,9 +43,9 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/node-logger": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/node-logger": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/node": "^16.0.0",
"ts-dedent": "^2.0.0"
},
@ -62,5 +62,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/csf-plugin",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Enrich CSF files via static analysis",
"keywords": [
"storybook"
@ -43,7 +43,7 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/csf-tools": "7.0.0-beta.26",
"@storybook/csf-tools": "7.0.0-beta.28",
"unplugin": "^0.10.2"
},
"devDependencies": {
@ -64,5 +64,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/csf-tools",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -45,8 +45,9 @@
"dependencies": {
"@babel/types": "^7.20.2",
"@storybook/csf": "next",
"@storybook/types": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.28",
"fs-extra": "^9.0.1",
"recast": "^0.23.1",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
@ -66,5 +67,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,14 +1,22 @@
import * as parser from '@babel/parser';
import * as recast from 'recast';
export const babelParse = (code: string) =>
parser.parse(code, {
sourceType: 'module',
// FIXME: we should get this from the project config somehow?
plugins: [
'jsx',
'typescript',
['decorators', { decoratorsBeforeExport: true }],
'classProperties',
],
tokens: true,
export const babelParse = (code: string) => {
return recast.parse(code, {
parser: {
parse(source: string) {
return parser.parse(source, {
sourceType: 'module',
// FIXME: we should get this from the project config somehow?
plugins: [
'jsx',
'typescript',
['decorators', { decoratorsBeforeExport: true }],
'classProperties',
],
tokens: true,
});
},
},
});
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/docs-tools",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Shared utility functions for frameworks to implement docs",
"keywords": [
"storybook"
@ -44,9 +44,9 @@
},
"dependencies": {
"@babel/core": "^7.12.10",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"@types/doctrine": "^0.0.3",
"doctrine": "^3.0.0",
"lodash": "^4.17.21"
@ -64,5 +64,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/instrumenter",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -43,11 +43,11 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.28",
"core-js": "^3.8.2"
},
"devDependencies": {
@ -61,5 +61,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/api",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook Manager API (facade)",
"keywords": [
"storybook"
@ -42,8 +42,8 @@
"prep": "../../../scripts/prepare/facade.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/manager-api": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/manager-api": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
@ -54,5 +54,5 @@
],
"shim": "@storybook/manager-api"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/manager-api",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Core Storybook API & Context",
"keywords": [
"storybook"
@ -42,14 +42,14 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/csf": "next",
"@storybook/global": "^5.0.0",
"@storybook/router": "7.0.0-beta.26",
"@storybook/theming": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.26",
"@storybook/router": "7.0.0-beta.28",
"@storybook/theming": "7.0.0-beta.28",
"@storybook/types": "7.0.0-beta.28",
"dequal": "^2.0.2",
"lodash": "^4.17.21",
"memoizerific": "^1.11.3",
@ -78,5 +78,5 @@
"./src/index.tsx"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1 +1 @@
export const version = '7.0.0-beta.26';
export const version = '7.0.0-beta.28';

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/node-logger",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -60,5 +60,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/postinstall",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Storybook addons postinstall utilities",
"keywords": [
"api",
@ -57,5 +57,5 @@
"./src/index.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preview-api",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -67,13 +67,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channel-postmessage": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/channel-postmessage": "7.0.0-beta.28",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/csf": "next",
"@storybook/global": "^5.0.0",
"@storybook/types": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.28",
"@types/qs": "^6.9.5",
"dequal": "^2.0.2",
"lodash": "^4.17.21",
@ -86,7 +86,7 @@
},
"devDependencies": {
"@jest/globals": "^26.6.2",
"@storybook/core-common": "7.0.0-beta.26",
"@storybook/core-common": "7.0.0-beta.28",
"ansi-to-html": "^0.6.11",
"react": "^16.14.0"
},
@ -103,5 +103,5 @@
"./src/store.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -2,13 +2,7 @@
import { global } from '@storybook/global';
import { expect } from '@jest/globals';
import type {
Renderer,
ArgsEnhancer,
PlayFunctionContext,
SBObjectType,
SBScalarType,
} from '@storybook/types';
import type { Renderer, ArgsEnhancer, PlayFunctionContext, SBScalarType } from '@storybook/types';
import { addons, HooksContext } from '../../addons';
import { NO_TARGET_NAME } from '../args';
@ -32,20 +26,6 @@ const moduleExport = {};
const stringType: SBScalarType = { name: 'string' };
const numberType: SBScalarType = { name: 'number' };
const booleanType: SBScalarType = { name: 'boolean' };
const complexType: SBObjectType = {
name: 'object',
value: {
complex: {
name: 'object',
value: {
object: {
name: 'array',
value: { name: 'string' },
},
},
},
},
};
beforeEach(() => {
global.FEATURES = { breakingChangesV7: true };
@ -195,44 +175,6 @@ describe('prepareStory', () => {
expect(initialArgs).toEqual({});
});
it('are initialized to argTypes[x].defaultValue if unset', () => {
const { initialArgs } = prepareStory(
{
id,
name,
args: {
arg2: 3,
arg4: 'foo',
arg7: false,
},
argTypes: {
arg1: { name: 'arg1', type: stringType, defaultValue: 'arg1' },
arg2: { name: 'arg2', type: numberType, defaultValue: 2 },
arg3: {
name: 'arg3',
type: complexType,
defaultValue: { complex: { object: ['type'] } },
},
arg4: { name: 'arg4', type: stringType },
arg5: { name: 'arg5', type: stringType },
arg6: { name: 'arg6', type: numberType, defaultValue: 0 }, // See https://github.com/storybookjs/storybook/issues/12767 }
},
moduleExport,
},
{ id, title },
{ render: () => {} }
);
expect(initialArgs).toEqual({
arg1: 'arg1',
arg2: 3,
arg3: { complex: { object: ['type'] } },
arg4: 'foo',
arg6: 0,
arg7: false,
});
});
describe('argsEnhancers', () => {
it('are applied in the right order', () => {
const run: number[] = [];

View File

@ -1,5 +1,3 @@
import { dedent } from 'ts-dedent';
import deprecate from 'util-deprecate';
import { global } from '@storybook/global';
import type {
@ -28,15 +26,6 @@ import { applyHooks } from '../../addons';
import { combineParameters } from '../parameters';
import { defaultDecorateStory } from '../decorators';
import { groupArgsByTarget, NO_TARGET_NAME } from '../args';
import { getValuesFromArgTypes } from './getValuesFromArgTypes';
const argTypeDefaultValueWarning = deprecate(
() => {},
dedent`
\`argType.defaultValue\` is deprecated and will be removed in Storybook 7.0.
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#no-longer-inferring-default-values-of-args`
);
// Combine all the metadata about a story (both direct and inherited from the component/global scope)
// into a "renderable" story function, with all decorators applied, parameters passed as context etc
@ -234,15 +223,7 @@ function preparePartialAnnotations<TRenderer extends Renderer>(
contextForEnhancers.argTypes
);
// Add argTypes[X].defaultValue to initial args (note this deprecated)
// We need to do this *after* the argTypesEnhancers as they may add defaultValues
const defaultArgs = getValuesFromArgTypes(contextForEnhancers.argTypes);
if (Object.keys(defaultArgs).length > 0) {
argTypeDefaultValueWarning();
}
const initialArgsBeforeEnhancers = { ...defaultArgs, ...passedArgs };
const initialArgsBeforeEnhancers = { ...passedArgs };
contextForEnhancers.initialArgs = argsEnhancers.reduce(
(accumulatedArgs: Args, enhancer) => ({

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preview-web",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -42,8 +42,8 @@
"prep": "../../../scripts/prepare/facade.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
@ -54,5 +54,5 @@
],
"shim": "@storybook/preview-api/dist/preview-web"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preview",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -57,12 +57,12 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"devDependencies": {
"@storybook/channel-postmessage": "7.0.0-beta.26",
"@storybook/channel-websocket": "7.0.0-beta.26",
"@storybook/channels": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/core-events": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26",
"@storybook/channel-postmessage": "7.0.0-beta.28",
"@storybook/channel-websocket": "7.0.0-beta.28",
"@storybook/channels": "7.0.0-beta.28",
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/core-events": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28",
"typescript": "~4.9.3"
},
"publishConfig": {
@ -74,5 +74,5 @@
"./src/globals.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/router",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Core Storybook Router",
"keywords": [
"storybook"
@ -48,7 +48,7 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/client-logger": "7.0.0-beta.28",
"memoizerific": "^1.11.3",
"qs": "^6.10.0"
},
@ -74,5 +74,5 @@
"./src/utils.ts"
]
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/source-loader",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "Source loader",
"keywords": [
"lib",
@ -45,7 +45,7 @@
},
"dependencies": {
"@storybook/csf": "next",
"@storybook/types": "7.0.0-beta.26",
"@storybook/types": "7.0.0-beta.28",
"estraverse": "^5.2.0",
"lodash": "^4.17.21",
"prettier": "^2.8.0"
@ -67,5 +67,5 @@
],
"platform": "node"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/store",
"version": "7.0.0-beta.26",
"version": "7.0.0-beta.28",
"description": "",
"keywords": [
"storybook"
@ -42,8 +42,8 @@
"prep": "../../../scripts/prepare/facade.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.0-beta.26",
"@storybook/preview-api": "7.0.0-beta.26"
"@storybook/client-logger": "7.0.0-beta.28",
"@storybook/preview-api": "7.0.0-beta.28"
},
"publishConfig": {
"access": "public"
@ -55,5 +55,5 @@
"platform": "node",
"shim": "@storybook/preview-api/dist/store"
},
"gitHead": "4d3ed5ec2eb8db3e688955e2820001def09621c1"
"gitHead": "05179df2dcf366ea1e61b0809e7778afbec094de"
}

Some files were not shown because too many files have changed in this diff Show More