diff --git a/.circleci/config.yml b/.circleci/config.yml index 00f3a552e09..cb0d2589d78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ executors: default: 'small' working_directory: /tmp/storybook docker: - - image: mcr.microsoft.com/playwright:v1.29.1-focal + - image: mcr.microsoft.com/playwright:v1.30.0-focal environment: NODE_OPTIONS: --max_old_space_size=6144 resource_class: <> diff --git a/CHANGELOG.md b/CHANGELOG.md index 460160d78cb..dff6b1f90aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,74 @@ +## 7.0.0-beta.34 (January 26, 2023) + +#### Features + +- Addon-docs: Add legacy transitional support for MDX1 [#20747](https://github.com/storybooks/storybook/pull/20747) + +#### Bug Fixes + +- CLI: Fix global flag corner case [#20776](https://github.com/storybooks/storybook/pull/20776) +- Csf-tools: Fix ConfigFile string literal property handling [#20785](https://github.com/storybooks/storybook/pull/20785) +- Angular: Ensure docsMode flag has effect [#20711](https://github.com/storybooks/storybook/pull/20711) +- Angular: Use Providers in boostrapApplication option [#20746](https://github.com/storybooks/storybook/pull/20746) +- WebComponents: Fix Button type error [#20722](https://github.com/storybooks/storybook/pull/20722) + +#### Build + +- Verify consistency of anonymous id [#20781](https://github.com/storybooks/storybook/pull/20781) +- Build: fix playwright unsynced version in CI [#20778](https://github.com/storybooks/storybook/pull/20778) +- Upgrade playwright [#20777](https://github.com/storybooks/storybook/pull/20777) + +#### Dependency Upgrades + +- Deps: Upgrade fs-extra to 11.1.0 [#20772](https://github.com/storybooks/storybook/pull/20772) + +## 7.0.0-beta.33 (January 24, 2023) + +#### Features + +- Addon-docs: Allow `` to reference the first story [#20765](https://github.com/storybooks/storybook/pull/20765) + +#### Bug Fixes + +- Angular: Fix issue if BrowserAnimationsModule is imported [#20709](https://github.com/storybooks/storybook/pull/20709) +- Core: Fix issue with inconsistent CSF ordering in sandboxes [#20705](https://github.com/storybooks/storybook/pull/20705) +- Fixed paths in generated main.cjs for the default sandbox on Windows [#20724](https://github.com/storybooks/storybook/pull/20724) +- Blocks: Ignore known blocks with global CSS selector [#20757](https://github.com/storybooks/storybook/pull/20757) + +#### Maintenance + +- Docs: Make reference stories consistent [#20759](https://github.com/storybooks/storybook/pull/20759) +- Blocks: New Canvas API [#20723](https://github.com/storybooks/storybook/pull/20723) + +#### Build + +- Fix vue sandbox: remove the lang=ts in a file, that should remain agnostic [#20768](https://github.com/storybooks/storybook/pull/20768) +- Build: do not treat check as a cache-able operation && cleanup [#20762](https://github.com/storybooks/storybook/pull/20762) + +## 7.0.0-beta.32 (January 24, 2023) + +#### Features + +- CLI: Add init support for qwik projects [#20411](https://github.com/storybooks/storybook/pull/20411) + +#### Bug Fixes + +- Vue3: Fix reactive args + many vue app creation issue [#20712](https://github.com/storybooks/storybook/pull/20712) +- Docs: Allow "declaring" stories with `story={}` [#20702](https://github.com/storybooks/storybook/pull/20702) +- Addon-links: Fix the d.ts file, deprecate LinkTo [#20671](https://github.com/storybooks/storybook/pull/20671) +- CLI: Fix package execution for npm package manager [#20708](https://github.com/storybooks/storybook/pull/20708) + +#### Maintenance + +- Upgrade react-popper-tooltip [#20736](https://github.com/storybooks/storybook/pull/20736) +- CLI: Upgrade automigrations to use new safe helpers [#20693](https://github.com/storybooks/storybook/pull/20693) +- Csf-tools: Add helpers to get name from node path [#20691](https://github.com/storybooks/storybook/pull/20691) +- Build: remove preact-webpack5 from babelrc automigration [#20706](https://github.com/storybooks/storybook/pull/20706) + +#### Build + +- Fix windows snapshot [#20707](https://github.com/storybooks/storybook/pull/20707) + ## 7.0.0-beta.31 (January 20, 2023) #### Features diff --git a/MIGRATION.md b/MIGRATION.md index bd0bb59fbf3..6ecca68a4d1 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -40,13 +40,19 @@ - [Icons API changed](#icons-api-changed) - [Removed global client APIs](#removed-global-client-apis) - [Docs Changes](#docs-changes) - - [Standalone docs files](#standalone-docs-files) - - [Referencing stories in docs files](#referencing-stories-in-docs-files) - - [Description block, `parameters.notes` and `parameters.info`](#description-block-parametersnotes-and-parametersinfo) - - [Autodocs](#autodocs) - - [Configuring the Docs Container](#configuring-the-docs-container) - - [External Docs](#external-docs) + - [Autodocs changes](#autodocs-changes) + - [MDX docs files](#mdx-docs-files) + - [Unattached docs files](#unattached-docs-files) + - [Doc Blocks](#doc-blocks) + - [Meta block](#meta-block) + - [Description block, `parameters.notes` and `parameters.info`](#description-block-parametersnotes-and-parametersinfo) + - [Story block](#story-block) + - [Source block](#source-block) + - [Canvas block](#canvas-block) + - [ArgsTable block](#argstable-block) + - [Configuring Autodocs](#configuring-autodocs) - [MDX2 upgrade](#mdx2-upgrade) + - [Legacy MDX1 support](#legacy-mdx1-support) - [Default docs styles will leak into non-story user components](#default-docs-styles-will-leak-into-non-story-user-components) - [Explicit `` elements are no longer syntax highlighted](#explicit-code-elements-are-no-longer-syntax-highlighted) - [Dropped source loader / storiesOf static snippets](#dropped-source-loader--storiesof-static-snippets) @@ -749,68 +755,11 @@ Instead, use `export const parameters = {};` and `export const decorators = [];` ### Docs Changes -The information hierarchy of docs in Storybook has changed in 7.0. The main difference is that each docs is listed in the sidebar as a separate entry, rather than attached to individual stories. +The information hierarchy of docs in Storybook has changed in 7.0. The main difference is that each docs is listed in the sidebar as a separate entry underneath the component, rather than attached to individual stories. You can also opt-in to a Autodocs entry rather than having one for every component (previously stories). -These changes are encapsulated in the following: +We've also modernized the API for all the doc blocks (the MDX components you use to write custom docs pages), which we'll describe below. -#### Standalone docs files - -In Storybook 6.x, to create a standalone docs MDX file, you'd have to create a `.stories.mdx` file, and describe its location with the `Meta` doc block: - -```mdx -import { Meta } from '@storybook/addon-docs'; - - -``` - -In 7.0, things are a little simpler -- you should call the file `.mdx` (drop the `.stories`). This will mean behind the scenes there is no story attached to this entry. You may also drop the `title` and use autotitle (and leave the `Meta` component out entirely). - -Additionally, you can attach a standalone docs entry to a component, using the new `of={}` syntax on the `Meta` component: - -```mdx -import { Meta } from '@storybook/blocks'; -import * as ComponentStories from './some-component.stories'; - - -``` - -You can create as many docs entries as you like for a given component. Note that if you attach a docs entry to a component it will replace the automatically generated entry from `DocsPage` (See below). - -By default docs entries are listed first for the component. You can sort them using story sorting. - -#### Referencing stories in docs files - -To reference a story in a MDX file, you should reference it with `of`: - -```mdx -import { Meta, Story } from '@storybook/blocks'; -import * as ComponentStories from './some-component.stories'; - - - - -``` - -You can also reference a story from a different component: - -```mdx -import { Meta, Story } from '@storybook/blocks'; -import * as ComponentStories from './some-component.stories'; -import * as SecondComponentStories from './second-component.stories'; - - - - -``` - -#### Description block, `parameters.notes` and `parameters.info` - -In 6.5 the Description doc block accepted a range of different props, `markdown`, `type` and `children` as a way to customize the content. -The props have been simplified and the block now only accepts an `of` prop, which can be a reference to either a CSF file, a default export (meta) or a story export, depending on which description you want to be shown. See TDB DOCS LINK for a deeper explanation of the new prop. - -`parameters.notes` and `parameters.info` have been deprecated as a way to specify descriptions. Instead use JSDoc comments above the default export or story export, or use `parameters.docs.description.story | component` directly. See TDB DOCS LINK for a deeper explanation on how to write descriptions. - -#### Autodocs +#### Autodocs changes In 7.0, rather than rendering each story in "docs view mode", Autodocs (formerly known as "Docs Page") operates by adding additional sidebar entries for each component. By default it uses the same template as was used in 6.x, and the entries are entitled `Docs`. @@ -835,11 +784,159 @@ export default { } ``` -You can also set `autodocs: false` to opt-out of Autodocs entirely. +You can also set `autodocs: false` to opt-out of Autodocs entirely. Further configuration of Autodocs is described below. -You can change the default template in the same way as in 6.x, using the `docs.page` parameter. +**Parameter changes** -#### Configuring the Docs Container +We've renamed many of the parameters that control docs rendering for consistency with the blocks (see below). The old parameters are now deprecated and will be removed in 8.0. Here is a full list of changes: + +- `docs.inlineStories` has been renamed `docs.story.inline` +- `docs.iframeHeight` has been renamed `docs.story.iframeHeight` +- `notes` and `info` are no longer supported, instead use `docs.description.story | component` + +#### MDX docs files + +Previously `.stories.mdx` files were used to both define and document stories. In 7.0, we have deprecated defining stories in MDX files, and consequently have changed the suffix to simply `.mdx`. Our default `stories` glob in `main.js` will now match such files -- if you want to write MDX files that do not appear in Storybook, you may need to adjust the glob accordingly. + +If you were using `.stories.mdx` files to write stories, we encourage you to move the stories to a CSF file, and _attach_ an `.mdx` file to that CSF file to document them. You can use the `Meta` block to attach a MDX file to a CSF file, and the `Story` block to render the stories: + +```mdx +import { Meta, Story } from '@storybook/blocks'; +import * as ComponentStories from './some-component.stories'; + + + + +``` + +You can create as many docs entries as you like for a given component. Note that if you attach a docs entry to a component it will replace the automatically generated entry from Autodocs. + +By default docs entries are listed first for the component. You can sort them using story sorting. + +#### Unattached docs files + +In Storybook 6.x, to create a unattached docs MDX file (that is, one not attached to story or a CSF file), you'd have to create a `.stories.mdx` file, and describe its location with the `Meta` doc block: + +```mdx +import { Meta } from '@storybook/addon-docs'; + + +``` + +In 7.0, things are a little simpler -- you should call the file `.mdx` (drop the `.stories`). This will mean behind the scenes there is no story attached to this entry. You may also drop the `title` and use autotitle (and leave the `Meta` component out entirely, potentially). + +#### Doc Blocks + +Additionally to changing the docs information architecture, we've updated the API of the doc blocks themselves to be more consistent and future proof. + +**General changes** + +- Each block now uses `of={}` as a primary API -- where the argument to the `of` prop is a CSF or story _export_. + +- When you've attached to a CSF file (with the `Meta` block, or in Autodocs), you can drop the `of` and the block will reference the first story or the CSF file as a whole. + +- Most other props controlling rendering of blocks now correspond precisely to the parameters for that block [defined for autodocs above](#autodocs-changes). + +##### Meta block + +The primary change of the `Meta` block is the ability to attach to CSF files with `` as described above. + +##### Description block, `parameters.notes` and `parameters.info` + +In 6.5 the Description doc block accepted a range of different props, `markdown`, `type` and `children` as a way to customize the content. +The props have been simplified and the block now only accepts an `of` prop, which can be a reference to either a CSF file, a default export (meta) or a story export, depending on which description you want to be shown. See TDB DOCS LINK for a deeper explanation of the new prop. + +`parameters.notes` and `parameters.info` have been deprecated as a way to specify descriptions. Instead use JSDoc comments above the default export or story export, or use `parameters.docs.description.story | component` directly. See TDB DOCS LINK for a deeper explanation on how to write descriptions. + +##### Story block + +To reference a story in a MDX file, you should reference it with `of`: + +```mdx +import { Meta, Story } from '@storybook/blocks'; +import * as ComponentStories from './some-component.stories'; + + + + +``` + +You can also reference a story from a different component: + +```mdx +import { Meta, Story } from '@storybook/blocks'; +import * as ComponentStories from './some-component.stories'; +import * as SecondComponentStories from './second-component.stories'; + + + + +``` + +Referencing stories by `id="xyz--abc"` is deprecated and should be replaced with `of={}` as above. + +##### Source block + +The source block now references a single story, the component, or a CSF file itself via the `of={}` parameter. + +Referencing stories by `id="xyz--abc"` is deprecated and should be replaced with `of={}` as above. Referencing multiple stories via `ids={["xyz--abc"]}` is now deprecated and should be avoided (instead use two source blocks). + +#### Canvas block + +The Canvas block follows the same changes as [the Story block described above](#story-block). + +Previously the Canvas block accepted children (Story blocks) as a way to reference stories. That has now been replaced with the `of={}` prop that accepts a reference to _a story_. +That also means the Canvas block no longer supports containing multiple stories or elements, and thus the props related to that - `isColumn` and `columns` - have also been deprecated. + +- To pass props to the inner Story block use the `story={{ }}` prop +- Similarly, to pass props to the inner Source block use the `source={{ }}` prop. +- The `mdxSource` prop has been deprecated in favor of using `source={{ code: '...' }}` +- The `withSource` prop has been renamed to `sourceState` + +Here's a full example of the new API: + +```mdx +import { Meta, Canvas } from '@storybook/blocks'; +import * as ComponentStories from './some-component.stories'; + + + + +``` + +##### ArgsTable block + +The `ArgsTable` block is now deprecated, and two new blocks: `ArgsTypes` and `Controls` should be preferred. + +- `` will render a readonly table of args/props descriptions for a story, CSF file or component. If `of` ommitted and the MDX file is attached it will render the arg types defined at the CSF file level. + +- `` will render the controls for a story (or the primary story if `of` is omitted and the MDX file is attached). + +The following props are not supported in the new blocks: + +- `components` - to render more than one component in a single table +- `showComponent` to show the component's props as well as the story's args +- the `subcomponents` annotation to show more components on the table. +- `of="^"` to reference the meta (just omit `of` in that case, for `ArgTypes`). +- `story="^"` to reference the primary story (just omit `of` in that case, for `Controls`). +- `story="."` to reference the current story (this no longer makes sense in Docs 2). +- `story="name"` to reference a story (use `of={}`). + +#### Configuring Autodocs As in 6.x, you can override the docs container to configure docs further. This is the container that each docs entry is rendered inside: @@ -853,6 +950,8 @@ export const parameters = { } ``` +Note that the container must be implemented as a _React component_. + You likely want to use the `DocsContainer` component exported by `@storybook/blocks` and consider the following examples: **Overriding theme**: @@ -882,37 +981,39 @@ export const MyDocsContainer = (props) => ( **_NOTE_**: due to breaking changes in MDX2, such override will _only_ apply to elements you create via the MDX syntax, not pure HTML -- ie. `## content` not `

content

`. -#### External Docs - -Storybook 7.0 can be used in the above way in externally created projects (i.e. custom docs sites). Your `.mdx` files defined as above should be portable to other contexts. You simply need to render them in an `ExternalDocs` component: - -```js -// In your project somewhere: -import { ExternalDocs } from '@storybook/blocks'; - -// Import all the preview entries from addons that need to operate in your external docs, -// at a minimum likely your project's and your renderer's. -import * as reactAnnotations from '@storybook/react/preview'; -import * as previewAnnotations from '../.storybook/preview'; - -export default function App({ Component, pageProps }) { - return ( - - - - ); -} -``` - #### MDX2 upgrade Storybook 7 Docs uses MDXv2 instead of MDXv1. This means an improved syntax, support for inline JS expression, and improved performance among [other benefits](https://mdxjs.com/blog/v2/). -If you use `.stories.mdx` files in your project, you may need to edit them since MDX2 contains [breaking changes](https://mdxjs.com/migrating/v2/#update-mdx-files). +If you use `.stories.mdx` files in your project, you'll probably need to edit them since MDX2 contains [breaking changes](https://mdxjs.com/migrating/v2/#update-mdx-files). In general, MDX2 is stricter and more structured than MDX1. -We will update this section with specific pointers based on user feedback during the prerelease period and probably add an codemod to help streamline the upgrade before final 7.0 release. +We've provided an automigration, `mdx1to2` that makes a few of these changes automatically. For example, `mdx1to2` automatically converts MDX1-style HTML comments into MDX2-style JSX comments to save you time. -As part of the upgrade we deleted the codemod `mdx-to-csf` and will be replacing it with a more sophisticated version prior to release. +Unfortunately, the set of changes from MDX1 to MDX2 is vast, and many changes are subtle, so the bulk of the migration will be manual. You can use the [MDX Playground](https://mdxjs.com/playground/) to try out snippets interactively. + +#### Legacy MDX1 support + +If you get stuck with the [MDX2 upgrade](#mdx2-upgrade), we also provide opt-in legacy MDX1 support. This is intended as a temporary solution while you upgrade your Storybook; MDX1 will be discontinued in Storybook 8.0. The MDX1 library is no longer maintained and installing it results in `npm audit` security warnings. + +To process your `.stories.mdx` files with MDX1, first install the `@storybook/mdx1-csf` package in your project: + +``` +yarn add -D @storybook/mdx1-csf@next +``` + +Then enable the `legacyMdx1` feature flag in your `.storybook/main.js` file: + +```js +export default { + features: { + legacyMdx1: true, + } +} +``` + +NOTE: This only affects `.(stories|story).mdx` files. Notably, if you want to use Storybook 7's "pure" `.mdx` format, you'll need to use MDX2 for that. + +NOTE: Legacy MDX1 support is only for Webpack projects. There is currently no legacy support for Vite. #### Default docs styles will leak into non-story user components diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index c11c90d1cfc..9f759517889 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/addon-highlight": "7.0.0-beta.34", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "axe-core": "^4.2.0", "lodash": "^4.17.21", "react-resize-detector": "^7.1.2" @@ -104,7 +104,7 @@ "./src/preview.tsx" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Accessibility", "icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 8d98e10cd50..95671330863 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "dequal": "^2.0.2", "lodash": "^4.17.21", "polished": "^4.2.2", @@ -121,7 +121,7 @@ "./src/preview.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Actions", "unsupportedFrameworks": [ diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index c97293ccea3..e997136c09e 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "memoizerific": "^1.11.3", "ts-dedent": "^2.0.0" }, @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Backgrounds", "icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 73d0926a9b3..7cb09c9a190 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/blocks": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, @@ -102,7 +102,7 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Controls", "icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 023f569c848..bc85a9e8e20 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", @@ -103,19 +103,19 @@ "@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.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/csf-plugin": "7.0.0-beta.31", - "@storybook/csf-tools": "7.0.0-beta.31", + "@storybook/blocks": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/csf-plugin": "7.0.0-beta.34", + "@storybook/csf-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", "@storybook/mdx2-csf": "next", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/postinstall": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", - "fs-extra": "^9.0.1", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/postinstall": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", + "fs-extra": "^11.1.0", "remark-external-links": "^8.0.0", "remark-slug": "^6.0.0", "ts-dedent": "^2.0.0" @@ -126,9 +126,15 @@ "typescript": "~4.9.3" }, "peerDependencies": { + "@storybook/mdx1-csf": ">=1.0.0-0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, + "peerDependenciesMeta": { + "@storybook/mdx1-csf": { + "optional": true + } + }, "publishConfig": { "access": "public" }, @@ -141,7 +147,7 @@ "./src/shims/mdx-react-shim.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Docs", "icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png", diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 3b7ac4a87a7..397f0172569 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -6,7 +6,9 @@ import { dedent } from 'ts-dedent'; import type { IndexerOptions, StoryIndexer, DocsOptions, Options } from '@storybook/types'; import type { CsfPluginOptions } from '@storybook/csf-plugin'; import type { JSXOptions } from '@storybook/mdx2-csf'; +import { global } from '@storybook/global'; import { loadCsf } from '@storybook/csf-tools'; +import { logger } from '@storybook/node-logger'; import { ensureReactPeerDeps } from './ensure-react-peer-deps'; async function webpack( @@ -73,7 +75,12 @@ async function webpack( `); } - const mdxLoader = require.resolve('@storybook/mdx2-csf/loader'); + const mdxVersion = global.FEATURES?.legacyMdx1 ? 'MDX1' : 'MDX2'; + logger.info(`Addon-docs: using ${mdxVersion}`); + + const mdxLoader = global.FEATURES?.legacyMdx1 + ? require.resolve('@storybook/mdx1-csf/loader') + : require.resolve('@storybook/mdx2-csf/loader'); let rules = module.rules || []; if (transcludeMarkdown) { @@ -135,7 +142,9 @@ async function webpack( const storyIndexers = (indexers: StoryIndexer[] | null) => { const mdxIndexer = async (fileName: string, opts: IndexerOptions) => { let code = (await fs.readFile(fileName, 'utf-8')).toString(); - const { compile } = await import('@storybook/mdx2-csf'); + const { compile } = global.FEATURES?.legacyMdx1 + ? await import('@storybook/mdx1-csf') + : await import('@storybook/mdx2-csf'); code = await compile(code, {}); return loadCsf(code, { ...opts, fileName }).parse(); }; diff --git a/code/addons/docs/src/typings.d.ts b/code/addons/docs/src/typings.d.ts index 18881b5e33b..957b4b62a94 100644 --- a/code/addons/docs/src/typings.d.ts +++ b/code/addons/docs/src/typings.d.ts @@ -4,9 +4,20 @@ declare module 'remark-external-links'; declare module 'babel-plugin-react-docgen'; declare module 'acorn-jsx'; declare module 'vue/dist/vue'; +declare module '@storybook/mdx1-csf'; declare module 'sveltedoc-parser' { export function parse(options: any): Promise; } +declare var FEATURES: + | { + storyStoreV7?: boolean; + interactionsDebugger?: boolean; + breakingChangesV7?: boolean; + argTypeTargetsV7?: boolean; + legacyMdx1?: boolean; + } + | undefined; + declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined; diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index df6fc1d2715..c3779d0c5e2 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/addon-backgrounds": "7.0.0-beta.31", - "@storybook/addon-controls": "7.0.0-beta.31", - "@storybook/addon-docs": "7.0.0-beta.31", - "@storybook/addon-highlight": "7.0.0-beta.31", - "@storybook/addon-measure": "7.0.0-beta.31", - "@storybook/addon-outline": "7.0.0-beta.31", - "@storybook/addon-toolbars": "7.0.0-beta.31", - "@storybook/addon-viewport": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", + "@storybook/addon-actions": "7.0.0-beta.34", + "@storybook/addon-backgrounds": "7.0.0-beta.34", + "@storybook/addon-controls": "7.0.0-beta.34", + "@storybook/addon-docs": "7.0.0-beta.34", + "@storybook/addon-highlight": "7.0.0-beta.34", + "@storybook/addon-measure": "7.0.0-beta.34", + "@storybook/addon-outline": "7.0.0-beta.34", + "@storybook/addon-toolbars": "7.0.0-beta.34", + "@storybook/addon-viewport": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/vue": "7.0.0-beta.31", + "@storybook/vue": "7.0.0-beta.34", "typescript": "^4.9.3" }, "peerDependencies": { @@ -166,5 +166,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 76f7b20a03e..aa1d07c7f79 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31" + "@storybook/preview-api": "7.0.0-beta.34" }, "devDependencies": { "@types/webpack-env": "^1.16.0", @@ -78,7 +78,7 @@ "./src/preview.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "sbmodern": "dist/modern/index.js", "storybook": { "displayName": "Highlight", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index bcd2f6f6e33..1d0a26d18bf 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/instrumenter": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "jest-mock": "^27.0.6", "polished": "^4.2.2", "ts-dedent": "^2.2.0" @@ -118,7 +118,7 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Interactions", "unsupportedFrameworks": [ diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 95834e567de..33cb94a19fe 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", "react-resize-detector": "^7.1.2", "upath": "^1.2.0" }, @@ -105,7 +105,7 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Jest", "icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 5f4292eb3a6..c89b85ab1f1 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", @@ -80,19 +80,19 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/csf": "next", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/router": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/router": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "prop-types": "^15.7.2", "ts-dedent": "^2.0.0" }, "devDependencies": { - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "typescript": "~4.9.3" }, "peerDependencies": { @@ -119,7 +119,7 @@ ], "post": "./scripts/fix-preview-api-reference.ts" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Links", "icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 162166ced6a..5b4aa72efe9 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31" + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34" }, "devDependencies": { "typescript": "~4.9.3" @@ -108,7 +108,7 @@ "./src/preview.tsx" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Measure", "unsupportedFrameworks": [ diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index fa7491533b4..3816ef7cbb8 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Outline", "unsupportedFrameworks": [ diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index 3695e0f7b39..a79210ce97e 100644 --- a/code/addons/storyshots-core/package.json +++ b/code/addons/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/client-api": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-webpack": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@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.31", - "@storybook/angular": "7.0.0-beta.31", - "@storybook/react": "7.0.0-beta.31", - "@storybook/vue": "7.0.0-beta.31", - "@storybook/vue3": "7.0.0-beta.31", + "@storybook/addon-docs": "7.0.0-beta.34", + "@storybook/angular": "7.0.0-beta.34", + "@storybook/react": "7.0.0-beta.34", + "@storybook/vue": "7.0.0-beta.34", + "@storybook/vue3": "7.0.0-beta.34", "babel-loader": "^9.1.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", @@ -143,7 +143,7 @@ "access": "public" }, "bundler": {}, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Storyshots", "icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png", diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index a7cc09d5c03..a472a6180b2 100644 --- a/code/addons/storyshots-puppeteer/package.json +++ b/code/addons/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@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.31", + "@storybook/addon-storyshots": "7.0.0-beta.34", "puppeteer": ">=2.0.0" }, "peerDependenciesMeta": { @@ -61,5 +61,5 @@ "access": "public" }, "bundler": {}, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index dadbf9e3ab2..6c3e2a6bec9 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "View a story’s 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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/router": "7.0.0-beta.31", - "@storybook/source-loader": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/router": "7.0.0-beta.34", + "@storybook/source-loader": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", "estraverse": "^5.2.0", "prop-types": "^15.7.2", "react-syntax-highlighter": "^15.5.0" @@ -92,7 +92,7 @@ "./src/preset.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Storysource", "icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 08758bbf4fd..91e7f5b51e0 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34" }, "devDependencies": { "typescript": "~4.9.3" @@ -99,7 +99,7 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Toolbars", "icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index c752d33e519..d981a1364a7 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", @@ -73,13 +73,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", "memoizerific": "^1.11.3", "prop-types": "^15.7.2" }, @@ -109,7 +109,7 @@ "./src/preview.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807", + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea", "storybook": { "displayName": "Viewport", "icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png", diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index b3675a20c72..526c84df843 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", @@ -36,20 +36,20 @@ "prep": "../../../scripts/prepare/tsc.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.31", - "@storybook/cli": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/core-webpack": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/cli": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/core-webpack": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/node": "^16.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", @@ -67,16 +67,17 @@ }, "devDependencies": { "@angular-devkit/architect": "^0.1500.4", - "@angular-devkit/build-angular": "^15.0.4", - "@angular-devkit/core": "^15.0.4", - "@angular/cli": "^15.0.4", - "@angular/common": "^15.0.4", - "@angular/compiler": "^15.0.4", - "@angular/compiler-cli": "^15.0.4", - "@angular/core": "^15.0.4", - "@angular/forms": "^15.0.4", - "@angular/platform-browser": "^15.0.4", - "@angular/platform-browser-dynamic": "^15.0.4", + "@angular-devkit/build-angular": "^15.1.1", + "@angular-devkit/core": "^15.1.1", + "@angular/animations": "^15.1.1", + "@angular/cli": "^15.1.1", + "@angular/common": "^15.1.1", + "@angular/compiler": "^15.1.1", + "@angular/compiler-cli": "^15.1.1", + "@angular/core": "^15.1.1", + "@angular/forms": "^15.1.1", + "@angular/platform-browser": "^15.1.1", + "@angular/platform-browser-dynamic": "^15.1.1", "@types/rimraf": "^3.0.2", "@types/tmp": "^0.2.3", "cross-spawn": "^7.0.3", @@ -90,17 +91,17 @@ "zone.js": "^0.12.0" }, "peerDependencies": { - "@angular-devkit/architect": ">=0.1400.0", - "@angular-devkit/build-angular": ">=14.0.0", - "@angular-devkit/core": ">=14.0.0", - "@angular/cli": ">=14.0.0", - "@angular/common": ">=14.0.0", - "@angular/compiler": ">=14.0.0", - "@angular/compiler-cli": ">=14.0.0", - "@angular/core": ">=14.0.0", - "@angular/forms": ">=14.0.0", - "@angular/platform-browser": ">=14.0.0", - "@angular/platform-browser-dynamic": ">=14.0.0", + "@angular-devkit/architect": ">=0.1400.0 < 0.1600.0", + "@angular-devkit/build-angular": ">=14.1.0 < 16.0.0", + "@angular-devkit/core": ">=14.1.0 < 16.0.0", + "@angular/cli": ">=14.1.0 < 16.0.0", + "@angular/common": ">=14.1.0 < 16.0.0", + "@angular/compiler": ">=14.1.0 < 16.0.0", + "@angular/compiler-cli": ">=14.1.0 < 16.0.0", + "@angular/core": ">=14.1.0 < 16.0.0", + "@angular/forms": ">=14.1.0 < 16.0.0", + "@angular/platform-browser": ">=14.1.0 < 16.0.0", + "@angular/platform-browser-dynamic": ">=14.1.0 < 16.0.0", "@babel/core": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -123,5 +124,5 @@ "bundler": { "tsConfig": "tsconfig.build.json" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/angular/src/builders/build-storybook/index.ts b/code/frameworks/angular/src/builders/build-storybook/index.ts index 5d10ddfbd03..d39fad679d3 100644 --- a/code/frameworks/angular/src/builders/build-storybook/index.ts +++ b/code/frameworks/angular/src/builders/build-storybook/index.ts @@ -22,7 +22,7 @@ import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-ha export type StorybookBuilderOptions = JsonObject & { browserTarget?: string | null; tsConfig?: string; - docsMode: boolean; + docs: boolean; compodoc: boolean; compodocArgs: string[]; styles?: StyleElement[]; @@ -59,7 +59,7 @@ function commandBuilder( stylePreprocessorOptions, styles, configDir, - docsMode, + docs, loglevel, outputDir, quiet, @@ -70,7 +70,7 @@ function commandBuilder( const standaloneOptions: StandaloneBuildOptions = { packageJson: readUpSync({ cwd: __dirname }).packageJson, configDir, - docsMode, + ...(docs ? { docs } : {}), loglevel, outputDir, quiet, diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index 29ebe3b5e19..43c55428d1d 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -34,7 +34,7 @@ "description": "Suppress verbose build output.", "default": false }, - "docsMode": { + "docs": { "type": "boolean", "description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/react/writing-docs/build-documentation#preview-storybooks-documentation.", "default": false @@ -47,13 +47,19 @@ "compodocArgs": { "type": "array", "description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.", - "default": ["-e", "json"], + "default": [ + "-e", + "json" + ], "items": { "type": "string" } }, "webpackStatsJson": { - "type": ["boolean", "string"], + "type": [ + "boolean", + "string" + ], "description": "Write Webpack Stats JSON to disk", "default": false }, @@ -104,7 +110,9 @@ } }, "additionalProperties": false, - "required": ["input"] + "required": [ + "input" + ] }, { "type": "string", @@ -113,4 +121,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/frameworks/angular/src/builders/start-storybook/index.ts b/code/frameworks/angular/src/builders/start-storybook/index.ts index 6678cf50177..abf0e59f237 100644 --- a/code/frameworks/angular/src/builders/start-storybook/index.ts +++ b/code/frameworks/angular/src/builders/start-storybook/index.ts @@ -22,7 +22,7 @@ import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-ha export type StorybookBuilderOptions = JsonObject & { browserTarget?: string | null; tsConfig?: string; - docsMode: boolean; + docs: boolean; compodoc: boolean; compodocArgs: string[]; styles?: StyleElement[]; @@ -68,7 +68,7 @@ function commandBuilder( styles, ci, configDir, - docsMode, + docs, host, https, port, @@ -84,7 +84,7 @@ function commandBuilder( packageJson: readUpSync({ cwd: __dirname }).packageJson, ci, configDir, - docsMode, + ...(docs ? { docs } : {}), host, https, port, diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index bfc83a59fe2..e81e0579b8d 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -61,7 +61,7 @@ "description": "Suppress verbose build output.", "default": false }, - "docsMode": { + "docs": { "type": "boolean", "description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/react/writing-docs/build-documentation#preview-storybooks-documentation.", "default": false @@ -74,7 +74,10 @@ "compodocArgs": { "type": "array", "description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.", - "default": ["-e", "json"], + "default": [ + "-e", + "json" + ], "items": { "type": "string" } @@ -126,7 +129,9 @@ } }, "additionalProperties": false, - "required": ["input"] + "required": [ + "input" + ] }, { "type": "string", @@ -135,4 +140,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts index 0ec053879ee..9daf6b6a86d 100644 --- a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts +++ b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts @@ -1,4 +1,3 @@ -import { BuilderContext } from '@angular-devkit/architect'; import { LoggerApi } from '@angular-devkit/core/src/logger'; import { take } from 'rxjs/operators'; @@ -41,7 +40,7 @@ describe('runCompodoc', () => { { workspaceRoot: 'path/to/project', logger: builderContextLoggerMock, - } as BuilderContext + } ) .pipe(take(1)) .subscribe(); @@ -65,7 +64,7 @@ describe('runCompodoc', () => { { workspaceRoot: 'path/to/project', logger: builderContextLoggerMock, - } as BuilderContext + } ) .pipe(take(1)) .subscribe(); @@ -89,7 +88,7 @@ describe('runCompodoc', () => { { workspaceRoot: 'path/to/project', logger: builderContextLoggerMock, - } as BuilderContext + } ) .pipe(take(1)) .subscribe(); @@ -112,7 +111,7 @@ describe('runCompodoc', () => { { workspaceRoot: 'path/to/project', logger: builderContextLoggerMock, - } as BuilderContext + } ) .pipe(take(1)) .subscribe(); @@ -135,7 +134,7 @@ describe('runCompodoc', () => { { workspaceRoot: 'path/to/project', logger: builderContextLoggerMock, - } as BuilderContext + } ) .pipe(take(1)) .subscribe(); diff --git a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts index 5716c9464dd..6cc4b61e2c9 100644 --- a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts +++ b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts @@ -1,9 +1,10 @@ -import { NgModule, enableProdMode, Type, ApplicationRef } from '@angular/core'; +import { ApplicationRef, enableProdMode, NgModule } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; +import { provideAnimations, BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { Subject, BehaviorSubject } from 'rxjs'; +import { BehaviorSubject, Subject } from 'rxjs'; import { stringify } from 'telejson'; -import { ICollection, StoryFnAngularReturnType, Parameters } from '../types'; +import { ICollection, Parameters, StoryFnAngularReturnType } from '../types'; import { getApplication } from './StorybookModule'; import { storyPropsProvider } from './StorybookProvider'; import { componentNgModules } from './StorybookWrapperComponent'; @@ -97,6 +98,16 @@ export abstract class AbstractRenderer { const newStoryProps$ = new BehaviorSubject(storyFnAngular.props); + const hasAnimationsDefined = + !!storyFnAngular.moduleMetadata?.imports?.includes(BrowserAnimationsModule); + + if (hasAnimationsDefined && storyFnAngular?.moduleMetadata?.imports) { + // eslint-disable-next-line no-param-reassign + storyFnAngular.moduleMetadata.imports = storyFnAngular.moduleMetadata.imports.filter( + (importedModule) => importedModule !== BrowserAnimationsModule + ); + } + if ( !this.fullRendererRequired({ storyFnAngular, @@ -122,7 +133,10 @@ export abstract class AbstractRenderer { const application = getApplication({ storyFnAngular, component, targetSelector }); const applicationRef = await bootstrapApplication(application, { - providers: [storyPropsProvider(newStoryProps$)], + providers: [ + ...(hasAnimationsDefined ? [provideAnimations()] : []), + storyPropsProvider(newStoryProps$), + ], }); applicationRefs.add(applicationRef); diff --git a/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts b/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts index 9c3efc08721..e1efad763da 100644 --- a/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts +++ b/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts @@ -1,28 +1,22 @@ -import { CommonModule } from '@angular/common'; import { AfterViewInit, - ElementRef, - OnDestroy, - Type, ChangeDetectorRef, Component, + ElementRef, Inject, + NgModule, + OnDestroy, + Type, ViewChild, ViewContainerRef, - NgModule, } from '@angular/core'; -import { Subscription, Subject } from 'rxjs'; +import { Subject, Subscription } from 'rxjs'; import { map, skip } from 'rxjs/operators'; import { ICollection, NgModuleMetadata } from '../types'; import { STORY_PROPS } from './StorybookProvider'; -import { - ComponentInputsOutputs, - getComponentInputsOutputs, - isDeclarable, - isStandaloneComponent, -} from './utils/NgComponentAnalyzer'; -import { isComponentAlreadyDeclaredInModules } from './utils/NgModulesAnalyzer'; +import { ComponentInputsOutputs, getComponentInputsOutputs } from './utils/NgComponentAnalyzer'; +import { extractDeclarations, extractImports, extractProviders } from './utils/PropertyExtractor'; const getNonInputsOutputsProps = ( ngComponentInputsOutputs: ComponentInputsOutputs, @@ -37,6 +31,7 @@ const getNonInputsOutputsProps = ( return Object.keys(props).filter((k) => ![...inputs, ...outputs].includes(k)); }; +// component modules cache export const componentNgModules = new Map>(); /** @@ -57,56 +52,33 @@ export const createStorybookWrapperComponent = ( // storyComponent was not provided. const viewChildSelector = storyComponent ?? '__storybook-noop'; - const isStandalone = isStandaloneComponent(storyComponent); - // Look recursively (deep) if the component is not already declared by an import module - const requiresComponentDeclaration = - isDeclarable(storyComponent) && - !isComponentAlreadyDeclaredInModules( - storyComponent, - moduleMetadata.declarations, - moduleMetadata.imports - ) && - !isStandalone; - - const providersNgModules = (moduleMetadata.providers ?? []).map((provider) => { - if (!componentNgModules.get(provider)) { - @NgModule({ - providers: [provider], - }) - class ProviderModule {} - - componentNgModules.set(provider, ProviderModule); - } - - return componentNgModules.get(provider); - }); - - if (!componentNgModules.get(storyComponent)) { - const declarations = [ - ...(requiresComponentDeclaration ? [storyComponent] : []), - ...(moduleMetadata.declarations ?? []), - ]; + const imports = extractImports(moduleMetadata); + const declarations = extractDeclarations(moduleMetadata, storyComponent); + const providers = extractProviders(moduleMetadata); + // Only create a new module if it doesn't already exist + // This is to prevent the module from being recreated on every story change + // Declarations & Imports are only added once + // Providers are added on every story change to allow for story-specific providers + let ngModule = componentNgModules.get(storyComponent); + if (!ngModule) { @NgModule({ declarations, - imports: [CommonModule, ...(moduleMetadata.imports ?? [])], - exports: [...declarations, ...(moduleMetadata.imports ?? [])], + imports, + exports: [...declarations, ...imports], }) class StorybookComponentModule {} componentNgModules.set(storyComponent, StorybookComponentModule); + ngModule = componentNgModules.get(storyComponent); } @Component({ selector, template, standalone: true, - imports: [ - CommonModule, - componentNgModules.get(storyComponent), - ...providersNgModules, - ...(isStandalone ? [storyComponent] : []), - ], + imports: [ngModule], + providers, styles, schemas: moduleMetadata.schemas, }) diff --git a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.test.ts b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.test.ts index 076dff84a73..a274211132b 100644 --- a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.test.ts +++ b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.test.ts @@ -1,5 +1,5 @@ import { Component, NgModule } from '@angular/core'; -import { isComponentAlreadyDeclaredInModules } from './NgModulesAnalyzer'; +import { isComponentAlreadyDeclared } from './NgModulesAnalyzer'; const FooComponent = Component({})(class {}); @@ -11,16 +11,14 @@ const AlphaModule = NgModule({ imports: [BetaModule] })(class {}); describe('isComponentAlreadyDeclaredInModules', () => { it('should return true when the component is already declared in one of modules', () => { - expect(isComponentAlreadyDeclaredInModules(FooComponent, [], [AlphaModule])).toEqual(true); + expect(isComponentAlreadyDeclared(FooComponent, [], [AlphaModule])).toEqual(true); }); it('should return true if the component is in moduleDeclarations', () => { - expect( - isComponentAlreadyDeclaredInModules(BarComponent, [BarComponent], [AlphaModule]) - ).toEqual(true); + expect(isComponentAlreadyDeclared(BarComponent, [BarComponent], [AlphaModule])).toEqual(true); }); it('should return false if the component is not declared', () => { - expect(isComponentAlreadyDeclaredInModules(BarComponent, [], [AlphaModule])).toEqual(false); + expect(isComponentAlreadyDeclared(BarComponent, [], [AlphaModule])).toEqual(false); }); }); diff --git a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts index 24bdae58d5b..a63fdee1822 100644 --- a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts +++ b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts @@ -7,7 +7,7 @@ const reflectionCapabilities = new ReflectionCapabilities(); * * Checks recursively if the component has already been declared in all import Module */ -export const isComponentAlreadyDeclaredInModules = ( +export const isComponentAlreadyDeclared = ( componentToFind: any, moduleDeclarations: any[], moduleImports: any[] @@ -29,7 +29,7 @@ export const isComponentAlreadyDeclaredInModules = ( // Not an NgModule return false; } - return isComponentAlreadyDeclaredInModules( + return isComponentAlreadyDeclared( componentToFind, extractedNgModuleMetadata.declarations, extractedNgModuleMetadata.imports diff --git a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts new file mode 100644 index 00000000000..426e78ba168 --- /dev/null +++ b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.test.ts @@ -0,0 +1,107 @@ +import { CommonModule } from '@angular/common'; +import { Component, Directive, Injectable, InjectionToken, NgModule } from '@angular/core'; +import { extractDeclarations, extractImports, extractProviders } from './PropertyExtractor'; + +const TEST_TOKEN = new InjectionToken('testToken'); +const TestTokenProvider = { provide: TEST_TOKEN, useValue: 123 }; +const TestService = Injectable()(class {}); +const TestComponent1 = Component({})(class {}); +const TestComponent2 = Component({})(class {}); +const StandaloneTestComponent = Component({ standalone: true })(class {}); +const TestDirective = Directive({})(class {}); +const TestModuleWithDeclarations = NgModule({ declarations: [TestComponent1] })(class {}); +const TestModuleWithImportsAndProviders = NgModule({ + imports: [TestModuleWithDeclarations], + providers: [TestTokenProvider], +})(class {}); + +describe('PropertyExtractor', () => { + describe('extractImports', () => { + it('should return an array of imports', () => { + const imports = extractImports({ imports: [TestModuleWithImportsAndProviders] }); + expect(imports).toEqual([CommonModule, TestModuleWithImportsAndProviders]); + }); + + it('should return an array of unique imports without providers', () => { + const imports = extractImports({ + imports: [ + TestModuleWithImportsAndProviders, + { ngModule: TestModuleWithImportsAndProviders, providers: [] }, + ], + }); + expect(imports).toEqual([CommonModule, TestModuleWithImportsAndProviders]); + }); + }); + + describe('extractDeclarations', () => { + it('should return an array of declarations', () => { + const declarations = extractDeclarations({ declarations: [TestComponent1] }, TestComponent2); + expect(declarations).toEqual([TestComponent1, TestComponent2]); + }); + + it('should ignore pre-declared components', () => { + // TestComponent1 is declared as part of TestModuleWithDeclarations + // TestModuleWithDeclarations is imported by TestModuleWithImportsAndProviders + const declarations = extractDeclarations( + { + imports: [TestModuleWithImportsAndProviders], + declarations: [TestComponent2, StandaloneTestComponent, TestDirective], + }, + TestComponent1 + ); + expect(declarations).toEqual([TestComponent2, StandaloneTestComponent, TestDirective]); + }); + + it('should ignore standalone components', () => { + const declarations = extractDeclarations( + { + imports: [TestModuleWithImportsAndProviders], + declarations: [TestComponent1, TestComponent2, TestDirective], + }, + StandaloneTestComponent + ); + expect(declarations).toEqual([TestComponent1, TestComponent2, TestDirective]); + }); + + it('should ignore non components/directives/pipes', () => { + const declarations = extractDeclarations( + { + imports: [TestModuleWithImportsAndProviders], + declarations: [TestComponent1, TestComponent2, StandaloneTestComponent], + }, + TestService + ); + expect(declarations).toEqual([TestComponent1, TestComponent2, StandaloneTestComponent]); + }); + }); + + describe('extractProviders', () => { + it('should return an array of providers', () => { + const providers = extractProviders({ + providers: [TestService], + }); + expect(providers).toEqual([TestService]); + }); + + it('should return an array of providers extracted from ModuleWithProviders', () => { + const providers = extractProviders({ + imports: [{ ngModule: TestModuleWithImportsAndProviders, providers: [TestService] }], + }); + expect(providers).toEqual([TestService]); + }); + + it('should return an array of unique providers', () => { + const providers = extractProviders({ + imports: [{ ngModule: TestModuleWithImportsAndProviders, providers: [TestService] }], + providers: [TestService, { provide: TEST_TOKEN, useValue: 123 }], + }); + expect(providers).toEqual([ + TestService, + { + provide: new InjectionToken('testToken'), + useValue: 123, + }, + ]); + }); + }); +}); diff --git a/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts new file mode 100644 index 00000000000..fc4c0638b1b --- /dev/null +++ b/code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts @@ -0,0 +1,78 @@ +import { CommonModule } from '@angular/common'; +import { Provider } from '@angular/core'; +import { NgModuleMetadata } from '../../types'; +import { isDeclarable, isStandaloneComponent } from './NgComponentAnalyzer'; +import { isComponentAlreadyDeclared } from './NgModulesAnalyzer'; + +const uniqueArray = (arr: any[]) => { + return arr.flat(Number.MAX_VALUE).filter((value, index, self) => self.indexOf(value) === index); +}; + +/** + * Extract Imports from NgModule + * + * CommonModule is always imported + * + * metadata.imports are flattened deeply and extracted into a new array + * + * - If ModuleWithProviders (e.g. forRoot() & forChild() ) is used, the ngModule is extracted without providers. + * + */ +export const extractImports = (metadata: NgModuleMetadata) => { + const imports = [CommonModule]; + + const modules = (metadata.imports || []).flat(Number.MAX_VALUE); + const withProviders = modules.filter((moduleDef) => !!moduleDef?.ngModule); + const withoutProviders = modules.filter((moduleDef) => !withProviders.includes(moduleDef)); + + return uniqueArray([ + imports, + withoutProviders, + withProviders.map((moduleDef) => moduleDef.ngModule), + ]); +}; + +/** + * Extract providers from NgModule + * + * - A new array is returned with: + * - metadata.providers + * - providers from each **ModuleWithProviders** (e.g. forRoot() & forChild() ) + * + * - Use this in combination with extractImports to get all providers for a specific module + * + */ +export const extractProviders = (metadata: NgModuleMetadata): Provider[] => { + const providers = (metadata.providers || []) as Provider[]; + + const moduleProviders: Provider[] = (metadata.imports || []) + .flat(Number.MAX_VALUE) + .filter((moduleDef) => !!moduleDef?.ngModule) + .map((moduleDef) => moduleDef.providers || []); + + return uniqueArray([].concat(moduleProviders, providers)); +}; + +/** + * Extract declarations from NgModule + * + * - If a story component is provided, it will be added to the declarations array if: + * - It is a component or directive or pipe + * - It is not already declared + * - It is not a standalone component + * + */ +export const extractDeclarations = (metadata: NgModuleMetadata, storyComponent?: any) => { + const declarations = metadata.declarations || []; + if (storyComponent) { + const isStandalone = isStandaloneComponent(storyComponent); + const isDeclared = isComponentAlreadyDeclared(storyComponent, declarations, metadata.imports); + + const requiresDeclaration = isDeclarable(storyComponent) && !isDeclared && !isStandalone; + + if (requiresDeclaration) { + declarations.push(storyComponent); + } + } + return uniqueArray(declarations); +}; diff --git a/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.css b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.css new file mode 100644 index 00000000000..c7401b7f181 --- /dev/null +++ b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.css @@ -0,0 +1,13 @@ +:host { + display: block; + margin-top: 1rem; +} + +.open-close-container { + border: 1px solid #dddddd; + margin-top: 1em; + padding: 20px 20px 0px 20px; + color: #000000; + font-weight: bold; + font-size: 20px; +} diff --git a/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.html b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.html new file mode 100644 index 00000000000..c7c50baa228 --- /dev/null +++ b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.html @@ -0,0 +1,7 @@ + + +
+

The box is now {{ isOpen ? 'Open' : 'Closed' }}!

+
diff --git a/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.ts b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.ts new file mode 100644 index 00000000000..cfc78f6a666 --- /dev/null +++ b/code/frameworks/angular/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.ts @@ -0,0 +1,39 @@ +import { Component } from '@angular/core'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { trigger, state, style, transition, animate } from '@angular/animations'; + +@Component({ + selector: 'app-open-close', + animations: [ + trigger('openClose', [ + // ... + state( + 'open', + style({ + height: '200px', + opacity: 1, + backgroundColor: 'yellow', + }) + ), + state( + 'closed', + style({ + height: '100px', + opacity: 0.8, + backgroundColor: 'blue', + }) + ), + transition('open => closed', [animate('0.1s')]), + transition('closed => open', [animate('0.1s')]), + ]), + ], + templateUrl: 'open-close.component.html', + styleUrls: ['open-close.component.css'], +}) +export class OpenCloseComponent { + isOpen = true; + + toggle() { + this.isOpen = !this.isOpen; + } +} diff --git a/code/frameworks/angular/template/stories/core/moduleMetadata/with-browser-animations.stories.ts b/code/frameworks/angular/template/stories/core/moduleMetadata/with-browser-animations.stories.ts new file mode 100644 index 00000000000..d2c6e514bd2 --- /dev/null +++ b/code/frameworks/angular/template/stories/core/moduleMetadata/with-browser-animations.stories.ts @@ -0,0 +1,30 @@ +import { Meta, StoryFn } from '@storybook/angular'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { within, userEvent } from '@storybook/testing-library'; +import { expect } from '@storybook/jest'; +import { OpenCloseComponent } from './angular-src/open-close-component/open-close.component'; + +export default { + component: OpenCloseComponent, + parameters: { + chromatic: { delay: 100 }, + }, +} as Meta; + +export const WithBrowserAnimations: StoryFn = () => ({ + template: ``, + moduleMetadata: { + declarations: [OpenCloseComponent], + imports: [BrowserAnimationsModule], + }, +}); + +WithBrowserAnimations.play = async ({ canvasElement }) => { + const canvas = within(canvasElement); + const opened = canvas.getByText('The box is now Open!'); + expect(opened).toBeDefined(); + const submitButton = canvas.getByRole('button'); + await userEvent.click(submitButton); + const closed = canvas.getByText('The box is now Closed!'); + expect(closed).toBeDefined(); +}; diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 6c3f5d55479..b9c64283947 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -59,5 +59,5 @@ "access": "public" }, "bundler": {}, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 7fcc8ebc135..bedb6828901 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/builder-vite": "7.0.0-beta.31", - "@storybook/channel-postmessage": "7.0.0-beta.31", - "@storybook/channel-websocket": "7.0.0-beta.31", - "@storybook/client-api": "7.0.0-beta.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/html": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview-web": "7.0.0-beta.31", + "@storybook/addons": "7.0.0-beta.34", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/channel-postmessage": "7.0.0-beta.34", + "@storybook/channel-websocket": "7.0.0-beta.34", + "@storybook/client-api": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/html": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview-web": "7.0.0-beta.34", "magic-string": "^0.26.1" }, "devDependencies": { @@ -76,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 2e6d093ed8f..b13e4691294 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/html": "7.0.0-beta.31", - "@storybook/preset-html-webpack": "7.0.0-beta.31", + "@storybook/html": "7.0.0-beta.34", + "@storybook/preset-html-webpack": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -76,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 4a2be64dbf0..fc6057fe545 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Next.js", "keywords": [ "storybook", @@ -60,16 +60,16 @@ }, "dependencies": { "@next/font": "^13.0.7", - "@storybook/addon-actions": "7.0.0-beta.31", - "@storybook/builder-webpack5": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preset-react-webpack": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/react": "7.0.0-beta.31", + "@storybook/addon-actions": "7.0.0-beta.34", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preset-react-webpack": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/react": "7.0.0-beta.34", "@types/node": "^16.0.0", "find-up": "^5.0.0", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "image-size": "^1.0.0", "loader-utils": "^3.2.0", "pnp-webpack-plugin": "^1.7.0", @@ -123,5 +123,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index bb4891b3795..c37c43111f5 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/preact": "7.0.0-beta.31" + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/preact": "7.0.0-beta.34" }, "devDependencies": { "@types/node": "^16.0.0", @@ -73,5 +73,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 7f5deb6cca2..7ca13c6b37d 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preact": "7.0.0-beta.31", - "@storybook/preset-preact-webpack": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preact": "7.0.0-beta.34", + "@storybook/preset-preact-webpack": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -77,5 +77,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 00915472754..6e09d14117d 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/react": "7.0.0-beta.31", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/react": "7.0.0-beta.34", "@vitejs/plugin-react": "^3.0.1", "ast-types": "^0.14.2", "magic-string": "^0.26.1", @@ -80,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 4793144276b..ef2352e1a61 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/preset-react-webpack": "7.0.0-beta.31", - "@storybook/react": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/preset-react-webpack": "7.0.0-beta.34", + "@storybook/react": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 494e76561bd..86fc34b4ce9 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preset-server-webpack": "7.0.0-beta.31", - "@storybook/server": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preset-server-webpack": "7.0.0-beta.34", + "@storybook/server": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -74,5 +74,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 9cb6bcbba49..81961ecc3ac 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/svelte": "7.0.0-beta.31", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/svelte": "7.0.0-beta.34", "@sveltejs/vite-plugin-svelte": "^2.0.0", "magic-string": "^0.26.1", "svelte": "^3.0.0", @@ -80,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index ac6969e2979..7692a50be04 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preset-svelte-webpack": "7.0.0-beta.31", - "@storybook/svelte": "7.0.0-beta.31" + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preset-svelte-webpack": "7.0.0-beta.34", + "@storybook/svelte": "7.0.0-beta.34" }, "devDependencies": { "svelte": "^3.48.0", @@ -78,5 +78,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 927f59226b6..cdead00b1ad 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for SvelteKit", "keywords": [ "storybook", @@ -51,9 +51,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.0.0-beta.31", - "@storybook/svelte": "7.0.0-beta.31", - "@storybook/svelte-vite": "7.0.0-beta.31" + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/svelte": "7.0.0-beta.34", + "@storybook/svelte-vite": "7.0.0-beta.34" }, "devDependencies": { "@types/node": "^16.0.0", @@ -76,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index d8625c1542e..670349fdeea 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/vue": "7.0.0-beta.31", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/vue": "7.0.0-beta.34", "magic-string": "^0.26.1", "vue-docgen-api": "^4.40.0" }, @@ -79,5 +79,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index c9e3152f0c7..4d0863eccdd 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preset-vue-webpack": "7.0.0-beta.31", - "@storybook/vue": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preset-vue-webpack": "7.0.0-beta.34", + "@storybook/vue": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 52016c5cdde..5ecfc0b8e18 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/vue3": "7.0.0-beta.31", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/vue3": "7.0.0-beta.34", "magic-string": "^0.26.1", "vue-docgen-api": "^4.40.0" }, @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index cc5fa5f8393..f2ff0ee6d1d 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preset-vue3-webpack": "7.0.0-beta.31", - "@storybook/vue3": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preset-vue3-webpack": "7.0.0-beta.34", + "@storybook/vue3": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -80,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 8ca0b6661cd..633b782de8a 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/web-components": "7.0.0-beta.31", + "@storybook/builder-vite": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/web-components": "7.0.0-beta.34", "magic-string": "^0.26.1" }, "devDependencies": { @@ -75,5 +75,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 175dfb1fc8c..84148e9d186 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/preset-web-components-webpack": "7.0.0-beta.31", - "@storybook/web-components": "7.0.0-beta.31", + "@storybook/builder-webpack5": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preset-web-components-webpack": "7.0.0-beta.34", + "@storybook/web-components": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -79,5 +79,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lerna.json b/code/lerna.json index 642c555f617..6bfceee5271 100644 --- a/code/lerna.json +++ b/code/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "registry": "https://registry.npmjs.org", - "version": "7.0.0-beta.31" + "version": "7.0.0-beta.34" } diff --git a/code/lib/addons/package.json b/code/lib/addons/package.json index 2598755f009..cf9cf7d0eb7 100644 --- a/code/lib/addons/package.json +++ b/code/lib/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook addons store", "keywords": [ "storybook" @@ -44,9 +44,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31" + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -60,5 +60,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/builder-manager/package.json b/code/lib/builder-manager/package.json index 42fb6cf195d..ad71f8f8d30 100644 --- a/code/lib/builder-manager/package.json +++ b/code/lib/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/manager": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/manager": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", "@types/ejs": "^3.1.1", "@types/find-cache-dir": "^3.2.1", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", @@ -56,7 +56,7 @@ "esbuild-plugin-alias": "^0.2.1", "express": "^4.17.3", "find-cache-dir": "^3.0.0", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "process": "^0.11.10", "slash": "^3.0.0", "util": "^0.12.4" @@ -73,5 +73,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index deb9221b988..5dd6969f034 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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,20 +43,20 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channel-postmessage": "7.0.0-beta.31", - "@storybook/channel-websocket": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/csf-plugin": "7.0.0-beta.31", + "@storybook/channel-postmessage": "7.0.0-beta.34", + "@storybook/channel-websocket": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/csf-plugin": "7.0.0-beta.34", "@storybook/mdx2-csf": "next", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", "express": "^4.17.3", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "glob": "^7.2.0", "glob-promise": "^4.2.0", "magic-string": "^0.26.1", @@ -97,5 +97,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/builder-webpack5/package.json b/code/lib/builder-webpack5/package.json index 444cc56b6d9..ef896319d2f 100644 --- a/code/lib/builder-webpack5/package.json +++ b/code/lib/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -58,25 +58,25 @@ }, "dependencies": { "@babel/core": "^7.12.10", - "@storybook/addons": "7.0.0-beta.31", - "@storybook/api": "7.0.0-beta.31", - "@storybook/channel-postmessage": "7.0.0-beta.31", - "@storybook/channel-websocket": "7.0.0-beta.31", - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-api": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/components": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/addons": "7.0.0-beta.34", + "@storybook/api": "7.0.0-beta.34", + "@storybook/channel-postmessage": "7.0.0-beta.34", + "@storybook/channel-websocket": "7.0.0-beta.34", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-api": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/components": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", + "@storybook/core-webpack": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/router": "7.0.0-beta.31", - "@storybook/store": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", + "@storybook/manager-api": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/router": "7.0.0-beta.34", + "@storybook/store": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", "babel-loader": "^9.0.0", @@ -86,7 +86,7 @@ "css-loader": "^6.7.1", "express": "^4.17.3", "fork-ts-checker-webpack-plugin": "^7.2.8", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "html-webpack-plugin": "^5.5.0", "path-browserify": "^1.0.1", "process": "^0.11.10", @@ -131,5 +131,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/channel-postmessage/package.json b/code/lib/channel-postmessage/package.json index f902ab9012b..af59d4a7d74 100644 --- a/code/lib/channel-postmessage/package.json +++ b/code/lib/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.0.3" @@ -61,5 +61,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/channel-websocket/package.json b/code/lib/channel-websocket/package.json index d7f2b493207..746334a6744 100644 --- a/code/lib/channel-websocket/package.json +++ b/code/lib/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", "@storybook/global": "^5.0.0", "telejson": "^7.0.3" }, @@ -59,5 +59,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index a38cd8781e4..130072db192 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -53,5 +53,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index d47b04d9383..257a75de66a 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook CLI", "keywords": [ "storybook" @@ -21,10 +21,10 @@ "license": "MIT", "bin": "./index.js", "dependencies": { - "@storybook/cli": "7.0.0-beta.31" + "@storybook/cli": "7.0.0-beta.34" }, "publishConfig": { "access": "public" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index e6c97b34ff6..a532379c2cf 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook CLI", "keywords": [ "storybook" @@ -24,10 +24,10 @@ "storybook": "./index.js" }, "dependencies": { - "@storybook/cli": "7.0.0-beta.31" + "@storybook/cli": "7.0.0-beta.34" }, "publishConfig": { "access": "public" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index bf43212d4a1..90dd8b870e2 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -56,13 +56,13 @@ "dependencies": { "@babel/core": "^7.20.2", "@babel/preset-env": "^7.20.2", - "@storybook/codemod": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/csf-tools": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/telemetry": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/codemod": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/csf-tools": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/telemetry": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/semver": "^7.3.4", "boxen": "^5.1.2", "chalk": "^4.1.0", @@ -73,7 +73,7 @@ "execa": "^5.0.0", "express": "^4.17.3", "find-up": "^5.0.0", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "get-port": "^5.1.1", "giget": "^1.0.0", "globby": "^11.0.2", @@ -91,7 +91,7 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/client-api": "7.0.0-beta.31", + "@storybook/client-api": "7.0.0-beta.34", "@types/cross-spawn": "^6.0.2", "@types/prompts": "^2.0.9", "@types/puppeteer-core": "^2.1.0", @@ -111,5 +111,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/cli/src/build.ts b/code/lib/cli/src/build.ts index 2110be45d4f..b1c16e37b2c 100644 --- a/code/lib/cli/src/build.ts +++ b/code/lib/cli/src/build.ts @@ -10,7 +10,6 @@ export const build = async (cliOptions: any) => { configDir: cliOptions.configDir || './.storybook', outputDir: cliOptions.outputDir || './storybook-static', ignorePreview: !!cliOptions.previewUrl && !cliOptions.forceBuildPreview, - docsMode: !!cliOptions.docs, configType: 'PRODUCTION', cache, packageJson: readUpSync({ cwd: __dirname }).packageJson, diff --git a/code/lib/cli/src/dev.ts b/code/lib/cli/src/dev.ts index b50da746622..4eaa1208390 100644 --- a/code/lib/cli/src/dev.ts +++ b/code/lib/cli/src/dev.ts @@ -13,7 +13,6 @@ export const dev = async (cliOptions: any) => { configDir: cliOptions.configDir || './.storybook', configType: 'DEVELOPMENT', ignorePreview: !!cliOptions.previewUrl && !cliOptions.forceBuildPreview, - docsMode: !!cliOptions.docs, cache, packageJson: readUpSync({ cwd: __dirname }).packageJson, }; diff --git a/code/lib/cli/src/generate.ts b/code/lib/cli/src/generate.ts index 57d351769ef..02fc464e3f8 100644 --- a/code/lib/cli/src/generate.ts +++ b/code/lib/cli/src/generate.ts @@ -24,18 +24,19 @@ import { parseList, getEnvConfig } from './utils'; const pkg = readUpSync({ cwd: __dirname }).packageJson; const consoleLogger = console; -program - .option( - '--disable-telemetry', - 'disable sending telemetry data', - // default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true - process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== 'false' - ) - .option('--debug', 'Get more logs in debug mode', false) - .option('--enable-crash-reports', 'enable sending crash reports to telemetry data'); +const command = (name: string) => + program + .command(name) + .option( + '--disable-telemetry', + 'disable sending telemetry data', + // default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true + process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== 'false' + ) + .option('--debug', 'Get more logs in debug mode', false) + .option('--enable-crash-reports', 'enable sending crash reports to telemetry data'); -program - .command('init') +command('init') .description('Initialize Storybook into your project.') .option('-f --force', 'Force add Storybook') .option('-s --skip-install', 'Skip installing deps') @@ -47,15 +48,14 @@ program .option('-y --yes', 'Answer yes to all prompts') .option('-b --builder ', 'Builder library') .option('-l --linkable', 'Prepare installation for link (contributor helper)') - .action((options: CommandOptions) => + .action((options: CommandOptions) => { initiate(options, pkg).catch((err) => { logger.error(err); process.exit(1); - }) - ); + }); + }); -program - .command('add ') +command('add ') .description('Add an addon to your Storybook') .option( '--package-manager ', @@ -65,13 +65,11 @@ program .option('-s --skip-postinstall', 'Skip package specific postinstall config modifications') .action((addonName: string, options: any) => add(addonName, options)); -program - .command('babelrc') +command('babelrc') .description('generate the default storybook babel config into your current working directory') .action(() => generateStorybookBabelConfigInCWD()); -program - .command('upgrade') +command('upgrade') .description('Upgrade your Storybook packages to the latest') .option( '--package-manager ', @@ -85,8 +83,7 @@ program .option('-s --skip-check', 'Skip postinstall version and automigration checks') .action((options: UpgradeOptions) => upgrade(options)); -program - .command('info') +command('info') .description('Prints debugging information about the local environment') .action(() => { consoleLogger.log(chalk.bold('\nEnvironment Info:')); @@ -101,8 +98,7 @@ program .then(consoleLogger.log); }); -program - .command('migrate [migration]') +command('migrate [migration]') .description('Run a Storybook codemod migration on your source files') .option('-l --list', 'List available migrations') .option('-g --glob ', 'Glob for files upon which to apply the migration', '**/*.js') @@ -130,8 +126,7 @@ program }); }); -program - .command('extract [location] [output]') +command('extract [location] [output]') .description('extract stories.json from a built version') .action((location = 'storybook-static', output = path.join(location, 'stories.json')) => extract(location, output).catch((e) => { @@ -140,8 +135,7 @@ program }) ); -program - .command('sandbox [filterValue]') +command('sandbox [filterValue]') .alias('repro') // for retrocompatibility purposes .description('Create a sandbox from a set of possible templates') .option('-o --output ', 'Define an output directory') @@ -154,8 +148,7 @@ program }) ); -program - .command('link ') +command('link ') .description('Pull down a repro from a URL (or a local directory), link it, and run storybook') .option('--local', 'Link a local directory already in your file system') .option('--no-start', 'Start the storybook', true) @@ -166,8 +159,7 @@ program }) ); -program - .command('automigrate [fixId]') +command('automigrate [fixId]') .description('Check storybook for known problems or migrations and apply fixes') .option('-y --yes', 'Skip prompting the user') .option('-n --dry-run', 'Only check for fixes, do not actually run them') @@ -181,8 +173,7 @@ program }); }); -program - .command('dev') +command('dev') .option('-p, --port ', 'Port to run Storybook', (str) => parseInt(str, 10)) .option('-h, --host ', 'Host to run Storybook') .option('-s, --static-dir ', 'Directory where to load static files from', parseList) @@ -239,8 +230,7 @@ program dev({ ...options, packageJson: pkg }); }); -program - .command('build') +command('build') .option('-s, --static-dir ', 'Directory where to load static files from', parseList) .option('-o, --output-dir ', 'Directory where to store built files') .option('-c, --config-dir ', 'Directory where to load Storybook configurations from') diff --git a/code/lib/cli/src/generators/types.ts b/code/lib/cli/src/generators/types.ts index 766aa8e50ea..c9b3b309482 100644 --- a/code/lib/cli/src/generators/types.ts +++ b/code/lib/cli/src/generators/types.ts @@ -52,4 +52,6 @@ export type CommandOptions = { linkable?: boolean; commonJs?: boolean; disableTelemetry?: boolean; + enableCrashReports?: boolean; + debug?: boolean; }; diff --git a/code/lib/cli/src/repro-generators/scripts.ts b/code/lib/cli/src/repro-generators/scripts.ts index c8b0b9fe8d1..e003f973c7b 100644 --- a/code/lib/cli/src/repro-generators/scripts.ts +++ b/code/lib/cli/src/repro-generators/scripts.ts @@ -186,7 +186,7 @@ const addAdditionalFiles = async ({ additionalFiles, cwd }: Options) => { await Promise.all( additionalFiles.map(async (file) => { - await outputFile(path.resolve(cwd, file.path), file.contents, { encoding: 'UTF-8' }); + await outputFile(path.resolve(cwd, file.path), file.contents, { encoding: 'utf-8' }); }) ); }; diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index 9ef50338666..bd113b3e2ab 100644 --- a/code/lib/cli/src/versions.ts +++ b/code/lib/cli/src/versions.ts @@ -1,90 +1,90 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '7.0.0-beta.31', - '@storybook/addon-actions': '7.0.0-beta.31', - '@storybook/addon-backgrounds': '7.0.0-beta.31', - '@storybook/addon-controls': '7.0.0-beta.31', - '@storybook/addon-docs': '7.0.0-beta.31', - '@storybook/addon-essentials': '7.0.0-beta.31', - '@storybook/addon-highlight': '7.0.0-beta.31', - '@storybook/addon-interactions': '7.0.0-beta.31', - '@storybook/addon-jest': '7.0.0-beta.31', - '@storybook/addon-links': '7.0.0-beta.31', - '@storybook/addon-measure': '7.0.0-beta.31', - '@storybook/addon-outline': '7.0.0-beta.31', - '@storybook/addon-storyshots': '7.0.0-beta.31', - '@storybook/addon-storyshots-puppeteer': '7.0.0-beta.31', - '@storybook/addon-storysource': '7.0.0-beta.31', - '@storybook/addon-toolbars': '7.0.0-beta.31', - '@storybook/addon-viewport': '7.0.0-beta.31', - '@storybook/addons': '7.0.0-beta.31', - '@storybook/angular': '7.0.0-beta.31', - '@storybook/manager-api': '7.0.0-beta.31', - '@storybook/blocks': '7.0.0-beta.31', - '@storybook/builder-manager': '7.0.0-beta.31', - '@storybook/builder-vite': '7.0.0-beta.31', - '@storybook/builder-webpack5': '7.0.0-beta.31', - '@storybook/channel-postmessage': '7.0.0-beta.31', - '@storybook/channel-websocket': '7.0.0-beta.31', - '@storybook/channels': '7.0.0-beta.31', - '@storybook/cli': '7.0.0-beta.31', - '@storybook/client-api': '7.0.0-beta.31', - '@storybook/client-logger': '7.0.0-beta.31', - '@storybook/codemod': '7.0.0-beta.31', - '@storybook/components': '7.0.0-beta.31', - '@storybook/core-client': '7.0.0-beta.31', - '@storybook/core-common': '7.0.0-beta.31', - '@storybook/core-events': '7.0.0-beta.31', - '@storybook/core-server': '7.0.0-beta.31', - '@storybook/core-webpack': '7.0.0-beta.31', - '@storybook/csf-tools': '7.0.0-beta.31', - '@storybook/docs-tools': '7.0.0-beta.31', - '@storybook/ember': '7.0.0-beta.31', - '@storybook/html': '7.0.0-beta.31', - '@storybook/html-webpack5': '7.0.0-beta.31', - '@storybook/html-vite': '7.0.0-beta.31', - '@storybook/instrumenter': '7.0.0-beta.31', - '@storybook/nextjs': '7.0.0-beta.31', - '@storybook/node-logger': '7.0.0-beta.31', - '@storybook/postinstall': '7.0.0-beta.31', - '@storybook/preact': '7.0.0-beta.31', - '@storybook/preact-vite': '7.0.0-beta.31', - '@storybook/preact-webpack5': '7.0.0-beta.31', - '@storybook/preset-html-webpack': '7.0.0-beta.31', - '@storybook/preset-preact-webpack': '7.0.0-beta.31', - '@storybook/preset-react-webpack': '7.0.0-beta.31', - '@storybook/preset-server-webpack': '7.0.0-beta.31', - '@storybook/preset-svelte-webpack': '7.0.0-beta.31', - '@storybook/preset-vue-webpack': '7.0.0-beta.31', - '@storybook/preset-vue3-webpack': '7.0.0-beta.31', - '@storybook/preset-web-components-webpack': '7.0.0-beta.31', - '@storybook/preview': '7.0.0-beta.31', - '@storybook/preview-api': '7.0.0-beta.31', - '@storybook/preview-web': '7.0.0-beta.31', - '@storybook/react': '7.0.0-beta.31', - '@storybook/react-vite': '7.0.0-beta.31', - '@storybook/react-webpack5': '7.0.0-beta.31', - '@storybook/router': '7.0.0-beta.31', - '@storybook/server': '7.0.0-beta.31', - '@storybook/server-webpack5': '7.0.0-beta.31', - '@storybook/source-loader': '7.0.0-beta.31', - '@storybook/store': '7.0.0-beta.31', - '@storybook/svelte': '7.0.0-beta.31', - '@storybook/sveltekit': '7.0.0-beta.31', - '@storybook/svelte-vite': '7.0.0-beta.31', - '@storybook/svelte-webpack5': '7.0.0-beta.31', - '@storybook/telemetry': '7.0.0-beta.31', - '@storybook/theming': '7.0.0-beta.31', - '@storybook/manager': '7.0.0-beta.31', - '@storybook/vue': '7.0.0-beta.31', - '@storybook/vue-vite': '7.0.0-beta.31', - '@storybook/vue-webpack5': '7.0.0-beta.31', - '@storybook/vue3': '7.0.0-beta.31', - '@storybook/vue3-vite': '7.0.0-beta.31', - '@storybook/vue3-webpack5': '7.0.0-beta.31', - '@storybook/web-components': '7.0.0-beta.31', - '@storybook/web-components-webpack5': '7.0.0-beta.31', - '@storybook/web-components-vite': '7.0.0-beta.31', - sb: '7.0.0-beta.31', - storybook: '7.0.0-beta.31', + '@storybook/addon-a11y': '7.0.0-beta.34', + '@storybook/addon-actions': '7.0.0-beta.34', + '@storybook/addon-backgrounds': '7.0.0-beta.34', + '@storybook/addon-controls': '7.0.0-beta.34', + '@storybook/addon-docs': '7.0.0-beta.34', + '@storybook/addon-essentials': '7.0.0-beta.34', + '@storybook/addon-highlight': '7.0.0-beta.34', + '@storybook/addon-interactions': '7.0.0-beta.34', + '@storybook/addon-jest': '7.0.0-beta.34', + '@storybook/addon-links': '7.0.0-beta.34', + '@storybook/addon-measure': '7.0.0-beta.34', + '@storybook/addon-outline': '7.0.0-beta.34', + '@storybook/addon-storyshots': '7.0.0-beta.34', + '@storybook/addon-storyshots-puppeteer': '7.0.0-beta.34', + '@storybook/addon-storysource': '7.0.0-beta.34', + '@storybook/addon-toolbars': '7.0.0-beta.34', + '@storybook/addon-viewport': '7.0.0-beta.34', + '@storybook/addons': '7.0.0-beta.34', + '@storybook/angular': '7.0.0-beta.34', + '@storybook/manager-api': '7.0.0-beta.34', + '@storybook/blocks': '7.0.0-beta.34', + '@storybook/builder-manager': '7.0.0-beta.34', + '@storybook/builder-vite': '7.0.0-beta.34', + '@storybook/builder-webpack5': '7.0.0-beta.34', + '@storybook/channel-postmessage': '7.0.0-beta.34', + '@storybook/channel-websocket': '7.0.0-beta.34', + '@storybook/channels': '7.0.0-beta.34', + '@storybook/cli': '7.0.0-beta.34', + '@storybook/client-api': '7.0.0-beta.34', + '@storybook/client-logger': '7.0.0-beta.34', + '@storybook/codemod': '7.0.0-beta.34', + '@storybook/components': '7.0.0-beta.34', + '@storybook/core-client': '7.0.0-beta.34', + '@storybook/core-common': '7.0.0-beta.34', + '@storybook/core-events': '7.0.0-beta.34', + '@storybook/core-server': '7.0.0-beta.34', + '@storybook/core-webpack': '7.0.0-beta.34', + '@storybook/csf-tools': '7.0.0-beta.34', + '@storybook/docs-tools': '7.0.0-beta.34', + '@storybook/ember': '7.0.0-beta.34', + '@storybook/html': '7.0.0-beta.34', + '@storybook/html-webpack5': '7.0.0-beta.34', + '@storybook/html-vite': '7.0.0-beta.34', + '@storybook/instrumenter': '7.0.0-beta.34', + '@storybook/nextjs': '7.0.0-beta.34', + '@storybook/node-logger': '7.0.0-beta.34', + '@storybook/postinstall': '7.0.0-beta.34', + '@storybook/preact': '7.0.0-beta.34', + '@storybook/preact-vite': '7.0.0-beta.34', + '@storybook/preact-webpack5': '7.0.0-beta.34', + '@storybook/preset-html-webpack': '7.0.0-beta.34', + '@storybook/preset-preact-webpack': '7.0.0-beta.34', + '@storybook/preset-react-webpack': '7.0.0-beta.34', + '@storybook/preset-server-webpack': '7.0.0-beta.34', + '@storybook/preset-svelte-webpack': '7.0.0-beta.34', + '@storybook/preset-vue-webpack': '7.0.0-beta.34', + '@storybook/preset-vue3-webpack': '7.0.0-beta.34', + '@storybook/preset-web-components-webpack': '7.0.0-beta.34', + '@storybook/preview': '7.0.0-beta.34', + '@storybook/preview-api': '7.0.0-beta.34', + '@storybook/preview-web': '7.0.0-beta.34', + '@storybook/react': '7.0.0-beta.34', + '@storybook/react-vite': '7.0.0-beta.34', + '@storybook/react-webpack5': '7.0.0-beta.34', + '@storybook/router': '7.0.0-beta.34', + '@storybook/server': '7.0.0-beta.34', + '@storybook/server-webpack5': '7.0.0-beta.34', + '@storybook/source-loader': '7.0.0-beta.34', + '@storybook/store': '7.0.0-beta.34', + '@storybook/svelte': '7.0.0-beta.34', + '@storybook/sveltekit': '7.0.0-beta.34', + '@storybook/svelte-vite': '7.0.0-beta.34', + '@storybook/svelte-webpack5': '7.0.0-beta.34', + '@storybook/telemetry': '7.0.0-beta.34', + '@storybook/theming': '7.0.0-beta.34', + '@storybook/manager': '7.0.0-beta.34', + '@storybook/vue': '7.0.0-beta.34', + '@storybook/vue-vite': '7.0.0-beta.34', + '@storybook/vue-webpack5': '7.0.0-beta.34', + '@storybook/vue3': '7.0.0-beta.34', + '@storybook/vue3-vite': '7.0.0-beta.34', + '@storybook/vue3-webpack5': '7.0.0-beta.34', + '@storybook/web-components': '7.0.0-beta.34', + '@storybook/web-components-webpack5': '7.0.0-beta.34', + '@storybook/web-components-vite': '7.0.0-beta.34', + sb: '7.0.0-beta.34', + storybook: '7.0.0-beta.34', }; diff --git a/code/lib/client-api/package.json b/code/lib/client-api/package.json index bfc17aaa21a..dc0c7b05df9 100644 --- a/code/lib/client-api/package.json +++ b/code/lib/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Client API", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/client-api" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 2ef66cc975e..2b99e339815 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -56,5 +56,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 5c6e6f8fb98..111ac26403e 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" @@ -50,9 +50,9 @@ "@babel/preset-env": "^7.20.2", "@babel/types": "^7.20.7", "@storybook/csf": "next", - "@storybook/csf-tools": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/csf-tools": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "cross-spawn": "^7.0.3", "globby": "^11.0.2", "jscodeshift": "^0.13.1", @@ -86,5 +86,5 @@ "./src/transforms/upgrade-hierarchy-separators.js" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/core-client/package.json b/code/lib/core-client/package.json index 105d0bf9865..55f7df34d80 100644 --- a/code/lib/core-client/package.json +++ b/code/lib/core-client/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-client", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -35,8 +35,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34" }, "publishConfig": { "access": "public" @@ -47,5 +47,5 @@ ], "shim": "@storybook/preview-api/dist/core-client" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 5f75aca8bde..b9a99f8c286 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -44,8 +44,8 @@ }, "dependencies": { "@babel/core": "^7.20.2", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/babel__core": "^7.1.20", "@types/express": "^4.7.0", "@types/node": "^16.0.0", @@ -56,7 +56,7 @@ "express": "^4.17.3", "file-system-cache": "^2.0.0", "find-up": "^5.0.0", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "glob": "^7.1.6", "handlebars": "^4.7.7", "lazy-universal-dotenv": "^3.0.1", @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index d2cc0a23a63..fa52a7211a6 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Event names used in storybook core", "keywords": [ "storybook" @@ -53,5 +53,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index ecc2609c1ad..3baed796dcf 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/builder-manager": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/csf": "next", - "@storybook/csf-tools": "7.0.0-beta.31", + "@storybook/csf-tools": "7.0.0-beta.34", "@storybook/docs-mdx": "next", "@storybook/global": "^5.0.0", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/telemetry": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/telemetry": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/detect-port": "^1.3.0", "@types/node": "^16.0.0", "@types/node-fetch": "^2.5.7", @@ -81,7 +81,7 @@ "compression": "^1.7.4", "detect-port": "^1.3.0", "express": "^4.17.3", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "globby": "^11.0.2", "ip": "^2.0.0", "lodash": "^4.17.21", @@ -119,5 +119,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/core-server/src/typings.d.ts b/code/lib/core-server/src/typings.d.ts index b51124a22ab..2596c5e8940 100644 --- a/code/lib/core-server/src/typings.d.ts +++ b/code/lib/core-server/src/typings.d.ts @@ -15,5 +15,6 @@ declare var FEATURES: interactionsDebugger?: boolean; breakingChangesV7?: boolean; argTypeTargetsV7?: boolean; + legacyMdx1?: boolean; } | undefined; diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 39e9817d77f..6d8817147f0 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -113,7 +113,7 @@ export class StoryIndexGenerator { async initialize() { // Find all matching paths for each specifier - await Promise.all( + const specifiersAndCaches = await Promise.all( this.specifiers.map(async (specifier) => { const pathToSubIndex = {} as SpecifierStoriesCache; @@ -132,10 +132,16 @@ export class StoryIndexGenerator { pathToSubIndex[absolutePath] = false; }); - this.specifierToCache.set(specifier, pathToSubIndex); + return [specifier, pathToSubIndex] as const; }) ); + // We do this in a second step to avoid timing issues with the Promise.all above -- to ensure + // the keys in the `specifierToCache` object are consistent with the order of specifiers. + specifiersAndCaches.forEach(([specifier, cache]) => + this.specifierToCache.set(specifier, cache) + ); + // Extract stories for each file await this.ensureExtracted(); } diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index d0c163a8946..65639930986 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-common": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/node": "^16.0.0", "ts-dedent": "^2.0.0" }, @@ -62,5 +62,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index f964cd334ee..767d115dcbe 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", + "@storybook/csf-tools": "7.0.0-beta.34", "unplugin": "^0.10.2" }, "devDependencies": { @@ -64,5 +64,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index ad204536bc8..f00a542f3b6 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -45,8 +45,8 @@ "dependencies": { "@babel/types": "^7.20.2", "@storybook/csf": "next", - "@storybook/types": "7.0.0-beta.31", - "fs-extra": "^9.0.1", + "@storybook/types": "7.0.0-beta.34", + "fs-extra": "^11.1.0", "recast": "^0.23.1", "ts-dedent": "^2.0.0" }, @@ -54,7 +54,7 @@ "@babel/generator": "^7.20.4", "@babel/parser": "^7.20.3", "@babel/traverse": "^7.20.1", - "@types/fs-extra": "^9.0.6", + "@types/fs-extra": "^11.0.1", "@types/js-yaml": "^3.12.6", "js-yaml": "^3.14.1", "typescript": "~4.9.3" @@ -67,5 +67,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/csf-tools/src/ConfigFile.test.ts b/code/lib/csf-tools/src/ConfigFile.test.ts index 2c3fa24c510..9369eb7b38c 100644 --- a/code/lib/csf-tools/src/ConfigFile.test.ts +++ b/code/lib/csf-tools/src/ConfigFile.test.ts @@ -769,11 +769,13 @@ describe('ConfigFile', () => { const config: StorybookConfig = { framework: { name: 'foo', options: { bar: require('baz') } }, + "otherField": { "name": 'foo', options: { bar: require('baz') } }, } export default config; `; const config = loadConfig(source).parse(); expect(config.getNameFromPath(['framework'])).toEqual('foo'); + expect(config.getNameFromPath(['otherField'])).toEqual('foo'); }); it(`returns undefined when accessing a field that does not exist`, () => { @@ -812,12 +814,17 @@ describe('ConfigFile', () => { addons: [ 'foo', { name: 'bar', options: {} }, - ] + ], + "otherField": [ + "foo", + { "name": 'bar', options: {} }, + ], } export default config; `; const config = loadConfig(source).parse(); expect(config.getNamesFromPath(['addons'])).toEqual(['foo', 'bar']); + expect(config.getNamesFromPath(['otherField'])).toEqual(['foo', 'bar']); }); }); diff --git a/code/lib/csf-tools/src/ConfigFile.ts b/code/lib/csf-tools/src/ConfigFile.ts index 3464bdfcabf..d0ac7daf02b 100644 --- a/code/lib/csf-tools/src/ConfigFile.ts +++ b/code/lib/csf-tools/src/ConfigFile.ts @@ -315,6 +315,7 @@ export class ConfigFile { value = node.value; } else if (t.isObjectExpression(node)) { node.properties.forEach((prop) => { + // { framework: { name: 'value' } } if ( t.isObjectProperty(prop) && t.isIdentifier(prop.key) && @@ -324,6 +325,16 @@ export class ConfigFile { value = prop.value.value; } } + + // { "framework": { "name": "value" } } + if ( + t.isObjectProperty(prop) && + t.isStringLiteral(prop.key) && + prop.key.value === 'name' && + t.isStringLiteral(prop.value) + ) { + value = prop.value.value; + } }); } diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 51b0ee595a1..fd4a1b66447 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "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.31", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/core-common": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/doctrine": "^0.0.3", "doctrine": "^3.0.0", "lodash": "^4.17.21" @@ -64,5 +64,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index aec72288d25..7341adb0f4b 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -43,11 +43,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", "core-js": "^3.8.2" }, "devDependencies": { @@ -61,5 +61,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/manager-api-shim/package.json b/code/lib/manager-api-shim/package.json index a652a8cd5e0..5557eabbd7f 100644 --- a/code/lib/manager-api-shim/package.json +++ b/code/lib/manager-api-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/manager-api": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/manager-api": "7.0.0-beta.34" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/manager-api" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 4478517ae78..b7bf08bf54f 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Core Storybook API & Context", "keywords": [ "storybook" @@ -42,14 +42,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/csf": "next", "@storybook/global": "^5.0.0", - "@storybook/router": "7.0.0-beta.31", - "@storybook/theming": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/router": "7.0.0-beta.34", + "@storybook/theming": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", @@ -78,5 +78,5 @@ "./src/index.tsx" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index 65d050e3259..ef8d00dac27 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '7.0.0-beta.31'; +export const version = '7.0.0-beta.34'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index e85a29cea2c..9b8645bd796 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -60,5 +60,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index 382212b90a4..9ac15dd70c0 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook addons postinstall utilities", "keywords": [ "api", @@ -57,5 +57,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index fdc96ff64f7..ee2bacc5237 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -67,13 +67,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channel-postmessage": "7.0.0-beta.31", - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", + "@storybook/channel-postmessage": "7.0.0-beta.34", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", "@storybook/csf": "next", "@storybook/global": "^5.0.0", - "@storybook/types": "7.0.0-beta.31", + "@storybook/types": "7.0.0-beta.34", "@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.31", + "@storybook/core-common": "7.0.0-beta.34", "ansi-to-html": "^0.6.11", "react": "^16.14.0" }, @@ -103,5 +103,5 @@ "./src/store.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/preview-api/src/modules/preview-web/docs-context/DocsContext.ts b/code/lib/preview-api/src/modules/preview-web/docs-context/DocsContext.ts index 02799288b71..3542e0a1919 100644 --- a/code/lib/preview-api/src/modules/preview-web/docs-context/DocsContext.ts +++ b/code/lib/preview-api/src/modules/preview-web/docs-context/DocsContext.ts @@ -48,7 +48,7 @@ export class DocsContext implements DocsContextProps }); } - // This docs entry references this CSF file and can syncronously load the stories, as well + // This docs entry references this CSF file and can synchronously load the stories, as well // as reference them by module export. If the CSF is part of the "component" stories, they // can also be referenced by name and are in the componentStories list. referenceCSFFile(csfFile: CSFFile) { diff --git a/code/lib/preview-api/src/modules/store/csf/processCSFFile.ts b/code/lib/preview-api/src/modules/store/csf/processCSFFile.ts index c29322a2527..55fc8895eec 100644 --- a/code/lib/preview-api/src/modules/store/csf/processCSFFile.ts +++ b/code/lib/preview-api/src/modules/store/csf/processCSFFile.ts @@ -8,8 +8,9 @@ import type { NormalizedComponentAnnotations, } from '@storybook/types'; import { isExportStory } from '@storybook/csf'; -import { logger } from '@storybook/client-logger'; +import { deprecate, logger } from '@storybook/client-logger'; +import dedent from 'ts-dedent'; import { normalizeStory } from './normalizeStory'; import { normalizeComponentAnnotations } from './normalizeComponentAnnotations'; @@ -38,6 +39,15 @@ const checkDisallowedParameters = (parameters?: Parameters) => { checkStorySort(parameters); }; +const checkSubcomponents = (meta: ModuleExports) => { + if (meta.subcomponents) { + deprecate(dedent`The \`subcomponents\` annotation is deprecated. + + Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#argstable-block' + `); + } +}; + // Given the raw exports of a CSF file, check and normalize it. export function processCSFFile( moduleExports: ModuleExports, @@ -53,6 +63,7 @@ export function processCSFFile( importPath ); checkDisallowedParameters(meta.parameters); + checkSubcomponents(meta); const csfFile: CSFFile = { meta, stories: {}, moduleExports }; diff --git a/code/lib/preview-api/src/typings.d.ts b/code/lib/preview-api/src/typings.d.ts index 195827936c6..c55173e5bb9 100644 --- a/code/lib/preview-api/src/typings.d.ts +++ b/code/lib/preview-api/src/typings.d.ts @@ -13,6 +13,7 @@ declare var FEATURES: interactionsDebugger?: boolean; breakingChangesV7?: boolean; argTypeTargetsV7?: boolean; + legacyMdx1?: boolean; } | undefined; diff --git a/code/lib/preview-web/package.json b/code/lib/preview-web/package.json index a172273ae91..79269ddad69 100644 --- a/code/lib/preview-web/package.json +++ b/code/lib/preview-web/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-web", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/preview-web" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 90f1415e361..162b5925c4a 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -57,12 +57,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { - "@storybook/channel-postmessage": "7.0.0-beta.31", - "@storybook/channel-websocket": "7.0.0-beta.31", - "@storybook/channels": "7.0.0-beta.31", - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-events": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31", + "@storybook/channel-postmessage": "7.0.0-beta.34", + "@storybook/channel-websocket": "7.0.0-beta.34", + "@storybook/channels": "7.0.0-beta.34", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-events": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34", "typescript": "~4.9.3" }, "publishConfig": { @@ -74,5 +74,5 @@ "./src/globals.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/router/package.json b/code/lib/router/package.json index e391c971e11..39d237b18e0 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Core Storybook Router", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", "memoizerific": "^1.11.3", "qs": "^6.10.0" }, @@ -74,5 +74,5 @@ "./src/utils.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 48a4685a1ea..c235a889413 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Source loader", "keywords": [ "lib", @@ -45,7 +45,7 @@ }, "dependencies": { "@storybook/csf": "next", - "@storybook/types": "7.0.0-beta.31", + "@storybook/types": "7.0.0-beta.34", "estraverse": "^5.2.0", "lodash": "^4.17.21", "prettier": "^2.8.0" @@ -67,5 +67,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/store/package.json b/code/lib/store/package.json index c82a73fa5af..443e0fcfeb8 100644 --- a/code/lib/store/package.json +++ b/code/lib/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/preview-api": "7.0.0-beta.31" + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/preview-api": "7.0.0-beta.34" }, "publishConfig": { "access": "public" @@ -55,5 +55,5 @@ "platform": "node", "shim": "@storybook/preview-api/dist/store" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index b674a13c3d3..0bd08ee3eba 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" @@ -43,12 +43,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-common": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-common": "7.0.0-beta.34", "chalk": "^4.1.0", "detect-package-manager": "^2.0.1", "fetch-retry": "^5.0.2", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "isomorphic-unfetch": "^3.1.0", "nanoid": "^3.3.1", "read-pkg-up": "^7.0.1" @@ -65,5 +65,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/telemetry/src/anonymous-id.test.ts b/code/lib/telemetry/src/anonymous-id.test.ts index 1e776dce841..ad8f01ad0b1 100644 --- a/code/lib/telemetry/src/anonymous-id.test.ts +++ b/code/lib/telemetry/src/anonymous-id.test.ts @@ -72,4 +72,14 @@ describe('normalizeGitUrl', () => { 'github.com/storybookjs/storybook.git' ); }); + + it('trims off extra whitespace', () => { + expect(normalizeGitUrl('https://github.com/storybookjs/storybook.git#next\n')).toEqual( + 'github.com/storybookjs/storybook.git' + ); + + expect(normalizeGitUrl('https://github.com/storybookjs/storybook.git\n')).toEqual( + 'github.com/storybookjs/storybook.git' + ); + }); }); diff --git a/code/lib/telemetry/src/anonymous-id.ts b/code/lib/telemetry/src/anonymous-id.ts index 4f12cf19e5c..6c4dfb8b314 100644 --- a/code/lib/telemetry/src/anonymous-id.ts +++ b/code/lib/telemetry/src/anonymous-id.ts @@ -6,7 +6,7 @@ import { oneWayHash } from './one-way-hash'; export function normalizeGitUrl(rawUrl: string) { // I don't *think* its possible to set a hash on a origin URL, but just in case - const urlWithoutHash = rawUrl.replace(/#.*$/, ''); + const urlWithoutHash = rawUrl.trim().replace(/#.*$/, ''); // Strip anything ahead of an @ const urlWithoutUser = urlWithoutHash.replace(/^.*@/, ''); diff --git a/code/lib/telemetry/src/sanitize.ts b/code/lib/telemetry/src/sanitize.ts index f3dc5ebde05..4c68ed50db9 100644 --- a/code/lib/telemetry/src/sanitize.ts +++ b/code/lib/telemetry/src/sanitize.ts @@ -33,11 +33,15 @@ export function cleanPaths(str: string, separator: string = sep): string { // Takes an Error and returns a sanitized JSON String export function sanitizeError(error: Error, pathSeparator: string = sep) { - // Hack because Node - error = JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); + try { + // Hack because Node + error = JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); - // Removes all user paths - const errorString = cleanPaths(JSON.stringify(error), pathSeparator); + // Removes all user paths + const errorString = cleanPaths(JSON.stringify(error), pathSeparator); - return JSON.parse(errorString); + return JSON.parse(errorString); + } catch (err: any) { + return `Sanitization error: ${err?.message}`; + } } diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index bea6adedb72..bf98fe2a60c 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -49,7 +49,7 @@ }, "dependencies": { "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", - "@storybook/client-logger": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", "@storybook/global": "^5.0.0", "memoizerific": "^1.11.3" }, @@ -58,10 +58,10 @@ "@emotion/is-prop-valid": "^1.2.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", - "@types/fs-extra": "^9.0.6", + "@types/fs-extra": "^11.0.1", "@types/node": "^16.0.0", "deep-object-diff": "^1.1.0", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "polished": "^4.2.2", "ts-dedent": "^2.0.0", "typescript": "~4.9.3" @@ -80,5 +80,5 @@ ], "post": "./scripts/fix-theme-type-export.ts" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 939152fb0e2..146b8354c65 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Core Storybook Types", "keywords": [ "storybook" @@ -44,7 +44,7 @@ }, "dependencies": { "@babel/core": "^7.12.10", - "@storybook/channels": "7.0.0-beta.31", + "@storybook/channels": "7.0.0-beta.34", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", "express": "^4.17.3", @@ -63,5 +63,5 @@ "./src/index.ts" ] }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index d08b0282ce8..7089f5c5195 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -317,6 +317,11 @@ export interface StorybookConfig { * Will be removed in 7.0. */ warnOnLegacyHierarchySeparator?: boolean; + + /** + * Use legacy MDX1, to help smooth migration to 7.0 + */ + legacyMdx1?: boolean; }; /** diff --git a/code/nx.json b/code/nx.json index a9e5bd3c4bf..9535629090c 100644 --- a/code/nx.json +++ b/code/nx.json @@ -7,11 +7,16 @@ "devDependencies": "*" } }, + "pluginsConfig": { + "@nrwl/js": { + "analyzeSourceFiles": false + } + }, "tasksRunnerOptions": { "default": { "runner": "@nrwl/nx-cloud", "options": { - "cacheableOperations": ["build", "test", "lint", "package", "prep", "check"], + "cacheableOperations": ["prep"], "accessToken": "NGVmYTkxMmItYzY3OS00MjkxLTk1ZDktZDFmYTFmNmVlNGY4fHJlYWQ=", "canTrackAnalytics": false, "showUsageWarnings": true, diff --git a/code/package.json b/code/package.json index 96b3b0f8ba1..49ead266519 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "private": true, "homepage": "https://storybook.js.org/", "repository": { @@ -97,7 +97,7 @@ "@nrwl/cli": "^15.4.5", "@nrwl/nx-cloud": "^15.0.2", "@nrwl/workspace": "^15.4.5", - "@playwright/test": "1.29.1", + "@playwright/test": "1.30.0", "@storybook/addon-a11y": "workspace:*", "@storybook/addon-actions": "workspace:*", "@storybook/addon-backgrounds": "workspace:*", @@ -197,7 +197,7 @@ "@testing-library/react": "^11.2.2", "@testing-library/user-event": "^13.2.1", "@types/express": "^4.17.11", - "@types/fs-extra": "^9.0.6", + "@types/fs-extra": "^11.0.1", "@types/lodash": "^4.14.167", "@types/node": "^16.0.0", "@types/react": "^16.14.34", @@ -224,7 +224,7 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-react": "^7.31.10", "eslint-plugin-storybook": "^0.6.6", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "github-release-from-changelog": "^2.1.1", "glob": "^7.1.6", "http-server": "^0.12.3", @@ -241,7 +241,7 @@ "lodash": "^4.17.21", "node-gyp": "^8.4.0", "nx": "^15.4.5", - "playwright": "1.29.1", + "playwright": "1.30.0", "prettier": "2.8.0", "process": "^0.11.10", "raf": "^3.4.1", diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 80f0886420b..63cc07c5fdf 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", "@types/node": "^16.0.0", "html-loader": "^3.1.0", "webpack": "5" @@ -71,5 +71,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 9979dee9ab0..7f81718f54a 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -49,7 +49,7 @@ }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.19.0", - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", "@types/node": "^16.0.0" }, "devDependencies": { @@ -72,5 +72,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 57081f183cd..08d331df5fb 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -71,16 +71,16 @@ "@babel/preset-flow": "^7.18.6", "@babel/preset-react": "^7.18.6", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", - "@storybook/core-webpack": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", - "@storybook/react": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", + "@storybook/react": "7.0.0-beta.34", "@storybook/react-docgen-typescript-plugin": "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", "babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-react-docgen": "^4.2.1", - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "react-refresh": "^0.11.0", "semver": "^7.3.7" }, @@ -117,5 +117,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 02532bc71da..f1ed6b599cb 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -53,17 +53,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-server": "7.0.0-beta.31", - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/core-server": "7.0.0-beta.34", + "@storybook/core-webpack": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/server": "7.0.0-beta.31", + "@storybook/server": "7.0.0-beta.34", "@types/node": "^16.0.0", "safe-identifier": "^0.4.1", "ts-dedent": "^2.0.0", "yaml-loader": "^0.8.0" }, "devDependencies": { - "fs-extra": "^9.0.1", + "fs-extra": "^11.1.0", "jest-specific-snapshot": "^7.0.0", "typescript": "~4.9.3", "yaml": "^1.10.0" @@ -81,5 +81,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 94d6ea382b8..29f86590696 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -63,8 +63,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.0.0-beta.31", - "@storybook/node-logger": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", + "@storybook/node-logger": "7.0.0-beta.34", "sveltedoc-parser": "^4.2.1", "ts-dedent": "^2.0.0" }, @@ -93,5 +93,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index 47c510921dc..d93689f092e 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -58,8 +58,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.44.23", @@ -95,5 +95,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 35775e3a591..8de7b07a4ac 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -58,8 +58,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.46.0", @@ -92,5 +92,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index a1eaa9de255..6c9e87e6481 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-web-components-webpack", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit-html", @@ -53,7 +53,7 @@ "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.20.2", - "@storybook/core-webpack": "7.0.0-beta.31", + "@storybook/core-webpack": "7.0.0-beta.34", "@types/node": "^16.0.0", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", "babel-plugin-bundled-import-meta": "^0.3.1" @@ -77,5 +77,5 @@ ], "platform": "node" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 08e7f8f05df..3072bf2eeee 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook HTML renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -74,5 +74,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index b708bdf20f3..92c9893238a 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Preact renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.31", + "@storybook/core-client": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -74,5 +74,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 671403c9a5a..1994196f331 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook React renderer", "keywords": [ "storybook" @@ -48,12 +48,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^16.0.0", @@ -99,5 +99,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 2ba1a58af64..dae8720ef4e 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Server renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.31", + "@storybook/core-client": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -70,5 +70,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 6f0d4f8ff3d..85d31a5b0be 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Svelte renderer", "keywords": [ "storybook" @@ -52,12 +52,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "sveltedoc-parser": "^4.2.1", "type-fest": "2.19.0" }, @@ -83,5 +83,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index 4dab79e395d..d204ea1e101 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Vue renderer", "keywords": [ "storybook" @@ -48,12 +48,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.31", - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/client-logger": "7.0.0-beta.34", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0", "type-fest": "2.19.0" }, @@ -86,5 +86,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index c39024cfe75..2a6465d53df 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.0.0-beta.31", + "version": "7.0.0-beta.34", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.31", - "@storybook/docs-tools": "7.0.0-beta.31", + "@storybook/core-client": "7.0.0-beta.34", + "@storybook/docs-tools": "7.0.0-beta.34", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.0.0-beta.31", - "@storybook/types": "7.0.0-beta.31", + "@storybook/preview-api": "7.0.0-beta.34", + "@storybook/types": "7.0.0-beta.34", "ts-dedent": "^2.0.0", "type-fest": "2.19.0" }, @@ -80,5 +80,5 @@ ], "platform": "browser" }, - "gitHead": "6d1ea7647fce605b2029077cbd02f655cafe1807" + "gitHead": "b8c17b23e92257c5a09b592dc6b557ba7b94ccea" } diff --git a/code/renderers/vue3/template/stories/ReactiveArgs.vue b/code/renderers/vue3/template/stories/ReactiveArgs.vue index ebf97a55cb7..4ad7fec8a7d 100644 --- a/code/renderers/vue3/template/stories/ReactiveArgs.vue +++ b/code/renderers/vue3/template/stories/ReactiveArgs.vue @@ -2,7 +2,7 @@ - +``` diff --git a/docs/snippets/web-components/list-story-template.js.mdx b/docs/snippets/web-components/list-story-template.js.mdx new file mode 100644 index 00000000000..bd2b7092331 --- /dev/null +++ b/docs/snippets/web-components/list-story-template.js.mdx @@ -0,0 +1,41 @@ +```js +// List.stories.js + +import { html } from 'lit-html'; +import { repeat } from 'lit/directives/repeat.js'; + +import { Unchecked } from './ListItem.stories'; + +export default { + title: 'List', + component: 'demo-list', +}; + +//👇 The ListTemplate construct will be spread to the existing stories. +const ListTemplate = { + render: ({ items, ...args }) => { + return html` + + ${repeat(items, (item) => html`${item}`)} + + `; + }, +}; +export const Empty = { + ...ListTemplate, + args: { + items: [], + }, +}; + +export const OneItem = { + ...ListTemplate, + args: { + items: [ + { + ...Unchecked.args, + }, + ], + }, +}; +``` diff --git a/docs/snippets/web-components/list-story-template.ts.mdx b/docs/snippets/web-components/list-story-template.ts.mdx new file mode 100644 index 00000000000..f74010364f9 --- /dev/null +++ b/docs/snippets/web-components/list-story-template.ts.mdx @@ -0,0 +1,45 @@ +```ts +// List.stories.ts + +import type { Meta, StoryObj } from '@storybook/web-components'; + +import { html } from 'lit-html'; +import { repeat } from 'lit/directives/repeat.js'; + +const meta: Meta = { + title: 'List', + component: 'demo-list', +}; +export default meta; + +type Story = StoryObj; + +//👇 The ListTemplate construct will be spread to the existing stories. +const ListTemplate = { + render: ({ items, ...args }) => { + return html` + + ${repeat(items, (item) => html`${item}`)} + + `; + }, +}; + +export const Empty: Story = { + ...ListTemplate, + args: { + items: [], + }, +}; + +export const OneItem: Story = { + ...ListTemplate, + args: { + items: [ + { + ...Unchecked.args, + }, + ], + }, +}; +``` diff --git a/docs/versions/next.json b/docs/versions/next.json index ad1fdd5bfed..f84c4ccd7ac 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"7.0.0-beta.31","info":{"plain":"#### Features\n\n- Docs: Added source stories and updated API [#20603](https://github.com/storybooks/storybook/pull/20603)\n- Docs: Implement Controls block [#20683](https://github.com/storybooks/storybook/pull/20683)\n- Docs: Created `ArgTypes` component and stories [#20664](https://github.com/storybooks/storybook/pull/20664)\n- Docs: Show primary story description and headline in autodocs [#20604](https://github.com/storybooks/storybook/pull/20604)\n\n#### Bug Fixes\n\n- Source-loader: Fix export default variable references [#20688](https://github.com/storybooks/storybook/pull/20688)\n\n#### Maintenance\n\n- CLI: Make missing-babelrc an automatic migration [#20689](https://github.com/storybooks/storybook/pull/20689)\n- Addon-docs: Update story index generator glob [#20679](https://github.com/storybooks/storybook/pull/20679)\n- Docs: Move validation logic into `context.resolveOf` [#20662](https://github.com/storybooks/storybook/pull/20662)\n- Csf-plugin: Move source to docs.source.originalSource [#20665](https://github.com/storybooks/storybook/pull/20665)\n\n#### Build\n\n- Fix ui example story [#20692](https://github.com/storybooks/storybook/pull/20692)"}} \ No newline at end of file +{"version":"7.0.0-beta.34","info":{"plain":"#### Features\n\n- Addon-docs: Add legacy transitional support for MDX1 [#20747](https://github.com/storybooks/storybook/pull/20747)\n\n#### Bug Fixes\n\n- CLI: Fix global flag corner case [#20776](https://github.com/storybooks/storybook/pull/20776)\n- Csf-tools: Fix ConfigFile string literal property handling [#20785](https://github.com/storybooks/storybook/pull/20785)\n- Angular: Ensure docsMode flag has effect [#20711](https://github.com/storybooks/storybook/pull/20711)\n- Angular: Use Providers in boostrapApplication option [#20746](https://github.com/storybooks/storybook/pull/20746)\n- WebComponents: Fix Button type error [#20722](https://github.com/storybooks/storybook/pull/20722)\n\n#### Build\n\n- Verify consistency of anonymous id [#20781](https://github.com/storybooks/storybook/pull/20781)\n- Build: fix playwright unsynced version in CI [#20778](https://github.com/storybooks/storybook/pull/20778)\n- Upgrade playwright [#20777](https://github.com/storybooks/storybook/pull/20777)\n\n#### Dependency Upgrades\n\n- Deps: Upgrade fs-extra to 11.1.0 [#20772](https://github.com/storybooks/storybook/pull/20772)"}} \ No newline at end of file diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index c1efdfe7c29..b87b7a78cdd 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -138,6 +138,7 @@ If you're working with pure presentational screens, adding stories through [args paths={[ 'react/document-screen-fetch.js.mdx', 'vue/document-screen-fetch.3.js.mdx', + 'vue/document-screen-fetch.ts-3.ts.mdx', 'angular/document-screen-fetch.ts.mdx', 'svelte/document-screen-fetch.js.mdx', 'web-components/document-screen-fetch.js.mdx', @@ -153,6 +154,7 @@ To test your screen with the mocked data, you could write a similar set of stori linkPackageStories(packageDir, { mainConfig, cwd })) - ); + for (const packageDir of existingStories) { + await linkPackageStories(packageDir, { mainConfig, cwd }); + } // Add some extra settings (see above for what these do) if (template.expected.builder === '@storybook/builder-webpack5') { diff --git a/scripts/utils/main-js.ts b/scripts/utils/main-js.ts index b2e6e966fce..a9517f51561 100644 --- a/scripts/utils/main-js.ts +++ b/scripts/utils/main-js.ts @@ -1,6 +1,7 @@ import { existsSync } from 'fs'; import { join, resolve } from 'path'; +import slash from 'slash'; import type { ConfigFile } from '../../code/lib/csf-tools'; import { readConfig } from '../../code/lib/csf-tools'; import { getInterpretedFile } from '../../code/lib/core-common'; @@ -19,5 +20,5 @@ export async function readMainConfig({ cwd }: { cwd: string }) { export function addPreviewAnnotations(mainConfig: ConfigFile, paths: string[]) { const config = mainConfig.getFieldValue(['previewAnnotations']) as string[]; - mainConfig.setFieldValue(['previewAnnotations'], [...(config || []), ...paths]); + mainConfig.setFieldValue(['previewAnnotations'], [...(config || []), ...paths.map(slash)]); } diff --git a/scripts/utils/yarn.ts b/scripts/utils/yarn.ts index 83a18d51399..8db448a343d 100644 --- a/scripts/utils/yarn.ts +++ b/scripts/utils/yarn.ts @@ -20,7 +20,11 @@ export const addPackageResolutions = async ({ cwd, dryRun }: YarnOptions) => { const packageJsonPath = path.join(cwd, 'package.json'); const packageJson = await readJSON(packageJsonPath); - packageJson.resolutions = { ...storybookVersions, 'enhanced-resolve': '~5.10.0' }; + packageJson.resolutions = { + ...storybookVersions, + 'enhanced-resolve': '~5.10.0', // TODO, remove this + playwright: '1.30.0', // this is for our CI test, ensure we use the same version as docker image, it should match version specified in `./code/package.json` and `.circleci/config.yml` + }; await writeJSON(packageJsonPath, packageJson, { spaces: 2 }); }; diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 0f39d78e302..29c32941b5a 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2820,7 +2820,7 @@ __metadata: express: ^4.17.3 fast-glob: ^3.2.12 find-up: ^5.0.0 - fs-extra: ^9.0.1 + fs-extra: ^10.1.0 github-release-from-changelog: ^2.1.1 glob: ^7.1.6 http-server: ^0.12.3 @@ -4345,13 +4345,6 @@ __metadata: languageName: node linkType: hard -"at-least-node@npm:^1.0.0": - version: 1.0.0 - resolution: "at-least-node@npm:1.0.0" - checksum: 4c058baf6df1bc5a1697cf182e2029c58cd99975288a13f9e70068ef5d6f4e1f1fd7c4d2c3c4912eae44797d1725be9700995736deca441b39f3e66d8dee97ef - languageName: node - linkType: hard - "atob-lite@npm:^2.0.0": version: 2.0.0 resolution: "atob-lite@npm:2.0.0" @@ -7570,18 +7563,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^9.0.1": - version: 9.1.0 - resolution: "fs-extra@npm:9.1.0" - dependencies: - at-least-node: ^1.0.0 - graceful-fs: ^4.2.0 - jsonfile: ^6.0.1 - universalify: ^2.0.0 - checksum: 9b808bd884beff5cb940773018179a6b94a966381d005479f00adda6b44e5e3d4abf765135773d849cc27efe68c349e4a7b86acd7d3306d5932c14f3a4b17a92 - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0"