diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96041db16ab..a2458954ccd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 7.6.7
+
+- Core: Skip no-framework error when ignorePreview=true - [#25286](https://github.com/storybookjs/storybook/pull/25286), thanks [@ndelangen](https://github.com/ndelangen)!
+- Dependencies: Semver dependency fixes - [#25283](https://github.com/storybookjs/storybook/pull/25283), thanks [@ndelangen](https://github.com/ndelangen)!
+- Vite: Fix pre-transform error in Vite 5 - [#25329](https://github.com/storybookjs/storybook/pull/25329), thanks [@yannbf](https://github.com/yannbf)!
+- Vue3: Fix pnp by making compiler-core a dependency - [#25311](https://github.com/storybookjs/storybook/pull/25311), thanks [@shilman](https://github.com/shilman)!
+
## 7.6.6
- SvelteKit: Support 2.0 modules with mocks - [#25244](https://github.com/storybookjs/storybook/pull/25244), thanks [@paoloricciuti](https://github.com/paoloricciuti)!
diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md
index b9883dc793e..05f683fc465 100644
--- a/CHANGELOG.prerelease.md
+++ b/CHANGELOG.prerelease.md
@@ -1,3 +1,47 @@
+## 8.0.0-alpha.8
+
+- Addon Links: Remove LinkTo from direct import - [#25418](https://github.com/storybookjs/storybook/pull/25418), thanks [@yannbf](https://github.com/yannbf)!
+- Addon docs: Remove deprecated parameters - [#25469](https://github.com/storybookjs/storybook/pull/25469), thanks [@yannbf](https://github.com/yannbf)!
+- Builder Vite: Remove StorybookViteConfig type in favor of StorybookConfig - [#25441](https://github.com/storybookjs/storybook/pull/25441), thanks [@yannbf](https://github.com/yannbf)!
+- Core: Error on explicit actions while rendering or playing - [#25238](https://github.com/storybookjs/storybook/pull/25238), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
+- Core: Remove collapseAll and expandAll methods - [#25486](https://github.com/storybookjs/storybook/pull/25486), thanks [@yannbf](https://github.com/yannbf)!
+- Core: Remove storyIndexers in favor of experimental_indexers - [#25468](https://github.com/storybookjs/storybook/pull/25468), thanks [@yannbf](https://github.com/yannbf)!
+- Core: Remove unused staticDir type - [#25415](https://github.com/storybookjs/storybook/pull/25415), thanks [@yannbf](https://github.com/yannbf)!
+- Doc blocks: Remove deprecated props from Description block - [#25457](https://github.com/storybookjs/storybook/pull/25457), thanks [@yannbf](https://github.com/yannbf)!
+- Manager API: Remove deprecated navigateToSettingsPage method - [#25467](https://github.com/storybookjs/storybook/pull/25467), thanks [@yannbf](https://github.com/yannbf)!
+- React: Remove deprecated setGlobalConfig portable stories api - [#25442](https://github.com/storybookjs/storybook/pull/25442), thanks [@yannbf](https://github.com/yannbf)!
+- TypeScript: Remove deprecated addons module types - [#25485](https://github.com/storybookjs/storybook/pull/25485), thanks [@yannbf](https://github.com/yannbf)!
+- Types: Remove DecoratorFn, Story, ComponentStory, ComponentStoryObj, ComponentStoryFn and ComponentMeta types - [#25477](https://github.com/storybookjs/storybook/pull/25477), thanks [@yannbf](https://github.com/yannbf)!
+- Types: Remove Framework in favor of Renderer types - [#25476](https://github.com/storybookjs/storybook/pull/25476), thanks [@yannbf](https://github.com/yannbf)!
+- UI: Remove deprecated WithTooltip props - [#25440](https://github.com/storybookjs/storybook/pull/25440), thanks [@yannbf](https://github.com/yannbf)!
+
+## 8.0.0-alpha.7
+
+- Addon-Docs: Upgrade to MDX3 - [#25303](https://github.com/storybookjs/storybook/pull/25303), thanks [@yannbf](https://github.com/yannbf)!
+- CLI: Add Storyshots migration notice - [#25327](https://github.com/storybookjs/storybook/pull/25327), thanks [@yannbf](https://github.com/yannbf)!
+- CLI: Fix regex used in upgrade command - [#25284](https://github.com/storybookjs/storybook/pull/25284), thanks [@yannbf](https://github.com/yannbf)!
+- CLI: Remove --use-npm flag - [#25414](https://github.com/storybookjs/storybook/pull/25414), thanks [@yannbf](https://github.com/yannbf)!
+- Core: Remove unused warnOnLegacyHierarchySeparator type - [#25416](https://github.com/storybookjs/storybook/pull/25416), thanks [@yannbf](https://github.com/yannbf)!
+- Core: Remove vite plugins and drop Vite 3 support - [#25427](https://github.com/storybookjs/storybook/pull/25427), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
+- Maintenance: Add comment to deprecation notice in Button component - [#25411](https://github.com/storybookjs/storybook/pull/25411), thanks [@yannbf](https://github.com/yannbf)!
+- UI: Fix about page layout - [#25396](https://github.com/storybookjs/storybook/pull/25396), thanks [@cdedreuille](https://github.com/cdedreuille)!
+- Viewport: Store viewport, rotation in globals - [#25423](https://github.com/storybookjs/storybook/pull/25423), thanks [@shilman](https://github.com/shilman)!
+- Vite: Fix Vite 5 CJS warnings - [#25005](https://github.com/storybookjs/storybook/pull/25005), thanks [@JReinhold](https://github.com/JReinhold)!
+
+## 8.0.0-alpha.6
+
+- NextJS: Autoconfigure public directory for new projects - [#25279](https://github.com/storybookjs/storybook/pull/25279), thanks [@shilman](https://github.com/shilman)!
+- Vite: Fix pre-transform error in Vite 5 - [#25329](https://github.com/storybookjs/storybook/pull/25329), thanks [@yannbf](https://github.com/yannbf)!
+- Vue3: Fix pnp by making compiler-core a dependency - [#25311](https://github.com/storybookjs/storybook/pull/25311), thanks [@shilman](https://github.com/shilman)!
+
+## 8.0.0-alpha.5
+
+- Core: Remove the `-s` flag from build & dev - [#25266](https://github.com/storybookjs/storybook/pull/25266), thanks [@ndelangen](https://github.com/ndelangen)!
+- Core: Skip no-framework error when ignorePreview=true - [#25286](https://github.com/storybookjs/storybook/pull/25286), thanks [@ndelangen](https://github.com/ndelangen)!
+- Core: Unique outputDir/cacheDir for each configDir - [#25264](https://github.com/storybookjs/storybook/pull/25264), thanks [@ndelangen](https://github.com/ndelangen)!
+- Dependencies: Semver dependency fixes - [#25283](https://github.com/storybookjs/storybook/pull/25283), thanks [@ndelangen](https://github.com/ndelangen)!
+- NextJS: Mock out `server-only` package for RSC - [#25263](https://github.com/storybookjs/storybook/pull/25263), thanks [@shilman](https://github.com/shilman)!
+
## 8.0.0-alpha.4
- API: Remove stories.json support - [#25236](https://github.com/storybookjs/storybook/pull/25236), thanks [@shilman](https://github.com/shilman)!
diff --git a/MIGRATION.md b/MIGRATION.md
index 787e893df97..d054a003c49 100644
--- a/MIGRATION.md
+++ b/MIGRATION.md
@@ -1,8 +1,15 @@
Migration
- [From version 7.x to 8.0.0](#from-version-7x-to-800)
+ - [Removed deprecated shim packages](#removed-deprecated-shim-packages)
+ - [Framework-specific Vite plugins have to be explicitly added](#framework-specific-vite-plugins-have-to-be-explicitly-added)
- [Implicit actions can not be used during rendering (for example in the play function)](#implicit-actions-can-not-be-used-during-rendering-for-example-in-the-play-function)
+ - [MDX related changes](#mdx-related-changes)
+ - [MDX is upgraded to v3](#mdx-is-upgraded-to-v3)
+ - [Dropping support for \*.stories.mdx (CSF in MDX) format and MDX1 support](#dropping-support-for-storiesmdx-csf-in-mdx-format-and-mdx1-support)
+ - [Dropping support for id, name and story in Story block](#dropping-support-for-id-name-and-story-in-story-block)
- [Core changes](#core-changes)
+ - [Dropping support for Yarn 1](#dropping-support-for-yarn-1)
- [Dropping support for Node.js 16](#dropping-support-for-nodejs-16)
- [Autotitle breaking fixes](#autotitle-breaking-fixes)
- [React v18 in the manager UI (including addons)](#react-v18-in-the-manager-ui-including-addons)
@@ -10,12 +17,30 @@
- [UI layout state has changed shape](#ui-layout-state-has-changed-shape)
- [New UI and props for Button and IconButton components](#new-ui-and-props-for-button-and-iconbutton-components)
- [Icons is deprecated](#icons-is-deprecated)
- - [React-docgen component analysis by default](#react-docgen-component-analysis-by-default)
- [Removed postinstall](#removed-postinstall)
- [Removed stories.json](#removed-storiesjson)
- [Framework-specific changes](#framework-specific-changes)
- - [Angular: Drop support for Angular \< 15](#angular-drop-support-for-angular--15)
- - [Next.js: Drop support for version \< 13.5](#nextjs-drop-support-for-version--135)
+ - [React](#react)
+ - [`react-docgen` component analysis by default](#react-docgen-component-analysis-by-default)
+ - [Next.js](#nextjs)
+ - [Require Next.js 13.5 and up](#require-nextjs-135-and-up)
+ - [Angular](#angular)
+ - [Require Angular 15 and up](#require-angular-15-and-up)
+ - [Svelte](#svelte)
+ - [Require Svelte 4 and up](#require-svelte-4-and-up)
+ - [Deprecations which are now removed](#deprecations-which-are-now-removed)
+ - [--use-npm flag in storybook CLI](#--use-npm-flag-in-storybook-cli)
+ - [`setGlobalConfig` from `@storybook/react`](#setglobalconfig-from-storybookreact)
+ - [StorybookViteConfig type from @storybook/builder-vite](#storybookviteconfig-type-from-storybookbuilder-vite)
+ - [props from WithTooltipComponent from @storybook/components](#props-from-withtooltipcomponent-from-storybookcomponents)
+ - [LinkTo direct import from addon-links](#linkto-direct-import-from-addon-links)
+ - [DecoratorFn, Story, ComponentStory, ComponentStoryObj, ComponentStoryFn and ComponentMeta TypeScript types](#decoratorfn-story-componentstory-componentstoryobj-componentstoryfn-and-componentmeta-typescript-types)
+ - ["Framework" TypeScript types](#framework-typescript-types)
+ - [`navigateToSettingsPage` method from Storybook's manager-api](#navigatetosettingspage-method-from-storybooks-manager-api)
+ - [storyIndexers](#storyindexers)
+ - [Deprecated docs parameters](#deprecated-docs-parameters)
+ - [Description Doc block properties](#description-doc-block-properties)
+ - [Manager API expandAll and collapseAll methods](#manager-api-expandall-and-collapseall-methods)
- [From version 7.5.0 to 7.6.0](#from-version-750-to-760)
- [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated)
- [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated)
@@ -331,6 +356,36 @@
## From version 7.x to 8.0.0
+### Removed deprecated shim packages
+
+In Storybook 7, these packages existed for backwards compatibility, but were marked as deprecated:
+
+- `@storybook/addons` - this package has been split into 2 packages: `@storybook/preview-api` and `@storybook/manager-api`, see more here: [New Addons API](#new-addons-api).
+- `@storybook/channel-postmessage` - this package has been merged into `@storybook/channel`.
+- `@storybook/channel-websocket` - this package has been merged into `@storybook/channel`.
+- `@storybook/client-api` - this package has been merged into `@storybook/preview-api`.
+- `@storybook/core-client` - this package has been merged into `@storybook/preview-api`.
+- `@storybook/preview-web` - this package has been merged into `@storybook/preview-api`.
+- `@storybook/store` - this package has been merged into `@storybook/preview-api`.
+- `@storybook/api` - this package has been replaced with `@storybook/manager-api`.
+
+This section explains the rationale, and the required changed you might have to make: [New Addons API](#new-addons-api)
+
+### Framework-specific Vite plugins have to be explicitly added
+
+In Storybook 7, we would automatically add frameworks-specific Vite plugins, e.g. `@vitejs/plugin-react` if not installed.
+In Storybook 8 those plugins have to be added explicitly in the user's `vite.config.ts`:
+
+```ts
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [react()],
+});
+```
+
### Implicit actions can not be used during rendering (for example in the play function)
In Storybook 7, we inferred if the component accepts any action props,
@@ -380,8 +435,32 @@ To summarize:
- This allows users and (test) integrators to run or build storybook without docgen, boosting the user performance and allows tools to give quicker feedback.
- This will make sure that we can one day lazy load docgen, without changing how stories are rendered.
+### MDX related changes
+
+#### MDX is upgraded to v3
+
+Storybook now uses MDX3 under the hood. This change contains many improvements and a few small breaking changes that probably won't affect you. However we recommend checking the [migration notes from MDX here](https://mdxjs.com/blog/v3/).
+
+#### Dropping support for *.stories.mdx (CSF in MDX) format and MDX1 support
+
+In Storybook 7, we deprecated the ability of using MDX both for documentation and for defining stories in the same .stories.mdx file. It is now removed, and Storybook won't support .stories.mdx files anymore. We provide migration scripts to help you onto the new format.
+
+If you were using the [legacy MDX1 format](#legacy-mdx1-support), you will have to remove the `legacyMdx1` main.js feature flag and the `@storybook/mdx1-csf` package.
+
+Alongside with this change, the `jsxOptions` configuration was removed as it is not used anymore.
+
+[More info here](https://storybook.js.org/docs/migration-guide#storiesmdx-to-mdxcsf).
+
+#### Dropping support for id, name and story in Story block
+
+Referencing stories by `id`, `name` or `story` in the Story block is not possible anymore. [More info here](#story-block).
+
### Core changes
+#### Dropping support for Yarn 1
+
+Storybook will stop providing fixes aimed at Yarn 1 projects. This does not necessarily mean that Storybook will stop working for Yarn 1 projects, just that the team won't provide more fixes aimed at it. For context, it's been 6 years since the release of Yarn 1, and Yarn is currently in version 4, which was [released in October 2023](https://yarnpkg.com/blog/release/4.0).
+
#### Dropping support for Node.js 16
In Storybook 8, we have dropped Node.js 16 support since it reached end-of-life on 2023-09-11. Storybook 8 supports Node.js 18 and above.
@@ -407,22 +486,24 @@ Addon authors are advised to upgrade to react v18.
#### Storyshots has been removed
-Storyshots was an addon for storybook which allowed users to turn their stories into automated snapshot-tests.
+Storyshots was an addon for Storybook which allowed users to turn their stories into automated snapshot tests.
+
+Every story would automatically be taken into account and create a snapshot file.
-Every story would automatically be taken into account and created a snapshot-file for.
+Snapshot testing has since fallen out of favor and is no longer recommended.
-Snapshot-testing has since fallen out of favor and is no longer recommended.
+In addition to its limited use, and high chance of false positives, Storyshots ran code developed to run in the browser in NodeJS via JSDOM.
+JSDOM has limitations and is not a perfect emulation of the browser environment; therefore, Storyshots was always a pain to set up and maintain.
-In addition to it's limited use, and high chance of false-positives, storyshots ran code developed to run in the browser in NodeJS via JSDOM.
-JSDOM has limitations and is not a perfect emulation of the browser environment; therefore storyshots was always a pain to setup and maintain.
+The Storybook team has built the test-runner as a direct replacement, which utilizes Playwright to connect to an actual browser where Storybook runs the code.
-The storybook team has build the test-runner as a direct replacement, which utilizes playwright to connect to an actual browser where storybook runs the code.
+In addition, CSF has expanded to allow for play functions to be defined on stories, which allows for more complex testing scenarios, fully integrated within Storybook itself (and supported by the test-runner, and not Storyshots).
-In addition CSF has expanded to allow for play-function to be defined on stories, which allows for more complex testing scenarios, fully integrated within storybook itself (and supported by the test-runner, and not storyshots).
+Finally, storyStoreV7: true (the default and only option in Storybook 8), was not supported by Storyshots.
-Finally `storyStoreV7: true` (the default and only options in storybook 8), was not supported by storyshots.
+By removing Storyshots, the Storybook team was unblocked from moving (eventually) to an ESM-only Storybook, which is a big step towards a more modern Storybook.
-By removing storyshots, the storybook team was unblocked from moving (eventually) to an ESM-only storybook, which is a big step towards a more modern storybook.
+Please check the [migration guide](https://storybook.js.org/docs/writing-tests/storyshots-migration-guide) that we prepared.
#### UI layout state has changed shape
@@ -454,7 +535,21 @@ The `IconButton` doesn't have any deprecated props but it now uses the new `Butt
In Storybook 8.0 we are introducing a new icon library available with `@storybook/icons`. We are deprecating the `Icons` component in `@storybook/components` and recommend that addon creators and Storybook maintainers use the new `@storybook/icons` component instead.
-#### React-docgen component analysis by default
+#### Removed postinstall
+
+We removed the `@storybook/postinstall` package, which provided some utilities for addons to programmatically modify user configuration files on install. This package was years out of date, so this should be a non-disruptive change. If your addon used the package, you can view the old source code [here](https://github.com/storybookjs/storybook/tree/release-7-5/code/lib/postinstall) and adapt it into your addon.
+
+#### Removed stories.json
+
+In addition to the built storybook, `storybook build` generates two files, `index.json` and `stories.json`, that list out the contents of the Storybook. `stories.json` is a legacy format and we included it for backwards compatibility. As of 8.0 we no longer build `stories.json` by default, and we will remove it completely in 9.0.
+
+In the meantime if you have code that relies on `stories.json`, you can find code that transforms the "v4" `index.json` to the "v3" `stories.json` format (and their respective TS types): https://github.com/storybookjs/storybook/blob/release-7-5/code/lib/core-server/src/utils/stories-json.ts#L71-L91
+
+### Framework-specific changes
+
+#### React
+
+##### `react-docgen` component analysis by default
In Storybook 7, we used `react-docgen-typescript` to analyze React component props and auto-generate controls. In Storybook 8, we have moved to `react-docgen` as the new default. `react-docgen` is dramatically more efficient, shaving seconds off of dev startup times. However, it only analyzes basic TypeScript constructs.
@@ -470,25 +565,135 @@ export default {
For more information see: https://storybook.js.org/docs/react/api/main-config-typescript#reactdocgen
-#### Removed postinstall
+#### Next.js
-We removed the `@storybook/postinstall` package, which provided some utilities for addons to programmatically modify user configuration files on install. This package was years out of date, so this should be a non-disruptive change. If your addon used the package, you can view the old source code [here](https://github.com/storybookjs/storybook/tree/release-7-5/code/lib/postinstall) and adapt it into your addon.
+##### Require Next.js 13.5 and up
-#### Removed stories.json
+Starting in 8.0, Storybook requires Next.js 13.5 and up.
-In addition to the built storybook, `storybook build` generates two files, `index.json` and `stories.json`, that list out the contents of the Storybook. `stories.json` is a legacy format and we included it for backwards compatibility. As of 8.0 we no longer build `stories.json` by default, and we will remove it completely in 9.0.
+#### Angular
-In the meantime if you have code that relies on `stories.json`, you can find code that transforms the "v4" `index.json` to the "v3" `stories.json` format (and their respective TS types): https://github.com/storybookjs/storybook/blob/release-7-5/code/lib/core-server/src/utils/stories-json.ts#L71-L91
+##### Require Angular 15 and up
-### Framework-specific changes
+Starting in 8.0, Storybook requires Angular 15 and up.
+
+#### Svelte
+
+##### Require Svelte 4 and up
+
+Starting in 8.0, Storybook requires Svelte 4 and up.
+
+### Deprecations which are now removed
+
+#### --use-npm flag in storybook CLI
+
+The `--use-npm` is now removed. Use `--package-manager=npm` instead. [More info here](#cli-option---use-npm-deprecated).
+
+#### `setGlobalConfig` from `@storybook/react`
+
+The `setGlobalConfig` (used for reusing stories in your tests) is now removed in favor of `setProjectAnnotations`.
+
+```ts
+import { setProjectAnnotations } from `@storybook/testing-react`.
+```
+
+#### StorybookViteConfig type from @storybook/builder-vite
+
+The `StorybookViteConfig` type is now removed in favor of `StorybookConfig`:
+
+```ts
+import type { StorybookConfig } from '@storybook/react-vite';
+```
+
+#### props from WithTooltipComponent from @storybook/components
+
+The deprecated properties `tooltipShown`, `closeOnClick`, and `onVisibilityChange` of `WithTooltipComponent` from `@storybook/components` are now removed. Please replace them:
+
+```tsx
+
+ ...
+
+```
+
+#### LinkTo direct import from addon-links
+
+The `LinkTo` (React component) direct import from `@storybook/addon-links` is now removed. You have to import it from `@storybook/addon-links/react` instead.
+
+```ts
+// before
+import LinkTo from '@storybook/addon-links';
+
+// after
+import LinkTo from '@storybook/addon-links/react';
+```
+
+#### DecoratorFn, Story, ComponentStory, ComponentStoryObj, ComponentStoryFn and ComponentMeta TypeScript types
+
+The `Story` type is now removed in favor of `StoryFn` and `StoryObj`. More info [here](#story-type-deprecated).
+
+The `DecoratorFn` type is now removed in favor of `Decorator`. [More info](#renamed-decoratorfn-to-decorator).
+
+For React, the `ComponentStory`, `ComponentStoryObj`, `ComponentStoryFn` and `ComponentMeta` types are now removed in favor of `StoryFn`, `StoryObj` and `Meta`. [More info](#componentstory-componentstoryobj-componentstoryfn-and-componentmeta-types-are-deprecated).
+
+#### "Framework" TypeScript types
+
+The Framework types such as `ReactFramework` are now removed in favor of Renderer types such as `ReactRenderer`. This affects all frameworks. [More info](#renamed-xframework-to-xrenderer).
+
+#### `navigateToSettingsPage` method from Storybook's manager-api
+
+The `navigateToSettingsPage` method from manager-api is now removed in favor of `changeSettingsTab`.
+
+```ts
+export const Component = () => {
+ const api = useStorybookApi();
+
+ const someHandler = () => {
+ // Old method: api.navigateToSettingsPage('/settings/about');
+ api.changeSettingsTab('about'); // the /settings path is not necessary anymore
+ };
+
+ // ...
+}
+```
+
+#### storyIndexers
+
+The Storybook's main.js configuration property `storyIndexers` is now removed in favor of `experimental_indexers`. [More info](#storyindexers-is-replaced-with-experimental_indexers).
+
+#### Deprecated docs parameters
+
+The following story and meta parameters are now removed:
+
+```ts
+parameters.docs.iframeHeight // becomes docs.story.iframeHeight
+parameters.docs.inlineStories // becomes docs.story.inline
+parameters.jsx.transformSource // becomes parameters.docs.source.transform
+parameters.docs.transformSource // becomes parameters.docs.source.transform
+parameters.docs.source.transformSource // becomes parameters.docs.source.transform
+```
-#### Angular: Drop support for Angular \< 15
+More info [here](#autodocs-changes) and [here](#source-block).
-Starting in 8.0, we drop support for Angular < 15
+#### Description Doc block properties
-#### Next.js: Drop support for version \< 13.5
+`children`, `markdown` and `type` are now removed in favor of the `of` property. [More info](#doc-blocks).
-Starting in 8.0, we drop support for Next.js < 13.5.
+#### Manager API expandAll and collapseAll methods
+
+The `collapseAll` and `expandAll` APIs (possibly used by addons) are now removed. Please emit events for these actions instead:
+
+```ts
+import { STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL } from '@storybook/core-events';
+import { useStorybookApi } from '@storybook/manager-api';
+
+const api = useStorybookApi()
+api.collapseAll() // becomes api.emit(STORIES_COLLAPSE_ALL)
+api.expandAll() // becomes api.emit(STORIES_EXPAND_ALL)
+```
## From version 7.5.0 to 7.6.0
@@ -549,7 +754,7 @@ To summarize:
#### typescript.skipBabel deprecated
-We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescirpt.skipCompiler` instead.
+We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescript.skipCompiler` instead.
#### Primary doc block accepts of prop
@@ -2085,6 +2290,8 @@ During the 7.0 dev cycle we will be preparing recommendations and utilities to m
#### `Story` type deprecated
+_Has codemod_
+
In 6.x you were able to do this:
```ts
@@ -2093,24 +2300,43 @@ import type { Story } from '@storybook/react';
export const MyStory: Story = () => ;
```
-But this will produce a deprecation warning in 7.0 because `Story` has been deprecated.
-To fix the deprecation warning, use the `StoryFn` type:
+However with the introduction of CSF3, the `Story` type has been deprecated in favor of two other types: `StoryFn` for CSF2 and `StoryObj` for CSF3.
```ts
-import type { StoryFn } from '@storybook/react';
+import type { StoryFn, StoryObj } from '@storybook/react';
-export const MyStory: StoryFn = () => ;
+export const MyCsf2Story: StoryFn = () => ;
+export const MyCsf3Story: StoryObj = {
+ render: () =>
+};
```
This change is part of our move to CSF3, which uses objects instead of functions to represent stories.
You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
+We have set up a codemod that attempts to automatically migrate your code for you (update the glob to suit your needs):
+
+```
+npx storybook@next migrate upgrade-deprecated-types --glob="**/*.stories.tsx"
+```
+
#### `ComponentStory`, `ComponentStoryObj`, `ComponentStoryFn` and `ComponentMeta` types are deprecated
-The type of StoryObj and StoryFn have been changed in 7.0 so that both the "component" as "the props of the component" will be accepted as the generic parameter.
+_Has codemod_
+
+The type of `StoryObj` and `StoryFn` have been changed in 7.0 so that both the "component" as "the props of the component" will be accepted as the generic parameter. You can now replace the types:
+
+```
+ComponentStory -> StoryFn (CSF2) or StoryObj (CSF3)
+ComponentStoryObj -> StoryObj
+ComponentStoryFn -> StoryFn
+ComponentMeta -> Meta
+```
+
+Here are a few examples:
```ts
-import type { Story } from '@storybook/react';
+import type { StoryFn, StoryObj } from '@storybook/react';
import { Button, ButtonProps } from './Button';
// This works in 7.0, making the ComponentX types redundant.
@@ -2130,6 +2356,12 @@ export const CSF2Story: StoryFn = (args) => ;
CSF2Story.args = { label: 'Label' };
```
+We have set up a codemod that attempts to automatically migrate your code for you (update the glob to suit your needs):
+
+```
+npx storybook@next migrate upgrade-deprecated-types --glob="**/*.stories.tsx"
+```
+
#### Renamed `renderToDOM` to `renderToCanvas`
The "rendering" function that renderers (ex-frameworks) must export (`renderToDOM`) has been renamed to `renderToCanvas` to acknowledge that some consumers of frameworks/the preview do not work with DOM elements.
diff --git a/README.md b/README.md
index 7c174bdcc25..263ee639e99 100644
--- a/README.md
+++ b/README.md
@@ -136,7 +136,7 @@ For additional help, share your issue in [the repo's GitHub Discussions](https:/
See [Addon / Framework Support Table](https://storybook.js.org/docs/react/api/frameworks-feature-support)
-### Deprecated Addons
+### Deprecated/Removed Addons
| Addons | |
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
@@ -147,12 +147,14 @@ See [Addon / Framework Support Table](https://storybook.js.org/docs/react/api/fr
| [options](https://www.npmjs.com/package/@storybook/addon-options) | Customize the Storybook UI in code |
| [storyshots](https://github.com/storybookjs/storybook/tree/main/code/addons/storyshots-core) | Snapshot testing for components in Storybook |
-To continue improving your experience, we have to eventually deprecate certain addons in favor of new and better tools.
+To continue improving your experience, we have to eventually deprecate or remove certain addons in favor of new and better tools.
If you're using info/notes, we highly recommend you migrate to [docs](code/addons/docs/) instead, and [here is a guide](code/addons/docs/docs/recipes.md#migrating-from-notesinfo-addons) to help you.
If you're using contexts, we highly recommend you migrate to [toolbars](https://github.com/storybookjs/storybook/tree/next/code/addons/toolbars) and [here is a guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-addon-contexts) to help you.
+If you're using addon-storyshots, we highly recommend you migrate to the Storybook [test-runner](https://github.com/storybookjs/test-runner) and [here is a guide](https://storybook.js.org/docs/writing-tests/storyshots-migration-guide) to help you.
+
## Badges & Presentation materials
We have a badge! Link it to your live Storybook example.
diff --git a/code/.eslintrc.js b/code/.eslintrc.js
index d770489b658..06b9f06ee75 100644
--- a/code/.eslintrc.js
+++ b/code/.eslintrc.js
@@ -39,6 +39,18 @@ module.exports = {
allowIndexSignaturePropertyAccess: true,
},
],
+ '@typescript-eslint/no-restricted-imports': [
+ 'error',
+ {
+ paths: [
+ {
+ name: 'vite',
+ message: 'Please dynamically import from vite instead, to force the use of ESM',
+ allowTypeImports: true,
+ },
+ ],
+ },
+ ],
},
overrides: [
{
diff --git a/code/addons/a11y/README.md b/code/addons/a11y/README.md
index 7ff0d885ec0..64730ef6103 100755
--- a/code/addons/a11y/README.md
+++ b/code/addons/a11y/README.md
@@ -193,6 +193,10 @@ export const inaccessible = () => (
);
```
+## Automate accessibility tests with test runner
+
+The test runner does not apply any rules that you have set on your stories by default. You can configure the runner to correctly apply the rules by [following the guide on the Storybook docs](https://storybook.js.org/docs/writing-tests/accessibility-testing#automate-accessibility-tests-with-test-runner).
+
## Roadmap
- Make UI accessible
diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json
index a62171ca2e4..4dafd318f36 100644
--- a/code/addons/a11y/package.json
+++ b/code/addons/a11y/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json
index da85fef889d..436300a6343 100644
--- a/code/addons/actions/package.json
+++ b/code/addons/actions/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json
index bad8d53c24b..53caf8806c8 100644
--- a/code/addons/backgrounds/package.json
+++ b/code/addons/backgrounds/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
diff --git a/code/addons/controls/README.md b/code/addons/controls/README.md
index 1d3a8ae3797..3b04a3a75de 100644
--- a/code/addons/controls/README.md
+++ b/code/addons/controls/README.md
@@ -176,38 +176,4 @@ Like [story parameters](https://storybook.js.org/docs/react/writing-stories/para
### How do controls work with MDX?
-MDX compiles to component story format (CSF) under the hood, so there's a direct mapping for every example above using the `args` and `argTypes` props.
-
-Consider this example in CSF:
-
-```js
-import { Button } from './Button';
-export default {
- title: 'Button',
- component: Button,
- argTypes: {
- background: { control: 'color' },
- },
-};
-
-const Template = (args) => ;
-export const Basic = Template.bind({});
-Basic.args = { label: 'hello', background: '#ff0' };
-```
-
-Here's the MDX equivalent:
-
-```jsx
-import { Meta, Story } from '@storybook/addon-docs';
-import { Button } from './Button';
-
-
-
-export const Template = (args) =>
-
-
- {Template.bind({})}
-
-```
-
-For more info, see a full [Controls example in MDX for Vue](https://raw.githubusercontent.com/storybookjs/storybook/next/code/examples/vue-kitchen-sink/src/stories/addon-controls.stories.mdx).
+When importing stories from your CSF file into MDX, controls will work the same way. See [the documentation](https://storybook.js.org/docs/writing-docs/mdx#basic-example) for examples.
\ No newline at end of file
diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json
index 8580c7c8c91..c8765ea4feb 100644
--- a/code/addons/controls/package.json
+++ b/code/addons/controls/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
diff --git a/code/addons/docs/README.md b/code/addons/docs/README.md
index 9a9a3debad2..9495cf2c150 100644
--- a/code/addons/docs/README.md
+++ b/code/addons/docs/README.md
@@ -110,20 +110,6 @@ export default {
};
```
-If using in conjunction with the [storyshots add-on](https://github.com/storybookjs/storybook/blob/next/code/addons/storyshots-core/README.md), you will need to
-configure Jest to transform MDX stories into something Storyshots can understand:
-
-Add the following to your Jest configuration:
-
-```json
-{
- "transform": {
- "^.+\\.[tj]sx?$": "babel-jest",
- "^.+\\.mdx$": "@storybook/addon-docs/jest-transform-mdx"
- }
-}
-```
-
### Be sure to check framework specific installation needs
- [React](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/react) (covered here)
@@ -143,7 +129,6 @@ export default {
{
name: '@storybook/addon-docs',
options: {
- jsxOptions: {},
csfPluginOptions: null,
mdxPluginOptions: {},
},
@@ -152,8 +137,6 @@ export default {
};
```
-`jsxOptions` are options that will be passed to `@babel/preset-react` for `.md` and `.mdx` files.
-
`csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`.
> With the release of version 7.0, it is no longer possible to import `.md` files directly into Storybook using the `transcludeMarkdown` [option](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#importing-plain-markdown-files-with-transcludemarkdown-has-changed). Instead, we recommend using the [`Markdown`](https://storybook.js.org/docs/react/api/doc-block-markdown) Doc Block for importing Markdown files into your Storybook documentation.
diff --git a/code/addons/docs/docs/docspage.md b/code/addons/docs/docs/docspage.md
index 8a8da1fc773..3fef9898f95 100644
--- a/code/addons/docs/docs/docspage.md
+++ b/code/addons/docs/docs/docspage.md
@@ -154,7 +154,7 @@ addParameters({
});
```
-With that function, anyone using the docs addon for `@storybook/vue` can make their stories render inline, either globally with the `inlineStories` docs parameter, or on a per-story-basis using the `inline` prop on the `` doc block. If you come up with an elegant and flexible implementation for the `prepareForInline` function for your own framework, let us know! We'd love to make it the default configuration, to make inline stories more accessible for a larger variety of frameworks!
+With that function, anyone using the docs addon for `@storybook/vue` can make their stories render inline, either globally with the `docs.story.inline` parameter, or on a per-story-basis using the `inline` prop on the `` doc block. If you come up with an elegant and flexible implementation for the `prepareForInline` function for your own framework, let us know! We'd love to make it the default configuration, to make inline stories more accessible for a larger variety of frameworks!
## Show/Hide code
diff --git a/code/addons/docs/jest-transform-mdx.js b/code/addons/docs/jest-transform-mdx.js
deleted file mode 100644
index eb3106944ae..00000000000
--- a/code/addons/docs/jest-transform-mdx.js
+++ /dev/null
@@ -1,22 +0,0 @@
-const path = require('path');
-const { ScriptTransformer } = require('@jest/transform');
-const { dedent } = require('ts-dedent');
-
-const { compile } = require('@storybook/mdx2-csf');
-
-module.exports = {
- async processAsync(src, filename, config, { instrument }) {
- const code = await compile(src, { skipCsf: false });
- const result = dedent`
- /* @jsx mdx */
- import React from 'react'
- import { mdx } from '@mdx-js/react'
- ${code}
- `;
-
- const extension = path.extname(filename);
- const jsFileName = `${filename.slice(0, -extension.length)}.js`;
-
- return new ScriptTransformer(config).transformSource(jsFileName, result, instrument);
- },
-};
diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json
index ba80d582f9f..ae3b1d031d1 100644
--- a/code/addons/docs/package.json
+++ b/code/addons/docs/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
@@ -65,13 +65,13 @@
"require": "./dist/shims/mdx-react-shim.js",
"import": "./dist/shims/mdx-react-shim.mjs"
},
+ "./mdx-loader": "./dist/mdx-loader.js",
"./svelte/HOC.svelte": "./svelte/HOC.svelte",
"./ember": "./ember/index.js",
"./ember/index.js": "./ember/index.js",
"./angular": "./angular/index.js",
"./angular/index.js": "./angular/index.js",
"./web-components/index.js": "./web-components/index.js",
- "./jest-transform-mdx": "./jest-transform-mdx.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
@@ -98,15 +98,14 @@
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
- "@jest/transform": "^29.3.1",
- "@mdx-js/react": "^2.1.5",
+ "@babel/core": "^7.12.3",
+ "@mdx-js/react": "^3.0.0",
"@storybook/blocks": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/csf-plugin": "workspace:*",
"@storybook/csf-tools": "workspace:*",
"@storybook/global": "^5.0.0",
- "@storybook/mdx2-csf": "^1.0.0",
"@storybook/node-logger": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/react-dom-shim": "workspace:*",
@@ -120,7 +119,9 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
+ "@mdx-js/mdx": "^3.0.0",
"@rollup/pluginutils": "^5.0.2",
+ "@storybook/test": "workspace:*",
"typescript": "^5.3.2",
"vite": "^4.0.4"
},
@@ -133,10 +134,8 @@
"./src/preset.ts",
"./src/preview.ts",
"./src/blocks.ts",
- "./src/shims/mdx-react-shim.ts"
- ],
- "externals": [
- "@storybook/mdx1-csf"
+ "./src/shims/mdx-react-shim.ts",
+ "./src/mdx-loader.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
diff --git a/code/addons/docs/src/compiler/index.test.ts b/code/addons/docs/src/compiler/index.test.ts
new file mode 100644
index 00000000000..d390e7257ec
--- /dev/null
+++ b/code/addons/docs/src/compiler/index.test.ts
@@ -0,0 +1,669 @@
+import { expect, describe, it } from 'vitest';
+import { dedent } from 'ts-dedent';
+import { compileSync, compile } from './index';
+
+expect.addSnapshotSerializer({
+ serialize: (val: any) => (typeof val === 'string' ? val : val.toString()),
+ test: (_val) => true,
+});
+
+// Remove unnecessary noise from snapshots
+const clean = (code: string) => {
+ const mdxContentRegex =
+ /export default function MDXContent\([^)]*\) \{(?:[^{}]*|{(?:[^{}]*|{[^{}]*})*})*\}/gs;
+
+ const mdxMissingReferenceRegex =
+ /function _missingMdxReference\([^)]*\) \{(?:[^{}]*|{(?:[^{}]*|{[^{}]*})*})*\}/gs;
+
+ return code.replace(mdxMissingReferenceRegex, '').replace(mdxContentRegex, '');
+};
+
+describe('mdx3', () => {
+ it('supports AdjacentBlockJSX', () => {
+ const input = dedent`
+
+ `;
+
+ expect(clean(compileSync(input))).toMatchInlineSnapshot(`
+ import {jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ function _createMdxContent(props) {
+ return _jsx("style", {
+ children: \`
+ h1 {
+ color: blue;
+ }
+ \`
+ });
+ }
+ `);
+ });
+
+ it('supports Await in MDX', () => {
+ const input = dedent`
+ {await Promise.resolve('Hello World')}
+ `;
+
+ expect(clean(compileSync(input))).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ async function _createMdxContent(props) {
+ return _jsx(_Fragment, {
+ children: await Promise.resolve('Hello World')
+ });
+ }
+ `);
+ });
+
+ it('supports ES2024', () => {
+ const input = dedent`
+ export const obj = {
+ nested: {
+ property: 'Hello world!'
+ }
+ };
+
+ export const value = obj?.nested?.property ?? 'Default Value';
+
+ Value: {value}
+ `;
+
+ expect(clean(compileSync(input))).toMatchInlineSnapshot(`
+ import {jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ export const obj = {
+ nested: {
+ property: 'Hello world!'
+ }
+ };
+ export const value = obj?.nested?.property ?? 'Default Value';
+ function _createMdxContent(props) {
+ const _components = {
+ p: "p",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_components.p, {
+ children: ["Value: ", value]
+ });
+ }
+ `);
+ });
+});
+
+describe('mdx2', () => {
+ it('works', () => {
+ const input = dedent`
+ # hello
+
+
+
+ world {2 + 1}
+ `;
+
+ expect(clean(compileSync(input))).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ p: "p",
+ ..._provideComponents(),
+ ...props.components
+ }, {Meta} = _components;
+ if (!Meta) _missingMdxReference("Meta", true);
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "hello"
+ }), "\\n", _jsx(Meta, {
+ title: "foobar"
+ }), "\\n", _jsxs(_components.p, {
+ children: ["world ", 2 + 1]
+ })]
+ });
+ }
+ `);
+ });
+
+ it('standalone jsx expressions', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ # Standalone JSX expressions
+
+ {3 + 3}
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "Standalone JSX expressions"
+ }), "\\n", 3 + 3]
+ });
+ }
+ `);
+ });
+});
+
+describe('full snapshots', () => {
+ it('compileSync', () => {
+ const input = dedent`
+ # hello
+
+
+
+ world {2 + 1}
+ `;
+
+ expect(compileSync(input)).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ p: "p",
+ ..._provideComponents(),
+ ...props.components
+ }, {Meta} = _components;
+ if (!Meta) _missingMdxReference("Meta", true);
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "hello"
+ }), "\\n", _jsx(Meta, {
+ title: "foobar"
+ }), "\\n", _jsxs(_components.p, {
+ children: ["world ", 2 + 1]
+ })]
+ });
+ }
+ export default function MDXContent(props = {}) {
+ const {wrapper: MDXLayout} = {
+ ..._provideComponents(),
+ ...props.components
+ };
+ return MDXLayout ? _jsx(MDXLayout, {
+ ...props,
+ children: _jsx(_createMdxContent, {
+ ...props
+ })
+ }) : _createMdxContent(props);
+ }
+ function _missingMdxReference(id, component) {
+ throw new Error("Expected " + (component ? "component" : "object") + " \`" + id + "\` to be defined: you likely forgot to import, pass, or provide it.");
+ }
+ `);
+ });
+ it('compile', async () => {
+ const input = dedent`
+ # hello
+
+
+
+ world {2 + 1}
+ `;
+
+ expect(await compile(input)).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ p: "p",
+ ..._provideComponents(),
+ ...props.components
+ }, {Meta} = _components;
+ if (!Meta) _missingMdxReference("Meta", true);
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "hello"
+ }), "\\n", _jsx(Meta, {
+ title: "foobar"
+ }), "\\n", _jsxs(_components.p, {
+ children: ["world ", 2 + 1]
+ })]
+ });
+ }
+ export default function MDXContent(props = {}) {
+ const {wrapper: MDXLayout} = {
+ ..._provideComponents(),
+ ...props.components
+ };
+ return MDXLayout ? _jsx(MDXLayout, {
+ ...props,
+ children: _jsx(_createMdxContent, {
+ ...props
+ })
+ }) : _createMdxContent(props);
+ }
+ function _missingMdxReference(id, component) {
+ throw new Error("Expected " + (component ? "component" : "object") + " \`" + id + "\` to be defined: you likely forgot to import, pass, or provide it.");
+ }
+ `);
+ });
+ it('sync & async should match', async () => {
+ const input = dedent`
+ # hello
+
+
+
+ world {2 + 1}
+ `;
+
+ const ou1 = compileSync(input);
+ const ou2 = await compile(input);
+
+ expect(ou1).toEqual(ou2);
+ });
+ it('canvas without story children', () => {
+ const input = dedent`
+ import { Canvas } from '@storybook/addon-docs';
+
+
+ `;
+ expect(compileSync(input)).toMatchInlineSnapshot(`
+ import {jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Canvas} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ return _jsx(Canvas, {
+ children: _jsx("h2", {
+ children: "Some here"
+ })
+ });
+ }
+ export default function MDXContent(props = {}) {
+ const {wrapper: MDXLayout} = {
+ ..._provideComponents(),
+ ...props.components
+ };
+ return MDXLayout ? _jsx(MDXLayout, {
+ ...props,
+ children: _jsx(_createMdxContent, {
+ ...props
+ })
+ }) : _createMdxContent(props);
+ }
+ `);
+ });
+});
+
+describe('docs-mdx-compiler-plugin', () => {
+ it('csf-imports.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Story, Meta, Canvas } from '@storybook/addon-docs';
+ import { Welcome, Button } from '@storybook/angular/demo';
+ import * as MyStories from './My.stories';
+ import { Other } from './Other.stories';
+
+
+
+ # Stories from CSF imports
+
+
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Story, Meta, Canvas} from '@storybook/addon-docs';
+ import {Welcome, Button} from '@storybook/angular/demo';
+ import * as MyStories from './My.stories';
+ import {Other} from './Other.stories';
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(Meta, {
+ title: "MDX/CSF imports"
+ }), "\\n", _jsx(_components.h1, {
+ children: "Stories from CSF imports"
+ }), "\\n", _jsx(Story, {
+ of: MyStories.Basic
+ }), "\\n", _jsx(Canvas, {
+ children: _jsx(Story, {
+ of: Other
+ })
+ })]
+ });
+ }
+ `);
+ });
+
+ it('docs-only.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Meta } from '@storybook/addon-docs';
+
+
+
+ # Documentation only
+
+ This is a documentation-only MDX file which cleans a dummy 'docsOnly: true' story.
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Meta} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ p: "p",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(Meta, {
+ title: "docs-only"
+ }), "\\n", _jsx(_components.h1, {
+ children: "Documentation only"
+ }), "\\n", _jsx(_components.p, {
+ children: "This is a documentation-only MDX file which cleans a dummy 'docsOnly: true' story."
+ })]
+ });
+ }
+ `);
+ });
+
+ it('meta-quotes-in-title.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Meta } from '@storybook/addon-docs';
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Meta} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ return _jsx(Meta, {
+ title: "Addons/Docs/what's in a title?"
+ });
+ }
+ `);
+ });
+
+ it('non-story-exports.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Button } from '@storybook/react/demo';
+ import { Story, Meta } from '@storybook/addon-docs';
+
+
+
+ # Story definition
+
+
+
+ export const two = 2;
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Button} from '@storybook/react/demo';
+ import {Story, Meta} from '@storybook/addon-docs';
+ export const two = 2;
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(Meta, {
+ title: "Button"
+ }), "\\n", _jsx(_components.h1, {
+ children: "Story definition"
+ }), "\\n", _jsx(Story, {
+ of: Button
+ })]
+ });
+ }
+ `);
+ });
+
+ it('story-current.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Story } from '@storybook/addon-docs';
+
+ # Current story
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Story} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "Current story"
+ }), "\\n", _jsx(Story, {
+ id: "."
+ })]
+ });
+ }
+ `);
+ });
+
+ it('story-references.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Story } from '@storybook/addon-docs';
+
+ # Story reference
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Story} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(_components.h1, {
+ children: "Story reference"
+ }), "\\n", _jsx(Story, {
+ id: "welcome--welcome"
+ })]
+ });
+ }
+ `);
+ });
+
+ it('title-template-string.mdx', () => {
+ expect(
+ clean(
+ compileSync(
+ [
+ "import { Meta, Story } from '@storybook/addon-docs';",
+ "import { titleFunction } from '../title-generators';",
+ '',
+ // eslint-disable-next-line no-template-curly-in-string
+ "",
+ ].join('\n')
+ )
+ )
+ ).toMatchInlineSnapshot(`
+ import {jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Meta, Story} from '@storybook/addon-docs';
+ import {titleFunction} from '../title-generators';
+ function _createMdxContent(props) {
+ return _jsx(Meta, {
+ title: \`\${titleFunction('template')}\`
+ });
+ }
+ `);
+ });
+
+ describe('csf3', () => {
+ it('auto-title-docs-only.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Meta } from '@storybook/addon-docs';
+
+
+
+ # Auto-title Docs Only
+
+ Some **markdown** here!
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Meta} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ const _components = {
+ h1: "h1",
+ p: "p",
+ strong: "strong",
+ ..._provideComponents(),
+ ...props.components
+ };
+ return _jsxs(_Fragment, {
+ children: [_jsx(Meta, {}), "\\n", _jsx(_components.h1, {
+ children: "Auto-title Docs Only"
+ }), "\\n", _jsxs(_components.p, {
+ children: ["Some ", _jsx(_components.strong, {
+ children: "markdown"
+ }), " here!"]
+ })]
+ });
+ }
+ `);
+ });
+
+ it('auto-title.mdx', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Button } from '@storybook/react/demo';
+ import { Story, Meta } from '@storybook/addon-docs';
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {jsx as _jsx} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Button} from '@storybook/react/demo';
+ import {Story, Meta} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ return _jsx(Meta, {
+ component: Button
+ });
+ }
+ `);
+ });
+ });
+
+ it('style tag', () => {
+ expect(
+ clean(
+ compileSync(dedent`
+ import { Meta } from '@storybook/addon-docs';
+
+
+
+
+ `)
+ )
+ ).toMatchInlineSnapshot(`
+ import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
+ import {useMDXComponents as _provideComponents} from "@mdx-js/react";
+ import {Meta} from '@storybook/addon-docs';
+ function _createMdxContent(props) {
+ return _jsxs(_Fragment, {
+ children: [_jsx(Meta, {
+ title: "Example/Introduction"
+ }), "\\n", _jsx("style", {
+ children: \`
+ .subheading {
+ --mediumdark: '#999999';
+ font-weight: 900;
+ font-size: 13px;
+ color: #999;
+ letter-spacing: 6px;
+ line-height: 24px;
+ text-transform: uppercase;
+ margin-bottom: 12px;
+ margin-top: 40px;
+ }
+ .link-list {
+ display: grid;
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr 1fr;
+ row-gap: 10px;
+ }
+ \`
+ })]
+ });
+ }
+ `);
+ });
+});
diff --git a/code/addons/docs/src/compiler/index.ts b/code/addons/docs/src/compiler/index.ts
new file mode 100644
index 00000000000..79af50d3fb1
--- /dev/null
+++ b/code/addons/docs/src/compiler/index.ts
@@ -0,0 +1,29 @@
+import { compile as mdxCompile, compileSync as mdxCompileSync } from '@mdx-js/mdx';
+
+import type { CompileOptions, MdxCompileOptions } from './types';
+
+export type { CompileOptions, MdxCompileOptions };
+
+export const compile = async (input: string, { mdxCompileOptions = {} }: CompileOptions = {}) => {
+ const options = getCompilerOptions(mdxCompileOptions);
+
+ const mdxResult = await mdxCompile(input, options);
+
+ return mdxResult.toString();
+};
+
+export const compileSync = (input: string, { mdxCompileOptions = {} }: CompileOptions = {}) => {
+ const options = getCompilerOptions(mdxCompileOptions);
+
+ const mdxResult = mdxCompileSync(input, options);
+
+ return mdxResult.toString();
+};
+
+function getCompilerOptions(mdxCompileOptions: MdxCompileOptions): MdxCompileOptions {
+ return {
+ providerImportSource: '@mdx-js/react',
+ rehypePlugins: [],
+ ...mdxCompileOptions,
+ };
+}
diff --git a/code/addons/docs/src/compiler/types.ts b/code/addons/docs/src/compiler/types.ts
new file mode 100644
index 00000000000..9ef068b0aee
--- /dev/null
+++ b/code/addons/docs/src/compiler/types.ts
@@ -0,0 +1,7 @@
+import type { compile as mdxCompile } from '@mdx-js/mdx';
+
+export type MdxCompileOptions = Parameters[1];
+
+export interface CompileOptions {
+ mdxCompileOptions?: MdxCompileOptions;
+}
diff --git a/code/addons/docs/src/mdx-loader.ts b/code/addons/docs/src/mdx-loader.ts
new file mode 100644
index 00000000000..639fb0c70f0
--- /dev/null
+++ b/code/addons/docs/src/mdx-loader.ts
@@ -0,0 +1,42 @@
+import type { transformAsync } from '@babel/core';
+import type { compile as mdxCompile } from '@mdx-js/mdx';
+import { compile } from './compiler';
+
+export type MdxCompileOptions = Parameters[1];
+export type BabelOptions = Parameters[1];
+
+export interface CompileOptions {
+ mdxCompileOptions?: MdxCompileOptions;
+}
+
+const DEFAULT_RENDERER = `
+import React from 'react';
+`; // Adjust this import based on your actual webpack version and typings
+
+// Kind of like a mock so we don't have to install Webpack just for the types
+type LoaderOptions = {
+ filepath?: string;
+ [key: string]: any;
+} & any;
+
+interface LoaderContext {
+ async: () => (err: Error | null, result?: string) => void;
+ getOptions: () => LoaderOptions;
+ resourcePath: string;
+}
+
+async function loader(this: LoaderContext, content: string): Promise {
+ const callback = this.async();
+ const options = { ...this.getOptions(), filepath: this.resourcePath };
+
+ try {
+ const result = await compile(content, options);
+ const code = `${DEFAULT_RENDERER}\n${result}`;
+ return callback(null, code);
+ } catch (err: any) {
+ console.error('Error loading:', this.resourcePath);
+ return callback(err);
+ }
+}
+
+export default loader;
diff --git a/code/addons/docs/src/plugins/mdx-plugin.ts b/code/addons/docs/src/plugins/mdx-plugin.ts
index 046e6c742bf..c011a9202fb 100644
--- a/code/addons/docs/src/plugins/mdx-plugin.ts
+++ b/code/addons/docs/src/plugins/mdx-plugin.ts
@@ -5,12 +5,11 @@ import remarkExternalLinks from 'remark-external-links';
import { createFilter } from '@rollup/pluginutils';
import { dirname, join } from 'path';
-const isStorybookMdx = (id: string) => id.endsWith('.stories.mdx') || id.endsWith('.story.mdx');
+import { compile } from '../compiler';
/**
- * Storybook uses two different loaders when dealing with MDX:
+ * Storybook uses a single loader when dealing with MDX:
*
- * - *stories.mdx and *story.mdx are compiled with the CSF compiler
* - *.mdx are compiled with the MDX compiler directly
*
* @see https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/recipes.md#csf-stories-with-arbitrary-mdx
@@ -18,8 +17,8 @@ const isStorybookMdx = (id: string) => id.endsWith('.stories.mdx') || id.endsWit
export async function mdxPlugin(options: Options): Promise {
const include = /\.mdx$/;
const filter = createFilter(include);
- const { features, presets } = options;
- const { mdxPluginOptions, jsxOptions } = await presets.apply>('options', {});
+ const { presets } = options;
+ const { mdxPluginOptions } = await presets.apply>('options', {});
return {
name: 'storybook:mdx-plugin',
@@ -27,10 +26,6 @@ export async function mdxPlugin(options: Options): Promise {
async transform(src, id) {
if (!filter(id)) return undefined;
- const { compile } = features?.legacyMdx1
- ? await import('@storybook/mdx1-csf')
- : await import('@storybook/mdx2-csf');
-
const mdxLoaderOptions = await options.presets.apply('mdxLoaderOptions', {
...mdxPluginOptions,
mdxCompileOptions: {
@@ -43,19 +38,18 @@ export async function mdxPlugin(options: Options): Promise {
mdxPluginOptions?.mdxCompileOptions?.remarkPlugins ?? []
),
},
- jsxOptions,
});
const code = String(
await compile(src, {
- skipCsf: !isStorybookMdx(id),
...mdxLoaderOptions,
})
);
return {
code,
- map: null, // TODO: update mdx2-csf to return the map
+ // TODO: support source maps
+ map: null,
};
},
};
diff --git a/code/addons/docs/src/plugins/mdx-plugin.types.d.ts b/code/addons/docs/src/plugins/mdx-plugin.types.d.ts
deleted file mode 100644
index fea94f85dc2..00000000000
--- a/code/addons/docs/src/plugins/mdx-plugin.types.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-declare module '@storybook/mdx1-csf';
diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts
index 0877643bae9..8d623fe5b97 100644
--- a/code/addons/docs/src/preset.ts
+++ b/code/addons/docs/src/preset.ts
@@ -1,15 +1,11 @@
-import fs from 'fs-extra';
import { dirname, join } from 'path';
import remarkSlug from 'remark-slug';
import remarkExternalLinks from 'remark-external-links';
-import { dedent } from 'ts-dedent';
-import type { DocsOptions, Indexer, Options, PresetProperty } from '@storybook/types';
+import type { DocsOptions, Options, PresetProperty } from '@storybook/types';
import type { CsfPluginOptions } from '@storybook/csf-plugin';
-import type { JSXOptions, CompileOptions } from '@storybook/mdx2-csf';
-import { global } from '@storybook/global';
-import { loadCsf } from '@storybook/csf-tools';
import { logger } from '@storybook/node-logger';
+import type { CompileOptions } from './compiler';
/**
* Get the resolvedReact preset, which points either to
@@ -27,27 +23,14 @@ const getResolvedReact = async (options: Options) => {
// addon-docs, causing addon-docs's dependencies not to be hoisted.
// This might also affect regular users who have a similar setup.
// Explicitly alias @mdx-js/react to avoid this issue.
- mdx: resolvedReact.mdx ?? dirname(require.resolve('@mdx-js/react/package.json')),
+ mdx: resolvedReact.mdx ?? dirname(require.resolve('@mdx-js/react')),
};
};
async function webpack(
webpackConfig: any = {},
options: Options & {
- /**
- * @deprecated
- * Use `jsxOptions` to customize options used by @babel/preset-react
- */
- configureJsx: boolean;
- /**
- * @deprecated
- * Use `jsxOptions` to customize options used by @babel/preset-react
- */
- mdxBabelOptions?: any;
- /** @deprecated */
- sourceLoaderOptions: any;
csfPluginOptions: CsfPluginOptions | null;
- jsxOptions?: JSXOptions;
mdxPluginOptions?: CompileOptions;
} /* & Parameters<
typeof createCompiler
@@ -55,19 +38,9 @@ async function webpack(
) {
const { module = {} } = webpackConfig;
- // it will reuse babel options that are already in use in storybook
- // also, these babel options are chained with other presets.
- const {
- csfPluginOptions = {},
- jsxOptions = {},
- sourceLoaderOptions = null,
- configureJsx,
- mdxBabelOptions,
- mdxPluginOptions = {},
- } = options;
+ const { csfPluginOptions = {}, mdxPluginOptions = {} } = options;
const mdxLoaderOptions: CompileOptions = await options.presets.apply('mdxLoaderOptions', {
- skipCsf: true,
...mdxPluginOptions,
mdxCompileOptions: {
providerImportSource: join(
@@ -79,35 +52,9 @@ async function webpack(
mdxPluginOptions?.mdxCompileOptions?.remarkPlugins ?? []
),
},
- jsxOptions,
});
- if (sourceLoaderOptions) {
- throw new Error(dedent`
- Addon-docs no longer uses source-loader in 7.0.
-
- To update your configuration, please see migration instructions here:
-
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropped-source-loader--storiesof-static-snippets
- `);
- }
-
- if (mdxBabelOptions || configureJsx) {
- throw new Error(dedent`
- Addon-docs no longer uses configureJsx or mdxBabelOptions in 7.0.
-
- To update your configuration, please see migration instructions here:
-
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropped-addon-docs-manual-babel-configuration
- `);
- }
-
- 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');
+ logger.info(`Addon-docs: using MDX3`);
// Use the resolvedReact preset to alias react and react-dom to either the users version or the version shipped with addon-docs
const { react, reactDom, mdx } = await getResolvedReact(options);
@@ -155,24 +102,12 @@ async function webpack(
...module,
rules: [
...(module.rules || []),
- {
- test: /(stories|story)\.mdx$/,
- use: [
- {
- loader: mdxLoader,
- options: {
- ...mdxLoaderOptions,
- skipCsf: false,
- },
- },
- ],
- },
{
test: /\.mdx$/,
exclude: /(stories|story)\.mdx$/,
use: [
{
- loader: mdxLoader,
+ loader: require.resolve('./mdx-loader'),
options: mdxLoaderOptions,
},
],
@@ -184,36 +119,6 @@ async function webpack(
return result;
}
-export const createStoriesMdxIndexer = (legacyMdx1?: boolean): Indexer => ({
- test: /(stories|story)\.mdx$/,
- createIndex: async (fileName, opts) => {
- let code = (await fs.readFile(fileName, 'utf-8')).toString();
- const { compile } = legacyMdx1
- ? await import('@storybook/mdx1-csf')
- : await import('@storybook/mdx2-csf');
- code = await compile(code, {});
- const csf = loadCsf(code, { ...opts, fileName }).parse();
-
- const { indexInputs, stories } = csf;
-
- return indexInputs.map((input, index) => {
- const docsOnly = stories[index].parameters?.docsOnly;
- const tags = input.tags ? input.tags : [];
- if (docsOnly) {
- tags.push('stories-mdx-docsOnly');
- }
- // the mdx-csf compiler automatically adds the 'stories-mdx' tag to meta, here' we're just making sure it is always there
- if (!tags.includes('stories-mdx')) {
- tags.push('stories-mdx');
- }
- return { ...input, tags };
- });
- },
-});
-
-const indexers: PresetProperty<'experimental_indexers'> = (existingIndexers) =>
- [createStoriesMdxIndexer(global.FEATURES?.legacyMdx1)].concat(existingIndexers || []);
-
const docs = (docsOptions: DocsOptions) => {
return {
...docsOptions,
@@ -259,7 +164,6 @@ export const viteFinal = async (config: any, options: Options) => {
* something down the dependency chain is using typescript namespaces, which are not supported by rollup-plugin-dts
*/
const webpackX = webpack as any;
-const indexersX = indexers as any;
const docsX = docs as any;
/**
@@ -272,7 +176,7 @@ const docsX = docs as any;
export const resolvedReact = async (existing: any) => ({
react: existing?.react ?? dirname(require.resolve('react/package.json')),
reactDom: existing?.reactDom ?? dirname(require.resolve('react-dom/package.json')),
- mdx: existing?.mdx ?? dirname(require.resolve('@mdx-js/react/package.json')),
+ mdx: existing?.mdx ?? dirname(require.resolve('@mdx-js/react')),
});
const optimizeViteDeps = [
@@ -283,4 +187,4 @@ const optimizeViteDeps = [
'markdown-to-jsx',
];
-export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs, optimizeViteDeps };
+export { webpackX as webpack, docsX as docs, optimizeViteDeps };
diff --git a/code/addons/docs/src/typings.d.ts b/code/addons/docs/src/typings.d.ts
index 04846593c04..cfa3c4639f8 100644
--- a/code/addons/docs/src/typings.d.ts
+++ b/code/addons/docs/src/typings.d.ts
@@ -3,7 +3,6 @@ declare module 'remark-slug';
declare module 'remark-external-links';
declare module 'acorn-jsx';
declare module 'vue/dist/vue';
-declare module '@storybook/mdx1-csf';
declare module 'sveltedoc-parser' {
export function parse(options: any): Promise;
diff --git a/code/addons/docs/template/stories/docspage/basic.stories.ts b/code/addons/docs/template/stories/docspage/basic.stories.ts
index 6eb3f19523b..9982b444a48 100644
--- a/code/addons/docs/template/stories/docspage/basic.stories.ts
+++ b/code/addons/docs/template/stories/docspage/basic.stories.ts
@@ -1,9 +1,10 @@
import { global as globalThis } from '@storybook/global';
+import { fn } from '@storybook/test';
export default {
component: globalThis.Components.Button,
tags: ['autodocs'],
- args: { label: 'Click Me!' },
+ args: { label: 'Click Me!', onClick: fn() },
parameters: { chromatic: { disable: true } },
};
diff --git a/code/addons/docs/template/stories/stories-mdx/basic.stories.mdx b/code/addons/docs/template/stories/stories-mdx/basic.stories.mdx
deleted file mode 100644
index 7aec7745397..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/basic.stories.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
-import { global as globalThis } from '@storybook/global';
-
-
-
-# MDX Stories
-
-This file demonstrates defining stories inside MDX.
-
-
-
-
-
-
-
-
diff --git a/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.non-stories.js b/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.non-stories.js
deleted file mode 100644
index abbc65c94dd..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.non-stories.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// NOTE: commented out default since these stories are re-exported
-// in the primary file './csf-docs-with-mdx-docs.stories.mdx'
-//
-// export default {
-// title: 'Addons/Docs/csf-with-mdx-docs',
-// component: Button,
-// };
-
-export const Primary = {
- args: { label: 'Primary' },
-};
-
-export const Secondary = {
- args: { label: 'Secondary' },
-};
-
-export const ImplicitName = {
- args: { label: 'Implicit Name' },
-};
diff --git a/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.stories.mdx b/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.stories.mdx
deleted file mode 100644
index dbb010e80e5..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/csf-in-mdx.stories.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
-import { global as globalThis } from '@storybook/global';
-import * as Csf from './csf-in-mdx.non-stories.js';
-
-
-
-# Legacy CSF in MDX Stories
-
-This file demonstrates legacy reuse of CSF stories inside MDX. This mechanism has been
-overhauled and improved in 7.0, and the legacy mode is now deprecated and will be
-removed in 8.0.
-
-
-
-
-
-
-
-## Duplicate stories
-
-Reference story by ID to show it multiple times in a page.
-
-
diff --git a/code/addons/docs/template/stories/stories-mdx/iframe.stories.mdx b/code/addons/docs/template/stories/stories-mdx/iframe.stories.mdx
deleted file mode 100644
index f947df3b35c..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/iframe.stories.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
-import { global as globalThis } from '@storybook/global';
-
-
-
-# MDX Stories
-
-This file demonstrates rendering iframe stories in MDX.
-
-
-
-
-
-
diff --git a/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx b/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx
deleted file mode 100644
index aef8fe5df0b..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
-import { global as globalThis } from '@storybook/global';
-
- console.log('component play')} />
-
-# MDX Play function Stories
-
-This file demonstrates defining stories inside MDX.
-
-
-
-
diff --git a/code/addons/docs/template/stories/stories-mdx/unattached.stories.mdx b/code/addons/docs/template/stories/stories-mdx/unattached.stories.mdx
deleted file mode 100644
index c327ecb7373..00000000000
--- a/code/addons/docs/template/stories/stories-mdx/unattached.stories.mdx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { Meta } from '@storybook/addon-docs';
-
-
-
-# Unattached `stories.mdx` file
\ No newline at end of file
diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json
index 8844085a583..252e0af86de 100644
--- a/code/addons/essentials/package.json
+++ b/code/addons/essentials/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@@ -43,6 +43,7 @@
"./outline/manager": "./dist/outline/manager.js",
"./toolbars/manager": "./dist/toolbars/manager.js",
"./viewport/manager": "./dist/viewport/manager.js",
+ "./viewport/preview": "./dist/viewport/preview.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
@@ -102,7 +103,8 @@
"./src/docs/preview.ts",
"./src/highlight/preview.ts",
"./src/measure/preview.ts",
- "./src/outline/preview.ts"
+ "./src/outline/preview.ts",
+ "./src/viewport/preview.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17"
diff --git a/code/addons/essentials/src/viewport/preview.ts b/code/addons/essentials/src/viewport/preview.ts
new file mode 100644
index 00000000000..34ee7de4561
--- /dev/null
+++ b/code/addons/essentials/src/viewport/preview.ts
@@ -0,0 +1,2 @@
+// @ts-expect-error (no types needed for this)
+export * from '@storybook/addon-viewport/preview';
diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json
index 357ab8cae1e..78ebee0bc0c 100644
--- a/code/addons/gfm/package.json
+++ b/code/addons/gfm/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",
diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json
index 4da655f3e8c..438504d733f 100644
--- a/code/addons/highlight/package.json
+++ b/code/addons/highlight/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",
diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json
index a221e1c7169..dd322662ce3 100644
--- a/code/addons/interactions/package.json
+++ b/code/addons/interactions/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",
diff --git a/code/addons/interactions/src/Panel.tsx b/code/addons/interactions/src/Panel.tsx
index 3d5733710d1..3523c64bf5f 100644
--- a/code/addons/interactions/src/Panel.tsx
+++ b/code/addons/interactions/src/Panel.tsx
@@ -4,10 +4,10 @@ import React, { Fragment, memo, useEffect, useMemo, useRef, useState } from 'rea
import { useAddonState, useChannel, useParameter } from '@storybook/manager-api';
import {
FORCE_REMOUNT,
- IGNORED_EXCEPTION,
STORY_RENDER_PHASE_CHANGED,
STORY_THREW_EXCEPTION,
PLAY_FUNCTION_THREW_EXCEPTION,
+ UNHANDLED_ERRORS_WHILE_PLAYING,
} from '@storybook/core-events';
import { EVENTS, type Call, CallStates, type LogItem } from '@storybook/instrumenter';
@@ -91,6 +91,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
hasException: false,
caughtException: undefined,
interactionsCount: 0,
+ unhandledErrors: undefined,
});
// local state
@@ -104,6 +105,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
interactions = [],
isPlaying = false,
caughtException = undefined,
+ unhandledErrors = undefined,
} = addonState;
// Log and calls are tracked in a ref so we don't needlessly rerender.
@@ -157,6 +159,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
hasException: false,
caughtException: undefined,
interactionsCount: 0,
+ unhandledErrors: undefined,
});
return;
}
@@ -180,11 +183,10 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
set((s) => ({ ...s, isErrored: true }));
},
[PLAY_FUNCTION_THREW_EXCEPTION]: (e) => {
- if (e?.message !== IGNORED_EXCEPTION.message) {
- set((s) => ({ ...s, caughtException: e }));
- } else {
- set((s) => ({ ...s, caughtException: undefined }));
- }
+ set((s) => ({ ...s, caughtException: e }));
+ },
+ [UNHANDLED_ERRORS_WHILE_PLAYING]: (e) => {
+ set((s) => ({ ...s, unhandledErrors: e }));
},
},
[collapsed]
@@ -224,7 +226,10 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
const [fileName] = storyFilePath.toString().split('/').slice(-1);
const scrollToTarget = () => scrollTarget?.scrollIntoView({ behavior: 'smooth', block: 'end' });
- const hasException = !!caughtException || interactions.some((v) => v.status === CallStates.ERROR);
+ const hasException =
+ !!caughtException ||
+ !!unhandledErrors ||
+ interactions.some((v) => v.status === CallStates.ERROR);
if (isErrored) {
return ;
@@ -240,6 +245,7 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
fileName={fileName}
hasException={hasException}
caughtException={caughtException}
+ unhandledErrors={unhandledErrors}
isPlaying={isPlaying}
pausedAt={pausedAt}
endRef={endRef}
diff --git a/code/addons/interactions/src/components/Interaction.stories.tsx b/code/addons/interactions/src/components/Interaction.stories.tsx
index ea03a78431d..4ae080dac30 100644
--- a/code/addons/interactions/src/components/Interaction.stories.tsx
+++ b/code/addons/interactions/src/components/Interaction.stories.tsx
@@ -1,4 +1,4 @@
-import type { ComponentStoryObj, ComponentMeta } from '@storybook/react';
+import type { StoryObj, Meta } from '@storybook/react';
import { expect } from '@storybook/jest';
import { CallStates } from '@storybook/instrumenter';
import { userEvent, within } from '@storybook/testing-library';
@@ -7,7 +7,7 @@ import { getCalls } from '../mocks';
import { Interaction } from './Interaction';
import SubnavStories from './Subnav.stories';
-type Story = ComponentStoryObj;
+type Story = StoryObj;
export default {
title: 'Addons/Interactions/Interaction',
@@ -17,7 +17,7 @@ export default {
controls: SubnavStories.args.controls,
controlStates: SubnavStories.args.controlStates,
},
-} as ComponentMeta;
+} as Meta;
export const Active: Story = {
args: {
diff --git a/code/addons/interactions/src/components/Interaction.tsx b/code/addons/interactions/src/components/Interaction.tsx
index 5c817e71a0a..c5e5e41f3d5 100644
--- a/code/addons/interactions/src/components/Interaction.tsx
+++ b/code/addons/interactions/src/components/Interaction.tsx
@@ -10,6 +10,7 @@ import { MethodCall } from './MethodCall';
import { StatusIcon } from './StatusIcon';
import type { Controls } from './InteractionsPanel';
+import { isJestError } from '../utils';
const MethodCallWrapper = styled.div(() => ({
fontFamily: typography.fonts.mono,
@@ -112,8 +113,8 @@ const RowMessage = styled('div')(({ theme }) => ({
},
}));
-const Exception = ({ exception }: { exception: Call['exception'] }) => {
- if (exception.message.startsWith('expect(')) {
+export const Exception = ({ exception }: { exception: Call['exception'] }) => {
+ if (isJestError(exception)) {
return ;
}
const paragraphs = exception.message.split('\n\n');
@@ -121,7 +122,6 @@ const Exception = ({ exception }: { exception: Call['exception'] }) => {
return (
{paragraphs[0]}
-
{exception.showDiff && exception.diff ? (
<>
diff --git a/code/addons/interactions/src/components/InteractionsPanel.tsx b/code/addons/interactions/src/components/InteractionsPanel.tsx
index 6fad03daaf4..3f56926af3a 100644
--- a/code/addons/interactions/src/components/InteractionsPanel.tsx
+++ b/code/addons/interactions/src/components/InteractionsPanel.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable react/no-array-index-key */
import * as React from 'react';
import { Link, Placeholder } from '@storybook/components';
import { type Call, CallStates, type ControlStates } from '@storybook/instrumenter';
@@ -7,6 +8,7 @@ import { transparentize } from 'polished';
import { Subnav } from './Subnav';
import { Interaction } from './Interaction';
+import { isTestAssertionError } from '../utils';
export interface Controls {
start: (args: any) => void;
@@ -30,6 +32,7 @@ interface InteractionsPanelProps {
fileName?: string;
hasException?: boolean;
caughtException?: Error;
+ unhandledErrors?: SerializedError[];
isPlaying?: boolean;
pausedAt?: Call['id'];
calls: Map;
@@ -37,16 +40,15 @@ interface InteractionsPanelProps {
onScrollToEnd?: () => void;
}
-const Container = styled.div<{ withException: boolean }>(({ theme, withException }) => ({
+const Container = styled.div(({ theme }) => ({
minHeight: '100%',
background: theme.background.content,
- ...(withException && {
- backgroundColor:
- theme.base === 'dark' ? transparentize(0.93, theme.color.negative) : theme.background.warning,
- }),
}));
const CaughtException = styled.div(({ theme }) => ({
+ borderBottom: `1px solid ${theme.appBorderColor}`,
+ backgroundColor:
+ theme.base === 'dark' ? transparentize(0.93, theme.color.negative) : theme.background.warning,
padding: 15,
fontSize: theme.typography.size.s2 - 1,
lineHeight: '19px',
@@ -69,9 +71,13 @@ const CaughtExceptionDescription = styled.p({
margin: 0,
padding: '0 0 20px',
});
+
const CaughtExceptionStack = styled.pre(({ theme }) => ({
margin: 0,
padding: 0,
+ '&:not(:last-child)': {
+ paddingBottom: 16,
+ },
fontSize: theme.typography.size.s1 - 1,
}));
@@ -84,13 +90,14 @@ export const InteractionsPanel: React.FC = React.memo(
fileName,
hasException,
caughtException,
+ unhandledErrors,
isPlaying,
pausedAt,
onScrollToEnd,
endRef,
}) {
return (
-
+
{(interactions.length > 0 || hasException) && (
= React.memo(
/>
))}
- {caughtException && !caughtException.message?.startsWith('ignoredException') && (
+ {caughtException && !isTestAssertionError(caughtException) && (
Caught exception in play function
-
- This story threw an error after it finished rendering which means your interactions
- couldn' t be run.Go to this story' s play function in {fileName} to fix.
-
- {caughtException.stack || `${caughtException.name}: ${caughtException.message}`}
+ {printSerializedError(caughtException)}
)}
+ {unhandledErrors && (
+
+ Unhandled Errors
+
+ Found {unhandledErrors.length} unhandled error{unhandledErrors.length > 1 ? 's' : ''}{' '}
+ while running the play function. This might cause false positive assertions. Resolve
+ unhandled errors or ignore unhandled errors with setting the
+ test.dangerouslyIgnoreUnhandledErrors{' '}
+ parameter to true.
+
+
+ {unhandledErrors.map((error, i) => (
+
+ {printSerializedError(error)}
+
+ ))}
+
+ )}
{!isPlaying && !caughtException && interactions.length === 0 && (
@@ -150,3 +171,13 @@ export const InteractionsPanel: React.FC = React.memo(
);
}
);
+
+interface SerializedError {
+ name: string;
+ stack?: string;
+ message: string;
+}
+
+function printSerializedError(error: SerializedError) {
+ return error.stack || `${error.name}: ${error.message}`;
+}
diff --git a/code/addons/interactions/src/preview.ts b/code/addons/interactions/src/preview.ts
index 54c7c18faab..80515b644da 100644
--- a/code/addons/interactions/src/preview.ts
+++ b/code/addons/interactions/src/preview.ts
@@ -1,61 +1,22 @@
-/* eslint-disable no-param-reassign,no-underscore-dangle */
-///
-
-import { addons } from '@storybook/preview-api';
-import { global } from '@storybook/global';
-import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
+/* eslint-disable no-underscore-dangle */
import type {
- Renderer,
- ArgsEnhancer,
+ Args,
+ LoaderFunction,
PlayFunction,
PlayFunctionContext,
StepLabel,
- Args,
} from '@storybook/types';
import { instrument } from '@storybook/instrumenter';
-import { ModuleMocker } from 'jest-mock';
-
-const JestMock = new ModuleMocker(global);
-const fn = JestMock.fn.bind(JestMock);
-
-// Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.
-const { action } = instrument({ action: fn }, { retain: true });
-const channel = addons.getChannel();
-const spies: any[] = [];
-
-channel.on(FORCE_REMOUNT, () => spies.forEach((mock) => mock?.mockClear?.()));
-channel.on(STORY_RENDER_PHASE_CHANGED, ({ newPhase }) => {
- if (newPhase === 'loading') spies.forEach((mock) => mock?.mockClear?.());
-});
-const addSpies = (id: string, val: any, key?: string): any => {
- try {
- if (Object.prototype.toString.call(val) === '[object Object]') {
- // We have to mutate the original object for this to survive HMR.
- // eslint-disable-next-line no-restricted-syntax
- for (const [k, v] of Object.entries(val)) val[k] = addSpies(id, v, k);
- return val;
- }
- if (Array.isArray(val)) {
- return val.map((item, index) => addSpies(id, item, `${key}[${index}]`));
- }
- if (typeof val === 'function' && val.isAction && !val._isMockFunction) {
- Object.defineProperty(val, 'name', { value: key, writable: false });
- Object.defineProperty(val, '__storyId__', { value: id, writable: false });
- const spy = action(val);
- spies.push(spy);
- return spy;
- }
- } catch (e) {
- // ignore
- }
- return val;
-};
-
-const addActionsFromArgTypes: ArgsEnhancer = ({ id, initialArgs }) =>
- addSpies(id, initialArgs);
+export const { step: runStep } = instrument(
+ {
+ step: (label: StepLabel, play: PlayFunction, context: PlayFunctionContext) =>
+ play(context),
+ },
+ { intercept: true }
+);
-const instrumentSpies: ArgsEnhancer = ({ initialArgs }) => {
+const instrumentSpies: LoaderFunction = ({ initialArgs }) => {
const argTypesWithAction = Object.entries(initialArgs).filter(
([, value]) =>
typeof value === 'function' &&
@@ -68,20 +29,13 @@ const instrumentSpies: ArgsEnhancer = ({ initialArgs }) => {
const instrumented = instrument({ [key]: () => value }, { retain: true })[key];
acc[key] = instrumented();
// this enhancer is being called multiple times
+ // eslint-disable-next-line no-param-reassign
value._instrumented = true;
return acc;
}, {} as Args);
};
-export const argsEnhancers = [addActionsFromArgTypes, instrumentSpies];
-
-export const { step: runStep } = instrument(
- {
- step: (label: StepLabel, play: PlayFunction, context: PlayFunctionContext) =>
- play(context),
- },
- { intercept: true }
-);
+export const argsEnhancers = [instrumentSpies];
export const parameters = {
throwPlayFunctionExceptions: false,
diff --git a/code/addons/interactions/src/utils.ts b/code/addons/interactions/src/utils.ts
new file mode 100644
index 00000000000..1b08eca12a2
--- /dev/null
+++ b/code/addons/interactions/src/utils.ts
@@ -0,0 +1,23 @@
+export function isTestAssertionError(error: unknown) {
+ return isChaiError(error) || isJestError(error);
+}
+
+export function isChaiError(error: unknown) {
+ return (
+ error &&
+ typeof error === 'object' &&
+ 'name' in error &&
+ typeof error.name === 'string' &&
+ error.name === 'AssertionError'
+ );
+}
+
+export function isJestError(error: unknown) {
+ return (
+ error &&
+ typeof error === 'object' &&
+ 'message' in error &&
+ typeof error.message === 'string' &&
+ error.message.startsWith('expect(')
+ );
+}
diff --git a/code/addons/interactions/template/stories/basics.stories.ts b/code/addons/interactions/template/stories/basics.stories.ts
index e8c14245aa9..cf6e34eddf2 100644
--- a/code/addons/interactions/template/stories/basics.stories.ts
+++ b/code/addons/interactions/template/stories/basics.stories.ts
@@ -1,17 +1,18 @@
import { global as globalThis } from '@storybook/global';
import {
- within,
- waitFor,
+ expect,
+ fn,
fireEvent,
userEvent,
+ waitFor,
waitForElementToBeRemoved,
-} from '@storybook/testing-library';
-import { expect } from '@storybook/jest';
+ within,
+} from '@storybook/test';
export default {
component: globalThis.Components.Form,
- argTypes: {
- onSuccess: { type: 'function' },
+ args: {
+ onSuccess: fn(),
},
};
@@ -101,15 +102,14 @@ export const UserEventSetup = {
const { args, canvasElement, step } = context;
const user = userEvent.setup();
const canvas = within(canvasElement);
- await step('Select, type and paste on input using user-event v14 setup', async () => {
- const input = await canvas.getByRole('textbox');
+ await step('Select and type on input using user-event v14 setup', async () => {
+ const input = canvas.getByRole('textbox');
await user.click(input);
- await user.type(input, 'Pasting: ');
- await user.paste('foobar');
+ await user.type(input, 'Typing ...');
});
await step('Tab and press enter on submit button', async () => {
await user.pointer([
- { keys: '[TouchA>]', target: await canvas.getByRole('textbox') },
+ { keys: '[TouchA>]', target: canvas.getByRole('textbox') },
{ keys: '[/TouchA]' },
]);
await user.tab();
diff --git a/code/addons/interactions/template/stories/unhandled-errors.stories.ts b/code/addons/interactions/template/stories/unhandled-errors.stories.ts
new file mode 100644
index 00000000000..fcaf0144ccd
--- /dev/null
+++ b/code/addons/interactions/template/stories/unhandled-errors.stories.ts
@@ -0,0 +1,23 @@
+import { global as globalThis } from '@storybook/global';
+import { userEvent, within } from '@storybook/test';
+
+export default {
+ component: globalThis.Components.Button,
+ args: {
+ label: 'Button',
+ },
+ argTypes: {
+ onClick: { type: 'function' },
+ },
+ parameters: {
+ actions: { argTypesRegex: '^on[A-Z].*' },
+ },
+};
+
+export const Default = {
+ play: async (context) => {
+ const { args, canvasElement } = context;
+ const canvas = within(canvasElement);
+ await userEvent.click(canvas.getByRole('button'));
+ },
+};
diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json
index 030b19ae4b2..264d5c218b5 100644
--- a/code/addons/jest/package.json
+++ b/code/addons/jest/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
diff --git a/code/addons/links/package.json b/code/addons/links/package.json
index 28d53b499f8..89d399d22d4 100644
--- a/code/addons/links/package.json
+++ b/code/addons/links/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",
diff --git a/code/addons/links/src/index.ts b/code/addons/links/src/index.ts
index 47751e59968..524558abc6c 100644
--- a/code/addons/links/src/index.ts
+++ b/code/addons/links/src/index.ts
@@ -1,20 +1 @@
-import { dedent } from 'ts-dedent';
-
-let hasWarned = false;
-
-/**
- * @deprecated please import this specific function from @storybook/addon-links/react
- */
-export function LinkTo(): null {
- if (!hasWarned) {
- // eslint-disable-next-line no-console
- console.error(dedent`
- LinkTo has moved to addon-links/react:
- import LinkTo from '@storybook/addon-links/react';
- `);
- hasWarned = true;
- }
- return null;
-}
-
export { linkTo, hrefTo, withLinks, navigate } from './utils';
diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json
index ed43ed640a7..fceabf0e9de 100644
--- a/code/addons/measure/package.json
+++ b/code/addons/measure/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",
diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json
index f0816abfe22..77f90fabe7a 100644
--- a/code/addons/outline/package.json
+++ b/code/addons/outline/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",
diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json
index a2c0a79d15f..905e79f7962 100644
--- a/code/addons/storysource/package.json
+++ b/code/addons/storysource/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "View a story’s source code to see how it works and paste into your app",
"keywords": [
"addon",
diff --git a/code/addons/storysource/preset.js b/code/addons/storysource/preset.js
index dd83b37f74c..b120250981f 100644
--- a/code/addons/storysource/preset.js
+++ b/code/addons/storysource/preset.js
@@ -1 +1 @@
-import './dist/preset';
+require('./dist/preset');
diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json
index d06cacc7c11..ba7d6ad06b3 100644
--- a/code/addons/themes/package.json
+++ b/code/addons/themes/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Switch between multiple themes for you components in Storybook",
"keywords": [
"css",
diff --git a/code/addons/themes/src/theme-switcher.tsx b/code/addons/themes/src/theme-switcher.tsx
index 4fc7ffa8925..7e366fe8359 100644
--- a/code/addons/themes/src/theme-switcher.tsx
+++ b/code/addons/themes/src/theme-switcher.tsx
@@ -57,7 +57,7 @@ export const ThemeSwitcher = () => {
{
return (
{
- return list
- .filter((i) => i.id !== responsiveViewport.id || active.id !== i.id)
- .map((i) => {
- return {
- ...i,
- onClick: () => {
- set({ ...state, selected: i.id });
- close();
- },
- };
- });
-});
+const toLinks = memoize(50)(
+ (list: ViewportItem[], active: LinkBase, updateGlobals, close): Link[] => {
+ return list
+ .filter((i) => i.id !== responsiveViewport.id || active.id !== i.id)
+ .map((i) => {
+ return {
+ ...i,
+ onClick: () => {
+ updateGlobals({ viewport: i.id });
+ close();
+ },
+ };
+ });
+ }
+);
interface LinkBase {
id: string;
@@ -95,11 +97,6 @@ const IconButtonLabel = styled.div(({ theme }) => ({
marginLeft: 10,
}));
-interface ViewportToolState {
- isRotated: boolean;
- selected: string | null;
-}
-
const getStyles = (
prevStyles: ViewportStyles | undefined,
styles: Styles,
@@ -115,22 +112,20 @@ const getStyles = (
export const ViewportTool: FC = memo(
withTheme(({ theme }: { theme: Theme }) => {
+ const [globals, updateGlobals] = useGlobals();
+
const {
viewports = MINIMAL_VIEWPORTS,
- defaultOrientation = 'portrait',
- defaultViewport = responsiveViewport.id,
+ defaultOrientation,
+ defaultViewport,
disable,
} = useParameter(PARAM_KEY, {});
- const [state, setState] = useAddonState(ADDON_ID, {
- selected: defaultViewport,
- isRotated: defaultOrientation === 'landscape',
- });
const list = toList(viewports);
const api = useStorybookApi();
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
- if (!list.find((i) => i.id === defaultViewport)) {
+ if (defaultViewport && !list.find((i) => i.id === defaultViewport)) {
// eslint-disable-next-line no-console
console.warn(
`Cannot find "defaultViewport" of "${defaultViewport}" in addon-viewport configs, please check the "viewports" setting in the configuration.`
@@ -138,28 +133,32 @@ export const ViewportTool: FC = memo(
}
useEffect(() => {
- registerShortcuts(api, setState, Object.keys(viewports));
- }, [viewports]);
+ registerShortcuts(api, globals, updateGlobals, Object.keys(viewports));
+ }, [viewports, globals.viewport]);
useEffect(() => {
- setState({
- selected:
- defaultViewport ||
- (state.selected && viewports[state.selected] ? state.selected : responsiveViewport.id),
- isRotated: defaultOrientation === 'landscape',
- });
- }, [defaultOrientation, defaultViewport]);
+ const defaultRotated = defaultOrientation === 'landscape';
+
+ if (
+ (defaultViewport && globals.viewport !== defaultViewport) ||
+ (defaultOrientation && globals.viewportRotated !== defaultRotated)
+ ) {
+ updateGlobals({
+ viewport: defaultViewport,
+ viewportRotated: defaultRotated,
+ });
+ }
+ }, [defaultOrientation, defaultViewport, globals, updateGlobals]);
- const { selected, isRotated } = state;
const item =
- list.find((i) => i.id === selected) ||
+ list.find((i) => i.id === globals.viewport) ||
list.find((i) => i.id === defaultViewport) ||
list.find((i) => i.default) ||
responsiveViewport;
const ref = useRef();
- const styles = getStyles(ref.current, item.styles, isRotated);
+ const styles = getStyles(ref.current, item.styles, globals.viewportRotated);
useEffect(() => {
ref.current = styles;
@@ -174,7 +173,7 @@ export const ViewportTool: FC = memo(
(
-
+
)}
closeOnOutsideClick
onVisibleChange={setIsTooltipVisible}
@@ -184,13 +183,13 @@ export const ViewportTool: FC = memo(
title="Change the size of the preview"
active={isTooltipVisible || !!styles}
onDoubleClick={() => {
- setState({ ...state, selected: responsiveViewport.id });
+ updateGlobals({ viewport: responsiveViewport.id });
}}
>
{styles ? (
- {isRotated ? `${item.title} (L)` : `${item.title} (P)`}
+ {globals.viewportRotated ? `${item.title} (L)` : `${item.title} (P)`}
) : null}
@@ -215,7 +214,7 @@ export const ViewportTool: FC = memo(
key="viewport-rotate"
title="Rotate viewport"
onClick={() => {
- setState({ ...state, isRotated: !isRotated });
+ updateGlobals({ viewportRotated: !globals.viewportRotated });
}}
>
diff --git a/code/addons/viewport/src/preview.ts b/code/addons/viewport/src/preview.ts
new file mode 100644
index 00000000000..afe0f1b5f0b
--- /dev/null
+++ b/code/addons/viewport/src/preview.ts
@@ -0,0 +1 @@
+export const globals = { viewport: 'reset', viewportRotated: false };
diff --git a/code/addons/viewport/src/shortcuts.ts b/code/addons/viewport/src/shortcuts.ts
index 39cff92af12..47fd37cbb99 100644
--- a/code/addons/viewport/src/shortcuts.ts
+++ b/code/addons/viewport/src/shortcuts.ts
@@ -1,10 +1,6 @@
import type { API } from '@storybook/manager-api';
import { ADDON_ID } from './constants';
-
-type State = {
- selected: string;
- isRotated: boolean;
-};
+import { globals as defaultGlobals } from './preview';
const getCurrentViewportIndex = (viewportsKeys: string[], current: string): number =>
viewportsKeys.indexOf(current);
@@ -23,16 +19,19 @@ const getPreviousViewport = (viewportsKeys: string[], current: string): string =
: viewportsKeys[currentViewportIndex - 1];
};
-export const registerShortcuts = async (api: API, setState: any, viewportsKeys: string[]) => {
+export const registerShortcuts = async (
+ api: API,
+ globals: any,
+ updateGlobals: any,
+ viewportsKeys: string[]
+) => {
await api.setAddonShortcut(ADDON_ID, {
label: 'Previous viewport',
defaultShortcut: ['shift', 'V'],
actionName: 'previous',
action: () => {
- const { selected, isRotated } = api.getAddonState(ADDON_ID);
- setState({
- selected: getPreviousViewport(viewportsKeys, selected),
- isRotated,
+ updateGlobals({
+ viewport: getPreviousViewport(viewportsKeys, globals.viewport),
});
},
});
@@ -42,10 +41,8 @@ export const registerShortcuts = async (api: API, setState: any, viewportsKeys:
defaultShortcut: ['V'],
actionName: 'next',
action: () => {
- const { selected, isRotated } = api.getAddonState(ADDON_ID);
- setState({
- selected: getNextViewport(viewportsKeys, selected),
- isRotated,
+ updateGlobals({
+ viewport: getNextViewport(viewportsKeys, globals.viewport),
});
},
});
@@ -55,11 +52,7 @@ export const registerShortcuts = async (api: API, setState: any, viewportsKeys:
defaultShortcut: ['alt', 'V'],
actionName: 'reset',
action: () => {
- const { isRotated } = api.getAddonState(ADDON_ID);
- setState({
- selected: 'reset',
- isRotated,
- });
+ updateGlobals(defaultGlobals);
},
});
};
diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json
index 389dedc5073..3dc07399dec 100644
--- a/code/builders/builder-manager/package.json
+++ b/code/builders/builder-manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-manager",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook manager builder",
"keywords": [
"storybook"
@@ -49,14 +49,12 @@
"@storybook/manager": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@types/ejs": "^3.1.1",
- "@types/find-cache-dir": "^3.2.1",
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
"browser-assert": "^1.2.1",
"ejs": "^3.1.8",
"esbuild": "^0.18.0",
"esbuild-plugin-alias": "^0.2.1",
"express": "^4.17.3",
- "find-cache-dir": "^3.0.0",
"fs-extra": "^11.1.0",
"process": "^0.11.10",
"util": "^0.12.4"
diff --git a/code/builders/builder-manager/src/index.ts b/code/builders/builder-manager/src/index.ts
index 89b9846184e..b7923a64a2b 100644
--- a/code/builders/builder-manager/src/index.ts
+++ b/code/builders/builder-manager/src/index.ts
@@ -40,10 +40,8 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => {
? [...addonsEntryPoints, customManagerEntryPoint]
: addonsEntryPoints;
- const realEntryPoints = await wrapManagerEntries(entryPoints);
-
return {
- entryPoints: realEntryPoints,
+ entryPoints: await wrapManagerEntries(entryPoints, options.cacheKey),
outdir: join(options.outputDir || './', 'sb-addons'),
format: 'iife',
write: false,
diff --git a/code/builders/builder-manager/src/utils/managerEntries.ts b/code/builders/builder-manager/src/utils/managerEntries.ts
index 51413bfb852..c30357851dd 100644
--- a/code/builders/builder-manager/src/utils/managerEntries.ts
+++ b/code/builders/builder-manager/src/utils/managerEntries.ts
@@ -1,5 +1,5 @@
-import findCacheDirectory from 'find-cache-dir';
import fs from 'fs-extra';
+import { resolvePathInStorybookCache } from '@storybook/core-common';
import { join, parse, relative, sep } from 'node:path';
import slash from 'slash';
@@ -34,11 +34,11 @@ const sanitizeFinal = (path: string) => {
*
* We need to wrap each managerEntry with a try-catch because if we do not, a failing managerEntry can stop execution of other managerEntries.
*/
-export async function wrapManagerEntries(entrypoints: string[]) {
+export async function wrapManagerEntries(entrypoints: string[], uniqueId?: string) {
return Promise.all(
entrypoints.map(async (entry, i) => {
const { name, dir } = parse(entry);
- const cacheLocation = findCacheDirectory({ name: 'sb-manager' });
+ const cacheLocation = resolvePathInStorybookCache('sb-manager', uniqueId);
if (!cacheLocation) {
throw new Error('Could not create/find cache directory');
diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json
index c8ecb6885ea..c4b0712b60c 100644
--- a/code/builders/builder-vite/package.json
+++ b/code/builders/builder-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "A plugin to run and build Storybooks with Vite",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
"bugs": {
@@ -57,14 +57,12 @@
"express": "^4.17.3",
"find-cache-dir": "^3.0.0",
"fs-extra": "^11.1.0",
- "magic-string": "^0.30.0",
- "rollup": "^2.25.0 || ^3.3.0"
+ "magic-string": "^0.30.0"
},
"devDependencies": {
"@types/express": "^4.17.13",
"@types/node": "^18.0.0",
"glob": "^10.0.0",
- "rollup": "^3.20.1",
"slash": "^5.0.0",
"typescript": "^5.3.2",
"vite": "^4.0.4"
@@ -72,7 +70,7 @@
"peerDependencies": {
"@preact/preset-vite": "*",
"typescript": ">= 4.3.x",
- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0",
+ "vite": "^4.0.0 || ^5.0.0",
"vite-plugin-glimmerx": "*"
},
"peerDependenciesMeta": {
diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts
index 80b1ac87537..9cdac7233d6 100644
--- a/code/builders/builder-vite/src/index.ts
+++ b/code/builders/builder-vite/src/index.ts
@@ -5,26 +5,17 @@ import type { RequestHandler } from 'express';
import type { ViteDevServer } from 'vite';
import express from 'express';
import { dirname, join, parse } from 'path';
-import type { Options, StorybookConfig as StorybookBaseConfig } from '@storybook/types';
+import type { Options } from '@storybook/types';
import { transformIframeHtml } from './transform-iframe-html';
import { createViteServer } from './vite-server';
import { build as viteBuild } from './build';
-import type { ViteBuilder, StorybookConfigVite } from './types';
+import type { ViteBuilder } from './types';
export { withoutVitePlugins } from './utils/without-vite-plugins';
export { hasVitePlugins } from './utils/has-vite-plugins';
export * from './types';
-/**
- * @deprecated
- *
- * Import `StorybookConfig` from your framework, such as:
- *
- * `import type { StorybookConfig } from '@storybook/react-vite';`
- */
-export type StorybookViteConfig = StorybookBaseConfig & StorybookConfigVite;
-
const getAbsolutePath = (input: I): I =>
dirname(require.resolve(join(input, 'package.json'))) as any;
diff --git a/code/builders/builder-vite/src/vite-config.test.ts b/code/builders/builder-vite/src/vite-config.test.ts
index 9437bdaee67..0dfd0534ee3 100644
--- a/code/builders/builder-vite/src/vite-config.test.ts
+++ b/code/builders/builder-vite/src/vite-config.test.ts
@@ -1,5 +1,6 @@
import { describe, it, expect, vi } from 'vitest';
import type { Options, Presets } from '@storybook/types';
+// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { loadConfigFromFile } from 'vite';
import { commonConfig } from './vite-config';
diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts
index b4d1744d383..f4f258902b2 100644
--- a/code/builders/builder-vite/src/vite-config.ts
+++ b/code/builders/builder-vite/src/vite-config.ts
@@ -1,5 +1,4 @@
import * as path from 'path';
-import findCacheDirectory from 'find-cache-dir';
import type {
ConfigEnv,
InlineConfig as ViteInlineConfig,
@@ -7,7 +6,12 @@ import type {
UserConfig as ViteConfig,
InlineConfig,
} from 'vite';
-import { isPreservingSymlinks, getFrameworkName, getBuilderOptions } from '@storybook/core-common';
+import {
+ isPreservingSymlinks,
+ getFrameworkName,
+ getBuilderOptions,
+ resolvePathInStorybookCache,
+} from '@storybook/core-common';
import { globalsNameReferenceMap } from '@storybook/preview/globals';
import type { Options } from '@storybook/types';
import {
@@ -54,7 +58,7 @@ export async function commonConfig(
const sbConfig: InlineConfig = {
configFile: false,
- cacheDir: findCacheDirectory({ name: 'sb-vite' }),
+ cacheDir: resolvePathInStorybookCache('sb-vite', options.cacheKey),
root: projectRoot,
// Allow storybook deployed as subfolder. See https://github.com/storybookjs/builder-vite/issues/238
base: './',
diff --git a/code/builders/builder-vite/src/vite-server.ts b/code/builders/builder-vite/src/vite-server.ts
index ce4631cabae..0b1e8043502 100644
--- a/code/builders/builder-vite/src/vite-server.ts
+++ b/code/builders/builder-vite/src/vite-server.ts
@@ -11,6 +11,8 @@ export async function createViteServer(options: Options, devServer: Server) {
const config = {
...commonCfg,
+ // Needed in Vite 5: https://github.com/storybookjs/storybook/issues/25256
+ assetsInclude: ['/sb-preview/**'],
// Set up dev server
server: {
middlewareMode: true,
diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json
index cb2b8fe3d02..5796195c88b 100644
--- a/code/builders/builder-webpack5/package.json
+++ b/code/builders/builder-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
diff --git a/code/e2e-tests/addon-interactions.spec.ts b/code/e2e-tests/addon-interactions.spec.ts
index d77ef67beec..5169f3fe733 100644
--- a/code/e2e-tests/addon-interactions.spec.ts
+++ b/code/e2e-tests/addon-interactions.spec.ts
@@ -1,4 +1,4 @@
-/* eslint-disable jest/no-disabled-tests */
+/* eslint-disable jest/no-disabled-tests,jest/valid-title */
import { test, expect } from '@playwright/test';
import process from 'process';
import { SbPage } from './util';
@@ -15,7 +15,6 @@ test.describe('addon-interactions', () => {
test('should have interactions', async ({ page }) => {
// templateName is e.g. 'vue-cli/default-js'
test.skip(
- // eslint-disable-next-line jest/valid-title
/^(lit)/i.test(`${templateName}`),
`Skipping ${templateName}, which does not support addon-interactions`
);
@@ -44,7 +43,6 @@ test.describe('addon-interactions', () => {
test('should step through interactions', async ({ page }) => {
// templateName is e.g. 'vue-cli/default-js'
test.skip(
- // eslint-disable-next-line jest/valid-title
/^(lit)/i.test(`${templateName}`),
`Skipping ${templateName}, which does not support addon-interactions`
);
@@ -116,4 +114,23 @@ test.describe('addon-interactions', () => {
await expect(interactionsTab).toBeVisible();
await expect(formInput).toHaveValue('final value');
});
+
+ test('should show unhandled errors', async ({ page }) => {
+ test.skip(
+ /^(lit)/i.test(`${templateName}`),
+ `Skipping ${templateName}, which does not support addon-interactions`
+ );
+ // We trigger the implicit action error here, but angular works a bit different with implicit actions.
+ test.skip(/^(angular)/i.test(`${templateName}`));
+
+ const sbPage = new SbPage(page);
+
+ await sbPage.deepLinkToStory(storybookUrl, 'addons/interactions/unhandled-errors', 'default');
+ await sbPage.viewAddonPanel('Interactions');
+
+ const panel = sbPage.panelContent();
+ await expect(panel).toContainText(/Fail/);
+ await expect(panel).toContainText(/Found 1 unhandled error/);
+ await expect(panel).toBeVisible();
+ });
});
diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json
index 1f532e8e7d2..52924cc3fb4 100644
--- a/code/frameworks/angular/package.json
+++ b/code/frameworks/angular/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
"keywords": [
"storybook",
diff --git a/code/frameworks/angular/src/client/public-types.ts b/code/frameworks/angular/src/client/public-types.ts
index 7d81b1dfbd6..e96e3d89c15 100644
--- a/code/frameworks/angular/src/client/public-types.ts
+++ b/code/frameworks/angular/src/client/public-types.ts
@@ -9,6 +9,7 @@ import {
StrictArgs,
ProjectAnnotations,
} from '@storybook/types';
+import { EventEmitter } from '@angular/core';
import { AngularRenderer } from './types';
export type { Args, ArgTypes, Parameters, StrictArgs } from '@storybook/types';
@@ -20,21 +21,21 @@ export type { AngularRenderer };
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
-export type Meta = ComponentAnnotations;
+export type Meta = ComponentAnnotations>;
/**
* Story function that represents a CSFv2 component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
-export type StoryFn = AnnotatedStoryFn;
+export type StoryFn = AnnotatedStoryFn>;
/**
* Story function that represents a CSFv3 component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
-export type StoryObj = StoryAnnotations;
+export type StoryObj = StoryAnnotations>;
/**
* @deprecated Use `StoryFn` instead.
@@ -51,3 +52,7 @@ export type Decorator = DecoratorFunction = LoaderFunction;
export type StoryContext = GenericStoryContext;
export type Preview = ProjectAnnotations;
+
+type TransformEventType = {
+ [K in keyof T]: T[K] extends EventEmitter ? (e: E) => void : T[K];
+};
diff --git a/code/frameworks/angular/src/client/types.ts b/code/frameworks/angular/src/client/types.ts
index ef3c4428c21..100b3e91231 100644
--- a/code/frameworks/angular/src/client/types.ts
+++ b/code/frameworks/angular/src/client/types.ts
@@ -37,10 +37,6 @@ export interface StoryFnAngularReturnType {
userDefinedTemplate?: boolean;
}
-/**
- * @deprecated Use `AngularRenderer` instead.
- */
-export type AngularFramework = AngularRenderer;
export interface AngularRenderer extends WebRenderer {
component: any;
storyResult: StoryFnAngularReturnType;
diff --git a/code/frameworks/angular/template/cli/button.stories.ts b/code/frameworks/angular/template/cli/button.stories.ts
index 19661b149fd..886310bed9a 100644
--- a/code/frameworks/angular/template/cli/button.stories.ts
+++ b/code/frameworks/angular/template/cli/button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/angular';
-
+import { fn } from '@storybook/test';
import { ButtonComponent } from './button.component';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -7,17 +7,13 @@ const meta: Meta = {
title: 'Example/Button',
component: ButtonComponent,
tags: ['autodocs'],
- render: (args: ButtonComponent) => ({
- props: {
- backgroundColor: null,
- ...args,
- },
- }),
argTypes: {
backgroundColor: {
control: 'color',
},
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
export default meta;
diff --git a/code/frameworks/angular/template/stories/angular-mdx.stories.mdx b/code/frameworks/angular/template/stories/angular-mdx.stories.mdx
deleted file mode 100644
index afe20c14379..00000000000
--- a/code/frameworks/angular/template/stories/angular-mdx.stories.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { global as globalThis } from '@storybook/global';
-import { moduleMetadata } from '@storybook/angular';
-import { Meta, Story, Canvas } from '@storybook/addon-docs';
-
-export const Button = globalThis.Components.Button;
-
-
-
-# Angular-specific MDX Stories
-
-
diff --git a/code/frameworks/angular/template/stories/basics/README.stories.mdx b/code/frameworks/angular/template/stories/basics/README.mdx
similarity index 100%
rename from code/frameworks/angular/template/stories/basics/README.stories.mdx
rename to code/frameworks/angular/template/stories/basics/README.mdx
diff --git a/code/frameworks/angular/template/stories/core/README.stories.mdx b/code/frameworks/angular/template/stories/core/README.mdx
similarity index 100%
rename from code/frameworks/angular/template/stories/core/README.stories.mdx
rename to code/frameworks/angular/template/stories/core/README.mdx
diff --git a/code/frameworks/angular/template/stories/others/ngx-translate/README.stories.mdx b/code/frameworks/angular/template/stories/others/ngx-translate/README.mdx
similarity index 100%
rename from code/frameworks/angular/template/stories/others/ngx-translate/README.stories.mdx
rename to code/frameworks/angular/template/stories/others/ngx-translate/README.mdx
diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json
index bfb7e1d3ff3..af49a0b41b5 100644
--- a/code/frameworks/ember/package.json
+++ b/code/frameworks/ember/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember",
"bugs": {
diff --git a/code/frameworks/ember/src/client/preview/types.ts b/code/frameworks/ember/src/client/preview/types.ts
index 5df0b2632aa..147f4928f24 100644
--- a/code/frameworks/ember/src/client/preview/types.ts
+++ b/code/frameworks/ember/src/client/preview/types.ts
@@ -13,10 +13,6 @@ export interface OptionsArgs {
element: any;
}
-/**
- * @deprecated Use `EmberRenderer` instead.
- */
-export type EmberFramework = EmberRenderer;
export interface EmberRenderer extends WebRenderer {
component: any;
storyResult: OptionsArgs;
diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json
index f29f1567786..3b0eec15fc1 100644
--- a/code/frameworks/html-vite/package.json
+++ b/code/frameworks/html-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/html-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json
index da35b84d27f..dc9fad92e94 100644
--- a/code/frameworks/html-webpack5/package.json
+++ b/code/frameworks/html-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/html-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json
index 8eb6878e1a8..80be950d751 100644
--- a/code/frameworks/nextjs/package.json
+++ b/code/frameworks/nextjs/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/nextjs",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Next.js",
"keywords": [
"storybook",
@@ -98,6 +98,7 @@
"@storybook/preview-api": "workspace:*",
"@storybook/react": "workspace:*",
"@types/node": "^18.0.0",
+ "@types/semver": "^7.3.4",
"css-loader": "^6.7.3",
"find-up": "^5.0.0",
"fs-extra": "^11.1.0",
diff --git a/code/frameworks/nextjs/template/cli/js/Button.stories.js b/code/frameworks/nextjs/template/cli/js/Button.stories.js
index 3a3f67ec8fb..97b9ec0ed85 100644
--- a/code/frameworks/nextjs/template/cli/js/Button.stories.js
+++ b/code/frameworks/nextjs/template/cli/js/Button.stories.js
@@ -1,3 +1,4 @@
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
@@ -14,6 +15,8 @@ export default {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts b/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts
index b65080126a4..2054fc59231 100644
--- a/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts
+++ b/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
-
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
@@ -16,6 +16,8 @@ const meta: Meta = {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
export default meta;
diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Header.tsx b/code/frameworks/nextjs/template/cli/ts-3-8/Header.tsx
index 01504601311..c806ddf023e 100644
--- a/code/frameworks/nextjs/template/cli/ts-3-8/Header.tsx
+++ b/code/frameworks/nextjs/template/cli/ts-3-8/Header.tsx
@@ -9,9 +9,9 @@ type User = {
interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts
index 742c3aa7b02..455a9d8601c 100644
--- a/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts
+++ b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
-
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
@@ -16,6 +16,8 @@ const meta = {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
} satisfies Meta;
export default meta;
diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx b/code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx
index 01504601311..c806ddf023e 100644
--- a/code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx
+++ b/code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx
@@ -9,9 +9,9 @@ type User = {
interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json
index bccba808391..296ce62a0f3 100644
--- a/code/frameworks/preact-vite/package.json
+++ b/code/frameworks/preact-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -47,7 +47,6 @@
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
- "@preact/preset-vite": "^2.0.0",
"@storybook/builder-vite": "workspace:*",
"@storybook/preact": "workspace:*"
},
@@ -58,7 +57,7 @@
},
"peerDependencies": {
"preact": ">=10",
- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
+ "vite": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": ">=16"
diff --git a/code/frameworks/preact-vite/src/preset.ts b/code/frameworks/preact-vite/src/preset.ts
index 2d4e18d77e9..4002182ea92 100644
--- a/code/frameworks/preact-vite/src/preset.ts
+++ b/code/frameworks/preact-vite/src/preset.ts
@@ -1,6 +1,4 @@
-import { hasVitePlugins } from '@storybook/builder-vite';
import type { PresetProperty } from '@storybook/types';
-import preact from '@preact/preset-vite';
import { dirname, join } from 'path';
import type { StorybookConfig } from './types';
@@ -13,14 +11,6 @@ export const core: PresetProperty<'core', StorybookConfig> = {
};
export const viteFinal: StorybookConfig['viteFinal'] = async (config) => {
- const { plugins = [] } = config;
-
- // Add Preact plugin if not present
- if (!(await hasVitePlugins(plugins, ['vite:preact-jsx']))) {
- plugins.push(preact());
- }
-
// TODO: Add docgen plugin per issue https://github.com/storybookjs/storybook/issues/19739
-
return config;
};
diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json
index 5ed8ab87fd2..285a187a920 100644
--- a/code/frameworks/preact-webpack5/package.json
+++ b/code/frameworks/preact-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json
index ec13392db39..3b6d1e3b338 100644
--- a/code/frameworks/react-vite/package.json
+++ b/code/frameworks/react-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -51,7 +51,6 @@
"@rollup/pluginutils": "^5.0.2",
"@storybook/builder-vite": "workspace:*",
"@storybook/react": "workspace:*",
- "@vitejs/plugin-react": "^3.0.1",
"magic-string": "^0.30.0",
"react-docgen": "^7.0.0"
},
@@ -63,7 +62,7 @@
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
+ "vite": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": ">=16"
diff --git a/code/frameworks/react-vite/src/preset.ts b/code/frameworks/react-vite/src/preset.ts
index 207f60988eb..0defee00396 100644
--- a/code/frameworks/react-vite/src/preset.ts
+++ b/code/frameworks/react-vite/src/preset.ts
@@ -1,6 +1,5 @@
/* eslint-disable global-require */
import type { PresetProperty } from '@storybook/types';
-import { hasVitePlugins } from '@storybook/builder-vite';
import { dirname, join } from 'path';
import type { StorybookConfig } from './types';
@@ -15,12 +14,6 @@ export const core: PresetProperty<'core', StorybookConfig> = {
export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets }) => {
const { plugins = [] } = config;
- // Add react plugin if not present
- if (!(await hasVitePlugins(plugins, ['vite:react-babel', 'vite:react-swc']))) {
- const { default: react } = await import('@vitejs/plugin-react');
- plugins.push(react());
- }
-
// Add docgen plugin
const { reactDocgen: reactDocgenOption, reactDocgenTypescriptOptions } = await presets.apply(
'typescript',
diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json
index 44da3c64216..b849bafa047 100644
--- a/code/frameworks/react-webpack5/package.json
+++ b/code/frameworks/react-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json
index 06bdc2b2bbe..5b5ab6b6fe3 100644
--- a/code/frameworks/server-webpack5/package.json
+++ b/code/frameworks/server-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/server-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json
index 9dedf2eaf71..eece06f117b 100644
--- a/code/frameworks/svelte-vite/package.json
+++ b/code/frameworks/svelte-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -50,21 +50,22 @@
"@storybook/builder-vite": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/svelte": "workspace:*",
- "@sveltejs/vite-plugin-svelte": "^2.4.2",
"magic-string": "^0.30.0",
"svelte-preprocess": "^5.1.1",
"sveltedoc-parser": "^4.2.1",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
+ "@sveltejs/vite-plugin-svelte": "^3.0.1",
"@types/node": "^18.0.0",
- "svelte": "^5.0.0-next.16",
+ "svelte": "^5.0.0-next.28",
"typescript": "^5.3.2",
"vite": "^4.0.0"
},
"peerDependencies": {
+ "@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0",
"svelte": "^4.0.0 || ^5.0.0-next.16",
- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
+ "vite": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": "^14.18 || >=16"
diff --git a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts
index 5ee6f7e53ce..1e33174e11a 100644
--- a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts
+++ b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts
@@ -6,7 +6,6 @@ import svelteDoc from 'sveltedoc-parser';
import type { SvelteComponentDoc, SvelteParserOptions } from 'sveltedoc-parser';
import { logger } from '@storybook/node-logger';
import { preprocess } from 'svelte/compiler';
-import { createFilter } from 'vite';
import { replace, typescript } from 'svelte-preprocess';
/*
@@ -59,10 +58,12 @@ function getNameFromFilename(filename: string) {
return base[0].toUpperCase() + base.slice(1);
}
-export function svelteDocgen(svelteOptions: Record = {}): PluginOption {
+export async function svelteDocgen(svelteOptions: Record = {}): Promise {
const cwd = process.cwd();
const { preprocess: preprocessOptions, logDocgen = false } = svelteOptions;
const include = /\.(svelte)$/;
+ const { createFilter } = await import('vite');
+
const filter = createFilter(include);
let docPreprocessOptions: Parameters[1] | undefined;
diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts
index 220812cf7c5..9ef71bb26e8 100644
--- a/code/frameworks/svelte-vite/src/preset.ts
+++ b/code/frameworks/svelte-vite/src/preset.ts
@@ -1,4 +1,3 @@
-import { hasVitePlugins } from '@storybook/builder-vite';
import type { PresetProperty } from '@storybook/types';
import { dirname, join } from 'path';
import type { StorybookConfig } from './types';
@@ -17,16 +16,11 @@ export const viteFinal: NonNullable = async (confi
const { plugins = [] } = config;
// TODO: set up eslint import to use typescript resolver
// eslint-disable-next-line import/no-unresolved
- const { svelte, loadSvelteConfig } = await import('@sveltejs/vite-plugin-svelte');
+ const { loadSvelteConfig } = await import('@sveltejs/vite-plugin-svelte');
const svelteConfig = await loadSvelteConfig();
- // Add svelte plugin if the user does not have a Vite config of their own
- if (!(await hasVitePlugins(plugins, ['vite-plugin-svelte']))) {
- plugins.push(svelte());
- }
-
// Add docgen plugin
- plugins.push(svelteDocgen(svelteConfig));
+ plugins.push(await svelteDocgen(svelteConfig));
await handleSvelteKit(plugins, options);
diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json
index bd7c166692e..40ea6428710 100644
--- a/code/frameworks/svelte-webpack5/package.json
+++ b/code/frameworks/svelte-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json
index f52a2a20e56..b97ffa27aad 100644
--- a/code/frameworks/sveltekit/package.json
+++ b/code/frameworks/sveltekit/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/sveltekit",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for SvelteKit",
"keywords": [
"storybook",
diff --git a/code/frameworks/sveltekit/src/plugins/config-overrides.ts b/code/frameworks/sveltekit/src/plugins/config-overrides.ts
index d132764d6e5..db5294a1324 100644
--- a/code/frameworks/sveltekit/src/plugins/config-overrides.ts
+++ b/code/frameworks/sveltekit/src/plugins/config-overrides.ts
@@ -1,4 +1,4 @@
-import { type Plugin } from 'vite';
+import type { Plugin } from 'vite';
export function configOverrides() {
return {
diff --git a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts
index f338760c390..32f6eb0c41b 100644
--- a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts
+++ b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts
@@ -1,7 +1,7 @@
import { resolve } from 'node:path';
import type { Plugin } from 'vite';
-export function mockSveltekitStores() {
+export async function mockSveltekitStores() {
return {
name: 'storybook:sveltekit-mock-stores',
config: () => ({
diff --git a/code/frameworks/sveltekit/src/preset.ts b/code/frameworks/sveltekit/src/preset.ts
index 7af34f9e420..53d616c1891 100644
--- a/code/frameworks/sveltekit/src/preset.ts
+++ b/code/frameworks/sveltekit/src/preset.ts
@@ -32,7 +32,7 @@ export const viteFinal: NonNullable = async (confi
])
)
.concat(configOverrides())
- .concat(mockSveltekitStores());
+ .concat(await mockSveltekitStores());
return { ...baseConfig, plugins };
};
diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json
index 37d49111999..e055410a8bb 100644
--- a/code/frameworks/vue3-vite/package.json
+++ b/code/frameworks/vue3-vite/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-vite",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -50,7 +50,6 @@
"@storybook/builder-vite": "workspace:*",
"@storybook/core-server": "workspace:*",
"@storybook/vue3": "workspace:*",
- "@vitejs/plugin-vue": "^4.0.0",
"magic-string": "^0.30.0",
"vue-docgen-api": "^4.40.0"
},
@@ -60,7 +59,7 @@
"vite": "^4.0.0"
},
"peerDependencies": {
- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
+ "vite": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": "^14.18 || >=16"
diff --git a/code/frameworks/vue3-vite/src/plugins/vue-docgen.ts b/code/frameworks/vue3-vite/src/plugins/vue-docgen.ts
index 6bed6a1fed9..f8008fc3a4b 100644
--- a/code/frameworks/vue3-vite/src/plugins/vue-docgen.ts
+++ b/code/frameworks/vue3-vite/src/plugins/vue-docgen.ts
@@ -1,10 +1,10 @@
import { parse } from 'vue-docgen-api';
import type { PluginOption } from 'vite';
-import { createFilter } from 'vite';
import MagicString from 'magic-string';
-export function vueDocgen(): PluginOption {
+export async function vueDocgen(): Promise {
const include = /\.(vue)$/;
+ const { createFilter } = await import('vite');
const filter = createFilter(include);
return {
diff --git a/code/frameworks/vue3-vite/src/preset.ts b/code/frameworks/vue3-vite/src/preset.ts
index c0d97bd8da8..58ceb6afb84 100644
--- a/code/frameworks/vue3-vite/src/preset.ts
+++ b/code/frameworks/vue3-vite/src/preset.ts
@@ -1,6 +1,5 @@
-import { hasVitePlugins } from '@storybook/builder-vite';
import type { PresetProperty } from '@storybook/types';
-import { mergeConfig, type PluginOption } from 'vite';
+import type { PluginOption } from 'vite';
import { dirname, join } from 'path';
import type { StorybookConfig } from './types';
import { vueDocgen } from './plugins/vue-docgen';
@@ -16,15 +15,10 @@ export const core: PresetProperty<'core'> = {
export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets }) => {
const plugins: PluginOption[] = [];
- // Add vue plugin if not present
- if (!(config.plugins && (await hasVitePlugins(config.plugins, ['vite:vue'])))) {
- const { default: vue } = await import('@vitejs/plugin-vue');
- plugins.push(vue());
- }
-
// Add docgen plugin
- plugins.push(vueDocgen());
+ plugins.push(await vueDocgen());
+ const { mergeConfig } = await import('vite');
return mergeConfig(config, {
plugins,
resolve: {
diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json
index 184583a7cf1..f133bd90aab 100644
--- a/code/frameworks/vue3-webpack5/package.json
+++ b/code/frameworks/vue3-webpack5/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-webpack5",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json
index f72f4754705..97451f9f0dd 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json
index d41a40ea985..391c4279903 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit",
diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json
index 5faa33d3f95..9b3659e76b9 100644
--- a/code/lib/channels/package.json
+++ b/code/lib/channels/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json
index f336503e3e2..2bedf547a13 100644
--- a/code/lib/cli-sb/package.json
+++ b/code/lib/cli-sb/package.json
@@ -1,6 +1,6 @@
{
"name": "sb",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook CLI",
"keywords": [
"storybook"
diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json
index 4aa75cf6a4a..d1cc935b29a 100644
--- a/code/lib/cli-storybook/package.json
+++ b/code/lib/cli-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "storybook",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook CLI",
"keywords": [
"storybook"
diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json
index a1869def7aa..671a4f309bd 100644
--- a/code/lib/cli/package.json
+++ b/code/lib/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/cli",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook's CLI - install, dev, build, upgrade, and more",
"keywords": [
"cli",
@@ -101,7 +101,6 @@
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/prompts": "^2.0.9",
- "@types/semver": "^7.3.4",
"@types/util-deprecate": "^1.0.0",
"boxen": "^5.1.2",
"slash": "^5.0.0",
diff --git a/code/lib/cli/src/add.ts b/code/lib/cli/src/add.ts
index 20e1c42bc81..3c730d68da5 100644
--- a/code/lib/cli/src/add.ts
+++ b/code/lib/cli/src/add.ts
@@ -4,11 +4,7 @@ import { isAbsolute, join } from 'path';
import SemVer from 'semver';
import dedent from 'ts-dedent';
-import {
- JsPackageManagerFactory,
- useNpmWarning,
- type PackageManagerName,
-} from './js-package-manager';
+import { JsPackageManagerFactory, type PackageManagerName } from './js-package-manager';
import { getStorybookVersion, isCorePackage } from './utils';
const logger = console;
@@ -71,13 +67,10 @@ const checkInstalled = (addonName: string, main: any) => {
*/
export async function add(
addon: string,
- options: { useNpm: boolean; packageManager: PackageManagerName; skipPostinstall: boolean }
+ options: { packageManager: PackageManagerName; skipPostinstall: boolean }
) {
- let { packageManager: pkgMgr } = options;
- if (options.useNpm) {
- useNpmWarning();
- pkgMgr = 'npm';
- }
+ const { packageManager: pkgMgr } = options;
+
const packageManager = JsPackageManagerFactory.getPackageManager({ force: pkgMgr });
const packageJson = await packageManager.retrievePackageJson();
const { mainConfig, configDir } = getStorybookInfo(packageJson);
diff --git a/code/lib/cli/src/automigrate/fixes/index.ts b/code/lib/cli/src/automigrate/fixes/index.ts
index bd33074805d..0c6202f2426 100644
--- a/code/lib/cli/src/automigrate/fixes/index.ts
+++ b/code/lib/cli/src/automigrate/fixes/index.ts
@@ -19,6 +19,7 @@ import { incompatibleAddons } from './incompatible-addons';
import { angularBuildersMultiproject } from './angular-builders-multiproject';
import { wrapRequire } from './wrap-require';
import { reactDocgen } from './react-docgen';
+import { storyshotsMigration } from './storyshots-migration';
export * from '../types';
@@ -42,6 +43,7 @@ export const allFixes: Fix[] = [
angularBuilders,
wrapRequire,
reactDocgen,
+ storyshotsMigration,
];
export const initFixes: Fix[] = [missingBabelRc, eslintPlugin];
diff --git a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts
index 7c3fd013023..f844decf144 100644
--- a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts
+++ b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts
@@ -82,7 +82,7 @@ export const mdxgfm: Fix = {
return dedent`
In MDX1 you had the option of using GitHub flavored markdown.
- Storybook 7.0 uses MDX2 for compiling MDX, and thus no longer supports GFM out of the box.
+ Storybook 8.0 uses MDX3 for compiling MDX, and thus no longer supports GFM out of the box.
Because of this you need to explicitly add the GFM plugin in the addon-docs options:
https://storybook.js.org/docs/react/writing-docs/mdx#lack-of-github-flavored-markdown-gfm
diff --git a/code/lib/cli/src/automigrate/fixes/storyshots-migration.test.ts b/code/lib/cli/src/automigrate/fixes/storyshots-migration.test.ts
new file mode 100644
index 00000000000..4a7ccc9d335
--- /dev/null
+++ b/code/lib/cli/src/automigrate/fixes/storyshots-migration.test.ts
@@ -0,0 +1,60 @@
+import { describe, afterEach, it, expect, vi } from 'vitest';
+
+import type { StorybookConfig } from '@storybook/types';
+import { storyshotsMigration } from './storyshots-migration';
+import type { JsPackageManager } from '../../js-package-manager';
+
+const check = async ({
+ packageManager,
+ main: mainConfig = {},
+ storybookVersion = '8.0.0',
+}: {
+ packageManager: Partial;
+ main?: Partial & Record;
+ storybookVersion?: string;
+}) => {
+ return storyshotsMigration.check({
+ packageManager: packageManager as any,
+ configDir: '',
+ mainConfig: mainConfig as any,
+ storybookVersion,
+ });
+};
+
+describe('storyshots-migration fix', () => {
+ afterEach(() => {
+ vi.restoreAllMocks();
+ });
+
+ it('should detect storyshots registered in main.js', async () => {
+ await expect(
+ check({
+ packageManager: {
+ getAllDependencies: async () => ({}),
+ },
+ main: { addons: ['@storybook/addon-storyshots'] },
+ })
+ ).resolves.toBeTruthy();
+ });
+
+ it('should detect storyshots in package.json', async () => {
+ await expect(
+ check({
+ packageManager: {
+ getAllDependencies: async () => ({ '@storybook/addon-storyshots': '7.0.0' }),
+ },
+ })
+ ).resolves.toBeTruthy();
+ });
+
+ it('no-op when storyshots is not present', async () => {
+ await expect(
+ check({
+ packageManager: {
+ getAllDependencies: async () => ({}),
+ },
+ main: { addons: ['@storybook/essentials'] },
+ })
+ ).resolves.toBeNull();
+ });
+});
diff --git a/code/lib/cli/src/automigrate/fixes/storyshots-migration.ts b/code/lib/cli/src/automigrate/fixes/storyshots-migration.ts
new file mode 100644
index 00000000000..6d047f88449
--- /dev/null
+++ b/code/lib/cli/src/automigrate/fixes/storyshots-migration.ts
@@ -0,0 +1,30 @@
+import chalk from 'chalk';
+import dedent from 'ts-dedent';
+import type { Fix } from '../types';
+
+export const storyshotsMigration: Fix = {
+ id: 'storyshots-migration',
+ promptOnly: true,
+
+ async check({ mainConfig, packageManager }) {
+ const allDeps = await packageManager.getAllDependencies();
+ const hasStoryshots =
+ allDeps['@storybook/addon-storyshots'] ||
+ mainConfig.addons?.find((addon) => {
+ const addonName = typeof addon === 'string' ? addon : addon.name;
+ return addonName.includes('@storybook/addon-storyshots');
+ });
+
+ return hasStoryshots ?? null;
+ },
+ prompt() {
+ return dedent`
+ ${chalk.bold(
+ 'Attention'
+ )}: Storyshots is now officially deprecated, is no longer being maintained, and was removed in Storybook 8.
+
+ We recommend following the migration guide we've prepared to help you during this transition period:
+ ${chalk.yellow('https://storybook.js.org/docs/writing-tests/storyshots-migration-guide')}
+ `;
+ },
+};
diff --git a/code/lib/cli/src/automigrate/index.ts b/code/lib/cli/src/automigrate/index.ts
index 1ef8ec9ce1a..3fd322e724d 100644
--- a/code/lib/cli/src/automigrate/index.ts
+++ b/code/lib/cli/src/automigrate/index.ts
@@ -9,7 +9,7 @@ import dedent from 'ts-dedent';
import { join } from 'path';
import { getStorybookInfo, loadMainConfig } from '@storybook/core-common';
import invariant from 'tiny-invariant';
-import { JsPackageManagerFactory, useNpmWarning } from '../js-package-manager';
+import { JsPackageManagerFactory } from '../js-package-manager';
import type { PackageManagerName } from '../js-package-manager';
import type { Fix, FixId, FixOptions, FixSummary } from './fixes';
@@ -55,7 +55,6 @@ export const automigrate = async ({
fixes: inputFixes,
dryRun,
yes,
- useNpm,
packageManager: pkgMgr,
list,
configDir: userSpecifiedConfigDir,
@@ -86,7 +85,6 @@ export const automigrate = async ({
const { fixResults, fixSummary, preCheckFailure } = await runFixes({
fixes,
- useNpm,
pkgMgr,
userSpecifiedConfigDir,
rendererPackage,
@@ -129,7 +127,6 @@ export async function runFixes({
fixes,
dryRun,
yes,
- useNpm,
pkgMgr,
userSpecifiedConfigDir,
rendererPackage,
@@ -138,7 +135,6 @@ export async function runFixes({
fixes: Fix[];
yes?: boolean;
dryRun?: boolean;
- useNpm?: boolean;
pkgMgr?: PackageManagerName;
userSpecifiedConfigDir?: string;
rendererPackage?: string;
@@ -148,12 +144,6 @@ export async function runFixes({
fixResults: Record;
fixSummary: FixSummary;
}> {
- if (useNpm) {
- useNpmWarning();
- // eslint-disable-next-line no-param-reassign
- pkgMgr = 'npm';
- }
-
const packageManager = JsPackageManagerFactory.getPackageManager({ force: pkgMgr });
const fixResults = {} as Record;
diff --git a/code/lib/cli/src/automigrate/types.ts b/code/lib/cli/src/automigrate/types.ts
index 1befb24bf22..5949d70db98 100644
--- a/code/lib/cli/src/automigrate/types.ts
+++ b/code/lib/cli/src/automigrate/types.ts
@@ -41,7 +41,6 @@ export interface FixOptions {
fixes?: Fix[];
yes?: boolean;
dryRun?: boolean;
- useNpm?: boolean;
packageManager?: PackageManagerName;
configDir?: string;
renderer?: string;
diff --git a/code/lib/cli/src/generate.ts b/code/lib/cli/src/generate.ts
index 2594863f0e9..5ee5c9d89ab 100644
--- a/code/lib/cli/src/generate.ts
+++ b/code/lib/cli/src/generate.ts
@@ -48,7 +48,6 @@ command('init')
.option('-f --force', 'Force add Storybook')
.option('-s --skip-install', 'Skip installing deps')
.option('--package-manager ', 'Force package manager for installing deps')
- .option('-N --use-npm', 'Use npm to install deps (deprecated)')
.option('--use-pnp', 'Enable pnp mode for Yarn 2+')
.option('-p --parser ', 'jscodeshift parser')
.option('-t --type ', 'Add Storybook for a specific project type')
@@ -65,7 +64,6 @@ command('add ')
'--package-manager ',
'Force package manager for installing dependencies'
)
- .option('-N --use-npm', 'Use NPM to install dependencies (deprecated)')
.option('-s --skip-postinstall', 'Skip package specific postinstall config modifications')
.action((addonName: string, options: any) => add(addonName, options));
@@ -79,7 +77,6 @@ command('upgrade')
'--package-manager ',
'Force package manager for installing dependencies'
)
- .option('-N --use-npm', 'Use NPM to install dependencies (deprecated)')
.option('-y --yes', 'Skip prompting the user')
.option('-n --dry-run', 'Only check for upgrades, do not install')
.option('-t --tag ', 'Upgrade to a certain npm dist-tag (e.g. next, prerelease)')
@@ -167,7 +164,6 @@ command('automigrate [fixId]')
.option('-y --yes', 'Skip prompting the user')
.option('-n --dry-run', 'Only check for fixes, do not actually run them')
.option('--package-manager ', 'Force package manager')
- .option('-N --use-npm', 'Use npm as package manager (deprecated)')
.option('-l --list', 'List available migrations')
.option('-c, --config-dir ', 'Directory of Storybook configurations to migrate')
.option('-s --skip-install', 'Skip installing deps')
@@ -196,7 +192,6 @@ command('doctor')
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)
.option('-c, --config-dir ', 'Directory where to load Storybook configurations from')
.option(
'--https',
@@ -251,7 +246,6 @@ command('dev')
});
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')
.option('--quiet', 'Suppress verbose build output')
diff --git a/code/lib/cli/src/generators/NEXTJS/index.ts b/code/lib/cli/src/generators/NEXTJS/index.ts
index 2588b387312..27d220321dd 100644
--- a/code/lib/cli/src/generators/NEXTJS/index.ts
+++ b/code/lib/cli/src/generators/NEXTJS/index.ts
@@ -1,14 +1,20 @@
+import { join } from 'path';
+import { existsSync } from 'fs';
import { CoreBuilder } from '../../project_types';
import { baseGenerator } from '../baseGenerator';
import type { Generator } from '../types';
const generator: Generator = async (packageManager, npmOptions, options) => {
+ let staticDir;
+ if (existsSync(join(process.cwd(), 'public'))) staticDir = 'public';
+
await baseGenerator(
packageManager,
npmOptions,
{ ...options, builder: CoreBuilder.Webpack5 },
'react',
{
+ staticDir,
extraAddons: ['@storybook/addon-onboarding'],
},
'nextjs'
diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts
index 5ad50927d01..707cd0b7890 100644
--- a/code/lib/cli/src/generators/baseGenerator.ts
+++ b/code/lib/cli/src/generators/baseGenerator.ts
@@ -163,9 +163,7 @@ const getFrameworkDetails = (
const stripVersions = (addons: string[]) => addons.map((addon) => getPackageDetails(addon)[0]);
const hasInteractiveStories = (rendererId: SupportedRenderers) =>
- ['react', 'angular', 'preact', 'svelte', 'vue', 'vue3', 'html', 'solid', 'qwik'].includes(
- rendererId
- );
+ ['react', 'angular', 'preact', 'svelte', 'vue3', 'html', 'solid', 'qwik'].includes(rendererId);
const hasFrameworkTemplates = (framework?: SupportedFrameworks) =>
framework ? ['angular', 'nextjs'].includes(framework) : false;
@@ -252,16 +250,16 @@ export async function baseGenerator(
...(extraAddonsToInstall || []),
].filter(Boolean);
+ // TODO: migrate template stories in solid and qwik to use @storybook/test
+ if (['solid', 'qwik'].includes(rendererId)) {
+ addonPackages.push('@storybook/testing-library');
+ } else {
+ addonPackages.push('@storybook/test');
+ }
+
if (hasInteractiveStories(rendererId)) {
addons.push('@storybook/addon-interactions');
addonPackages.push('@storybook/addon-interactions');
-
- // TODO: migrate template stories in solid and qwik to use @storybook/test
- if (['solid', 'qwik'].includes(rendererId)) {
- addonPackages.push('@storybook/testing-library');
- } else {
- addonPackages.push('@storybook/test');
- }
}
const files = await fse.readdir(process.cwd());
diff --git a/code/lib/cli/src/generators/configure.test.ts b/code/lib/cli/src/generators/configure.test.ts
index 3e4076f4da4..c65710124fa 100644
--- a/code/lib/cli/src/generators/configure.test.ts
+++ b/code/lib/cli/src/generators/configure.test.ts
@@ -128,7 +128,6 @@ describe('configurePreview', () => {
"/** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
@@ -159,7 +158,6 @@ describe('configurePreview', () => {
const preview: Preview = {
parameters: {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
@@ -210,7 +208,6 @@ describe('configurePreview', () => {
const preview: Preview = {
parameters: {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
diff --git a/code/lib/cli/src/generators/configure.ts b/code/lib/cli/src/generators/configure.ts
index bbc9992be1e..38cd265df83 100644
--- a/code/lib/cli/src/generators/configure.ts
+++ b/code/lib/cli/src/generators/configure.ts
@@ -152,7 +152,6 @@ export async function configurePreview(options: ConfigurePreviewOptions) {
: ''
}const preview${isTypescript ? ': Preview' : ''} = {
parameters: {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
diff --git a/code/lib/cli/src/generators/types.ts b/code/lib/cli/src/generators/types.ts
index 2f97a34df12..85ed0dbc600 100644
--- a/code/lib/cli/src/generators/types.ts
+++ b/code/lib/cli/src/generators/types.ts
@@ -41,7 +41,6 @@ export type Generator = (
export type CommandOptions = {
packageManager: PackageManagerName;
- useNpm?: boolean;
usePnp?: boolean;
type?: ProjectType;
force?: any;
diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts
index 5217bca197a..c0dbf5a3c7b 100644
--- a/code/lib/cli/src/initiate.ts
+++ b/code/lib/cli/src/initiate.ts
@@ -29,7 +29,7 @@ import svelteKitGenerator from './generators/SVELTEKIT';
import solidGenerator from './generators/SOLID';
import serverGenerator from './generators/SERVER';
import type { JsPackageManager } from './js-package-manager';
-import { JsPackageManagerFactory, useNpmWarning } from './js-package-manager';
+import { JsPackageManagerFactory } from './js-package-manager';
import type { NpmOptions } from './NpmOptions';
import type { CommandOptions, GeneratorOptions } from './generators/types';
import { HandledError } from './HandledError';
@@ -235,12 +235,7 @@ async function doInitiate(
}
| { shouldRunDev: false }
> {
- let { packageManager: pkgMgr } = options;
- if (options.useNpm) {
- useNpmWarning();
-
- pkgMgr = 'npm';
- }
+ const { packageManager: pkgMgr } = options;
const packageManager = JsPackageManagerFactory.getPackageManager({
force: pkgMgr,
diff --git a/code/lib/cli/src/js-package-manager/deprecations.ts b/code/lib/cli/src/js-package-manager/deprecations.ts
deleted file mode 100644
index 5883fad3a29..00000000000
--- a/code/lib/cli/src/js-package-manager/deprecations.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import deprecate from 'util-deprecate';
-
-export const useNpmWarning = deprecate(
- () => {},
- `\`--use-npm\` is deprecated and will be removed in Storybook 8.0.
-Please use the \`--package-manager=npm\` option instead.
-Read more at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#cli-option---use-npm-deprecated`
-);
diff --git a/code/lib/cli/src/js-package-manager/index.ts b/code/lib/cli/src/js-package-manager/index.ts
index d9849cbff26..f95d6f9659b 100644
--- a/code/lib/cli/src/js-package-manager/index.ts
+++ b/code/lib/cli/src/js-package-manager/index.ts
@@ -1,5 +1,3 @@
-export * from './deprecations';
-
export * from './JsPackageManagerFactory';
export * from './JsPackageManager';
diff --git a/code/lib/cli/src/upgrade.test.ts b/code/lib/cli/src/upgrade.test.ts
index 3acb5fd92a0..6fcea5f8459 100644
--- a/code/lib/cli/src/upgrade.test.ts
+++ b/code/lib/cli/src/upgrade.test.ts
@@ -63,7 +63,7 @@ describe('addNxPackagesToReject', () => {
const flags = ['--reject', '/preset-create-react-app/', '--some-flag', 'hello'];
expect(addNxPackagesToReject(flags)).toMatchObject([
'--reject',
- '/(preset-create-react-app|@nrwl/storybook|@nx/storybook)/',
+ '"/(preset-create-react-app|@nrwl/storybook|@nx/storybook)/"',
'--some-flag',
'hello',
]);
diff --git a/code/lib/cli/src/upgrade.ts b/code/lib/cli/src/upgrade.ts
index aefd6bc8bc0..a4b22675e02 100644
--- a/code/lib/cli/src/upgrade.ts
+++ b/code/lib/cli/src/upgrade.ts
@@ -3,9 +3,13 @@ import { telemetry, getStorybookCoreVersion } from '@storybook/telemetry';
import semver from 'semver';
import { logger } from '@storybook/node-logger';
import { withTelemetry } from '@storybook/core-server';
+import {
+ ConflictingVersionTagsError,
+ UpgradeStorybookPackagesError,
+} from '@storybook/core-events/server-errors';
import type { PackageJsonWithMaybeDeps, PackageManagerName } from './js-package-manager';
-import { getPackageDetails, JsPackageManagerFactory, useNpmWarning } from './js-package-manager';
+import { getPackageDetails, JsPackageManagerFactory } from './js-package-manager';
import { coerceSemver, commandLog } from './helpers';
import { automigrate } from './automigrate';
import { isCorePackage } from './utils';
@@ -117,7 +121,7 @@ export const addNxPackagesToReject = (flags: string[]) => {
if (newFlags[index + 1].endsWith('/') && newFlags[index + 1].startsWith('/')) {
// Remove last and first slash so that I can add the parentheses
newFlags[index + 1] = newFlags[index + 1].substring(1, newFlags[index + 1].length - 1);
- newFlags[index + 1] = `/(${newFlags[index + 1]}|@nrwl/storybook|@nx/storybook)/`;
+ newFlags[index + 1] = `"/(${newFlags[index + 1]}|@nrwl/storybook|@nx/storybook)/"`;
} else {
// Adding the two packages as comma-separated values
// If the existing rejects are in regex format, they will be ignored.
@@ -135,7 +139,6 @@ export interface UpgradeOptions {
tag: string;
prerelease: boolean;
skipCheck: boolean;
- useNpm: boolean;
packageManager: PackageManagerName;
dryRun: boolean;
yes: boolean;
@@ -147,28 +150,20 @@ export const doUpgrade = async ({
tag,
prerelease,
skipCheck,
- useNpm,
packageManager: pkgMgr,
dryRun,
configDir,
yes,
...options
}: UpgradeOptions) => {
- if (useNpm) {
- useNpmWarning();
- // eslint-disable-next-line no-param-reassign
- pkgMgr = 'npm';
- }
const packageManager = JsPackageManagerFactory.getPackageManager({ force: pkgMgr });
const beforeVersion = await getStorybookCoreVersion();
- commandLog(`Checking for latest versions of '@storybook/*' packages`);
+ commandLog(`Checking for latest versions of '@storybook/*' packages\n`);
if (tag && prerelease) {
- throw new Error(
- `Cannot set both --tag and --prerelease. Use --tag next to get the latest prereleae`
- );
+ throw new ConflictingVersionTagsError();
}
let target = 'latest';
@@ -187,20 +182,40 @@ export const doUpgrade = async ({
flags.push(target);
flags = addExtraFlags(EXTRA_FLAGS, flags, await packageManager.retrievePackageJson());
flags = addNxPackagesToReject(flags);
- const check = spawnSync('npx', ['npm-check-updates@latest', '/storybook/', ...flags], {
+
+ const command = 'npx';
+ const checkArgs = ['npm-check-updates@latest', '/storybook/', ...flags];
+ const check = spawnSync(command, checkArgs, {
stdio: 'pipe',
shell: true,
});
+
+ if (check.stderr && !check.stderr.toString().includes('npm notice')) {
+ throw new UpgradeStorybookPackagesError({
+ command,
+ args: checkArgs,
+ errorMessage: check.stderr.toString(),
+ });
+ }
+
logger.info(check.stdout.toString());
- logger.info(check.stderr.toString());
- const checkSb = spawnSync('npx', ['npm-check-updates@latest', 'sb', ...flags], {
+ const checkSbArgs = ['npm-check-updates@latest', 'sb', ...flags];
+ const checkSb = spawnSync(command, checkSbArgs, {
stdio: 'pipe',
shell: true,
});
logger.info(checkSb.stdout.toString());
logger.info(checkSb.stderr.toString());
+ if (checkSb.stderr && !checkSb.stderr.toString().includes('npm notice')) {
+ throw new UpgradeStorybookPackagesError({
+ command,
+ args: checkSbArgs,
+ errorMessage: checkSb.stderr.toString(),
+ });
+ }
+
if (!dryRun) {
commandLog(`Installing upgrades`);
await packageManager.installDependencies();
diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts
index 49bb1276857..efd8bdb1d81 100644
--- a/code/lib/cli/src/versions.ts
+++ b/code/lib/cli/src/versions.ts
@@ -1,83 +1,83 @@
// auto generated file, do not edit
export default {
- '@storybook/addon-a11y': '8.0.0-alpha.4',
- '@storybook/addon-actions': '8.0.0-alpha.4',
- '@storybook/addon-backgrounds': '8.0.0-alpha.4',
- '@storybook/addon-controls': '8.0.0-alpha.4',
- '@storybook/addon-docs': '8.0.0-alpha.4',
- '@storybook/addon-essentials': '8.0.0-alpha.4',
- '@storybook/addon-highlight': '8.0.0-alpha.4',
- '@storybook/addon-interactions': '8.0.0-alpha.4',
- '@storybook/addon-jest': '8.0.0-alpha.4',
- '@storybook/addon-links': '8.0.0-alpha.4',
- '@storybook/addon-mdx-gfm': '8.0.0-alpha.4',
- '@storybook/addon-measure': '8.0.0-alpha.4',
- '@storybook/addon-outline': '8.0.0-alpha.4',
- '@storybook/addon-storysource': '8.0.0-alpha.4',
- '@storybook/addon-themes': '8.0.0-alpha.4',
- '@storybook/addon-toolbars': '8.0.0-alpha.4',
- '@storybook/addon-viewport': '8.0.0-alpha.4',
- '@storybook/angular': '8.0.0-alpha.4',
- '@storybook/blocks': '8.0.0-alpha.4',
- '@storybook/builder-manager': '8.0.0-alpha.4',
- '@storybook/builder-vite': '8.0.0-alpha.4',
- '@storybook/builder-webpack5': '8.0.0-alpha.4',
- '@storybook/channels': '8.0.0-alpha.4',
- '@storybook/cli': '8.0.0-alpha.4',
- '@storybook/client-logger': '8.0.0-alpha.4',
- '@storybook/codemod': '8.0.0-alpha.4',
- '@storybook/components': '8.0.0-alpha.4',
- '@storybook/core-common': '8.0.0-alpha.4',
- '@storybook/core-events': '8.0.0-alpha.4',
- '@storybook/core-server': '8.0.0-alpha.4',
- '@storybook/core-webpack': '8.0.0-alpha.4',
- '@storybook/csf-plugin': '8.0.0-alpha.4',
- '@storybook/csf-tools': '8.0.0-alpha.4',
- '@storybook/docs-tools': '8.0.0-alpha.4',
- '@storybook/ember': '8.0.0-alpha.4',
- '@storybook/html': '8.0.0-alpha.4',
- '@storybook/html-vite': '8.0.0-alpha.4',
- '@storybook/html-webpack5': '8.0.0-alpha.4',
- '@storybook/instrumenter': '8.0.0-alpha.4',
- '@storybook/manager': '8.0.0-alpha.4',
- '@storybook/manager-api': '8.0.0-alpha.4',
- '@storybook/nextjs': '8.0.0-alpha.4',
- '@storybook/node-logger': '8.0.0-alpha.4',
- '@storybook/preact': '8.0.0-alpha.4',
- '@storybook/preact-vite': '8.0.0-alpha.4',
- '@storybook/preact-webpack5': '8.0.0-alpha.4',
- '@storybook/preset-create-react-app': '8.0.0-alpha.4',
- '@storybook/preset-html-webpack': '8.0.0-alpha.4',
- '@storybook/preset-preact-webpack': '8.0.0-alpha.4',
- '@storybook/preset-react-webpack': '8.0.0-alpha.4',
- '@storybook/preset-server-webpack': '8.0.0-alpha.4',
- '@storybook/preset-svelte-webpack': '8.0.0-alpha.4',
- '@storybook/preset-vue3-webpack': '8.0.0-alpha.4',
- '@storybook/preset-web-components-webpack': '8.0.0-alpha.4',
- '@storybook/preview': '8.0.0-alpha.4',
- '@storybook/preview-api': '8.0.0-alpha.4',
- '@storybook/react': '8.0.0-alpha.4',
- '@storybook/react-dom-shim': '8.0.0-alpha.4',
- '@storybook/react-vite': '8.0.0-alpha.4',
- '@storybook/react-webpack5': '8.0.0-alpha.4',
- '@storybook/router': '8.0.0-alpha.4',
- '@storybook/server': '8.0.0-alpha.4',
- '@storybook/server-webpack5': '8.0.0-alpha.4',
- '@storybook/source-loader': '8.0.0-alpha.4',
- '@storybook/svelte': '8.0.0-alpha.4',
- '@storybook/svelte-vite': '8.0.0-alpha.4',
- '@storybook/svelte-webpack5': '8.0.0-alpha.4',
- '@storybook/sveltekit': '8.0.0-alpha.4',
- '@storybook/telemetry': '8.0.0-alpha.4',
- '@storybook/test': '8.0.0-alpha.4',
- '@storybook/theming': '8.0.0-alpha.4',
- '@storybook/types': '8.0.0-alpha.4',
- '@storybook/vue3': '8.0.0-alpha.4',
- '@storybook/vue3-vite': '8.0.0-alpha.4',
- '@storybook/vue3-webpack5': '8.0.0-alpha.4',
- '@storybook/web-components': '8.0.0-alpha.4',
- '@storybook/web-components-vite': '8.0.0-alpha.4',
- '@storybook/web-components-webpack5': '8.0.0-alpha.4',
- sb: '8.0.0-alpha.4',
- storybook: '8.0.0-alpha.4',
+ '@storybook/addon-a11y': '8.0.0-alpha.8',
+ '@storybook/addon-actions': '8.0.0-alpha.8',
+ '@storybook/addon-backgrounds': '8.0.0-alpha.8',
+ '@storybook/addon-controls': '8.0.0-alpha.8',
+ '@storybook/addon-docs': '8.0.0-alpha.8',
+ '@storybook/addon-essentials': '8.0.0-alpha.8',
+ '@storybook/addon-highlight': '8.0.0-alpha.8',
+ '@storybook/addon-interactions': '8.0.0-alpha.8',
+ '@storybook/addon-jest': '8.0.0-alpha.8',
+ '@storybook/addon-links': '8.0.0-alpha.8',
+ '@storybook/addon-mdx-gfm': '8.0.0-alpha.8',
+ '@storybook/addon-measure': '8.0.0-alpha.8',
+ '@storybook/addon-outline': '8.0.0-alpha.8',
+ '@storybook/addon-storysource': '8.0.0-alpha.8',
+ '@storybook/addon-themes': '8.0.0-alpha.8',
+ '@storybook/addon-toolbars': '8.0.0-alpha.8',
+ '@storybook/addon-viewport': '8.0.0-alpha.8',
+ '@storybook/angular': '8.0.0-alpha.8',
+ '@storybook/blocks': '8.0.0-alpha.8',
+ '@storybook/builder-manager': '8.0.0-alpha.8',
+ '@storybook/builder-vite': '8.0.0-alpha.8',
+ '@storybook/builder-webpack5': '8.0.0-alpha.8',
+ '@storybook/channels': '8.0.0-alpha.8',
+ '@storybook/cli': '8.0.0-alpha.8',
+ '@storybook/client-logger': '8.0.0-alpha.8',
+ '@storybook/codemod': '8.0.0-alpha.8',
+ '@storybook/components': '8.0.0-alpha.8',
+ '@storybook/core-common': '8.0.0-alpha.8',
+ '@storybook/core-events': '8.0.0-alpha.8',
+ '@storybook/core-server': '8.0.0-alpha.8',
+ '@storybook/core-webpack': '8.0.0-alpha.8',
+ '@storybook/csf-plugin': '8.0.0-alpha.8',
+ '@storybook/csf-tools': '8.0.0-alpha.8',
+ '@storybook/docs-tools': '8.0.0-alpha.8',
+ '@storybook/ember': '8.0.0-alpha.8',
+ '@storybook/html': '8.0.0-alpha.8',
+ '@storybook/html-vite': '8.0.0-alpha.8',
+ '@storybook/html-webpack5': '8.0.0-alpha.8',
+ '@storybook/instrumenter': '8.0.0-alpha.8',
+ '@storybook/manager': '8.0.0-alpha.8',
+ '@storybook/manager-api': '8.0.0-alpha.8',
+ '@storybook/nextjs': '8.0.0-alpha.8',
+ '@storybook/node-logger': '8.0.0-alpha.8',
+ '@storybook/preact': '8.0.0-alpha.8',
+ '@storybook/preact-vite': '8.0.0-alpha.8',
+ '@storybook/preact-webpack5': '8.0.0-alpha.8',
+ '@storybook/preset-create-react-app': '8.0.0-alpha.8',
+ '@storybook/preset-html-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-preact-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-react-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-server-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-svelte-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-vue3-webpack': '8.0.0-alpha.8',
+ '@storybook/preset-web-components-webpack': '8.0.0-alpha.8',
+ '@storybook/preview': '8.0.0-alpha.8',
+ '@storybook/preview-api': '8.0.0-alpha.8',
+ '@storybook/react': '8.0.0-alpha.8',
+ '@storybook/react-dom-shim': '8.0.0-alpha.8',
+ '@storybook/react-vite': '8.0.0-alpha.8',
+ '@storybook/react-webpack5': '8.0.0-alpha.8',
+ '@storybook/router': '8.0.0-alpha.8',
+ '@storybook/server': '8.0.0-alpha.8',
+ '@storybook/server-webpack5': '8.0.0-alpha.8',
+ '@storybook/source-loader': '8.0.0-alpha.8',
+ '@storybook/svelte': '8.0.0-alpha.8',
+ '@storybook/svelte-vite': '8.0.0-alpha.8',
+ '@storybook/svelte-webpack5': '8.0.0-alpha.8',
+ '@storybook/sveltekit': '8.0.0-alpha.8',
+ '@storybook/telemetry': '8.0.0-alpha.8',
+ '@storybook/test': '8.0.0-alpha.8',
+ '@storybook/theming': '8.0.0-alpha.8',
+ '@storybook/types': '8.0.0-alpha.8',
+ '@storybook/vue3': '8.0.0-alpha.8',
+ '@storybook/vue3-vite': '8.0.0-alpha.8',
+ '@storybook/vue3-webpack5': '8.0.0-alpha.8',
+ '@storybook/web-components': '8.0.0-alpha.8',
+ '@storybook/web-components-vite': '8.0.0-alpha.8',
+ '@storybook/web-components-webpack5': '8.0.0-alpha.8',
+ sb: '8.0.0-alpha.8',
+ storybook: '8.0.0-alpha.8',
};
diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json
index 157ba7ae102..328a6502566 100644
--- a/code/lib/client-logger/package.json
+++ b/code/lib/client-logger/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/client-logger",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json
index f3dda81527b..f0401dc52f7 100644
--- a/code/lib/codemod/package.json
+++ b/code/lib/codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/codemod",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "A collection of codemod scripts written with JSCodeshift",
"keywords": [
"storybook"
diff --git a/code/lib/codemod/src/transforms/mdx-to-csf.ts b/code/lib/codemod/src/transforms/mdx-to-csf.ts
index b5f68b8a7b5..51bd69be962 100644
--- a/code/lib/codemod/src/transforms/mdx-to-csf.ts
+++ b/code/lib/codemod/src/transforms/mdx-to-csf.ts
@@ -136,6 +136,7 @@ export function transform(source: string, baseName: string): [string, string] {
value: `/* ${nodeString} is deprecated, please migrate it to see: https://storybook.js.org/migration-guides/7.0 */`,
};
storiesMap.set(idAttribute.value as string, { type: 'id' });
+ // @ts-expect-error issue with mdast types
parent?.children.splice(index as number, 0, newNode);
// current index is the new comment, and index + 1 is current node
// SKIP traversing current node, and continue with the node after that
diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json
index 12485ad7e4b..7bd54a9428a 100644
--- a/code/lib/core-common/package.json
+++ b/code/lib/core-common/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core-common",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
diff --git a/code/lib/core-common/src/utils/resolve-path-in-sb-cache.ts b/code/lib/core-common/src/utils/resolve-path-in-sb-cache.ts
index de88c2e2c00..af7135817af 100644
--- a/code/lib/core-common/src/utils/resolve-path-in-sb-cache.ts
+++ b/code/lib/core-common/src/utils/resolve-path-in-sb-cache.ts
@@ -9,9 +9,9 @@ import findCacheDirectory from 'find-cache-dir';
* @param fileOrDirectoryName {string} Name of the file or directory
* @return {string} Absolute path to the file or directory
*/
-export function resolvePathInStorybookCache(fileOrDirectoryName: string): string {
+export function resolvePathInStorybookCache(fileOrDirectoryName: string, sub = 'default'): string {
let cacheDirectory = findCacheDirectory({ name: 'storybook' });
- cacheDirectory ||= path.join(process.cwd(), '.cache/storybook');
+ cacheDirectory ||= path.join(process.cwd(), '.cache', 'storybook');
- return path.join(cacheDirectory, fileOrDirectoryName);
+ return path.join(cacheDirectory, sub, fileOrDirectoryName);
}
diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json
index 8ed6a52ddfa..0041af7942d 100644
--- a/code/lib/core-events/package.json
+++ b/code/lib/core-events/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core-events",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Event names used in storybook core",
"keywords": [
"storybook"
diff --git a/code/lib/core-events/src/errors/preview-errors.ts b/code/lib/core-events/src/errors/preview-errors.ts
index 50cb0609861..26544d7efd8 100644
--- a/code/lib/core-events/src/errors/preview-errors.ts
+++ b/code/lib/core-events/src/errors/preview-errors.ts
@@ -63,7 +63,7 @@ export class ImplicitActionsDuringRendering extends StorybookError {
template() {
return dedent`
- We detected that you use an implicit action arg during ${this.data.phase} of your story.
+ We detected that you use an implicit action arg while ${this.data.phase} of your story.
${this.data.deprecated ? `\nThis is deprecated and won't work in Storybook 8 anymore.\n` : ``}
Please provide an explicit spy to your args like this:
import { fn } from '@storybook/test';
diff --git a/code/lib/core-events/src/errors/server-errors.ts b/code/lib/core-events/src/errors/server-errors.ts
index bacdd7d6055..efdf01f0a45 100644
--- a/code/lib/core-events/src/errors/server-errors.ts
+++ b/code/lib/core-events/src/errors/server-errors.ts
@@ -120,6 +120,8 @@ export class CouldNotEvaluateFrameworkError extends StorybookError {
}
}
+// this error is not used anymore, but we keep it to maintain unique its error code
+// which is used for telemetry
export class ConflictingStaticDirConfigError extends StorybookError {
readonly category = Category.CORE_SERVER;
@@ -138,7 +140,6 @@ export class ConflictingStaticDirConfigError extends StorybookError {
`;
}
}
-
export class InvalidStoriesEntryError extends StorybookError {
readonly category = Category.CORE_COMMON;
@@ -422,7 +423,7 @@ export class GenerateNewProjectOnInitError extends StorybookError {
super();
}
- template(): string {
+ template() {
return dedent`
There was an error while using ${this.data.packageManager} to create a new ${
this.data.projectType
@@ -432,3 +433,35 @@ export class GenerateNewProjectOnInitError extends StorybookError {
`;
}
}
+
+export class ConflictingVersionTagsError extends StorybookError {
+ readonly category = Category.CLI_UPGRADE;
+
+ readonly code = 1;
+
+ template() {
+ return 'Cannot set both --tag and --prerelease. Use --tag=next to get the latest prerelease.';
+ }
+}
+
+export class UpgradeStorybookPackagesError extends StorybookError {
+ readonly category = Category.CLI_UPGRADE;
+
+ readonly code = 2;
+
+ constructor(public data: { command: string; args: string[]; errorMessage: string }) {
+ super();
+ }
+
+ template() {
+ return dedent`
+ There was an error while trying to upgrade your Storybook dependencies.
+
+ Command:
+ ${this.data.command} ${this.data.args.join(' ')}
+
+ Error:
+ ${this.data.errorMessage}
+ `;
+ }
+}
diff --git a/code/lib/core-events/src/index.ts b/code/lib/core-events/src/index.ts
index d8d6c41c01d..6d98e629120 100644
--- a/code/lib/core-events/src/index.ts
+++ b/code/lib/core-events/src/index.ts
@@ -38,6 +38,8 @@ enum events {
STORY_RENDER_PHASE_CHANGED = 'storyRenderPhaseChanged',
// Emitted when the play function throws
PLAY_FUNCTION_THREW_EXCEPTION = 'playFunctionThrewException',
+ // Emitted when there were unhandled errors while playing the story
+ UNHANDLED_ERRORS_WHILE_PLAYING = 'unhandledErrorsWhilePlaying',
// Tell the story store to update (a subset of) a stories arg values
UPDATE_STORY_ARGS = 'updateStoryArgs',
// The values of a stories args just changed
@@ -88,6 +90,7 @@ export const {
GLOBALS_UPDATED,
NAVIGATE_URL,
PLAY_FUNCTION_THREW_EXCEPTION,
+ UNHANDLED_ERRORS_WHILE_PLAYING,
PRELOAD_ENTRIES,
PREVIEW_BUILDER_PROGRESS,
PREVIEW_KEYDOWN,
@@ -124,10 +127,6 @@ export const {
TELEMETRY_ERROR,
} = events;
-// Used to break out of the current render without showing a redbox
-// eslint-disable-next-line local-rules/no-uncategorized-errors
-export const IGNORED_EXCEPTION = new Error('ignoredException');
-
export interface WhatsNewCache {
lastDismissedPost?: string;
lastReadPost?: string;
diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json
index 2fb8d372ff2..cdea9a4b00d 100644
--- a/code/lib/core-server/package.json
+++ b/code/lib/core-server/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core-server",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@@ -68,7 +68,7 @@
"@storybook/core-events": "workspace:*",
"@storybook/csf": "^0.1.2",
"@storybook/csf-tools": "workspace:*",
- "@storybook/docs-mdx": "^0.1.0",
+ "@storybook/docs-mdx": "3.0.0",
"@storybook/global": "^5.0.0",
"@storybook/manager": "workspace:*",
"@storybook/node-logger": "workspace:*",
diff --git a/code/lib/core-server/src/build-dev.ts b/code/lib/core-server/src/build-dev.ts
index 5e8a0a955c2..88c3ab483f0 100644
--- a/code/lib/core-server/src/build-dev.ts
+++ b/code/lib/core-server/src/build-dev.ts
@@ -1,5 +1,6 @@
import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storybook/types';
import {
+ getProjectRoot,
loadAllPresets,
loadMainConfig,
resolveAddonName,
@@ -10,9 +11,9 @@ import {
import prompts from 'prompts';
import invariant from 'tiny-invariant';
import { global } from '@storybook/global';
-import { telemetry } from '@storybook/telemetry';
+import { telemetry, oneWayHash } from '@storybook/telemetry';
-import { join, resolve } from 'path';
+import { join, relative, resolve } from 'path';
import { deprecate } from '@storybook/node-logger';
import dedent from 'ts-dedent';
import { readFile } from 'fs-extra';
@@ -49,17 +50,28 @@ export async function buildDevStandalone(
name: 'shouldChangePort',
message: `Port ${options.port} is not available. Would you like to run Storybook on port ${port} instead?`,
});
- if (!shouldChangePort) process.exit(1);
+ if (!shouldChangePort) {
+ process.exit(1);
+ }
+ }
+
+ const rootDir = getProjectRoot();
+ const configDir = resolve(options.configDir);
+ const cacheKey = oneWayHash(relative(rootDir, configDir));
+
+ const cacheOutputDir = resolvePathInStorybookCache('public', cacheKey);
+ let outputDir = resolve(options.outputDir || cacheOutputDir);
+ if (options.smokeTest) {
+ outputDir = cacheOutputDir;
}
/* eslint-disable no-param-reassign */
options.port = port;
options.versionCheck = versionCheck;
options.configType = 'DEVELOPMENT';
- options.configDir = resolve(options.configDir);
- options.outputDir = options.smokeTest
- ? resolvePathInStorybookCache('public')
- : resolve(options.outputDir || resolvePathInStorybookCache('public'));
+ options.configDir = configDir;
+ options.cacheKey = cacheKey;
+ options.outputDir = outputDir;
options.serverChannelUrl = getServerChannelUrl(port, options);
/* eslint-enable no-param-reassign */
@@ -67,10 +79,15 @@ export async function buildDevStandalone(
const { framework } = config;
const corePresets = [];
- const frameworkName = typeof framework === 'string' ? framework : framework?.name;
- validateFrameworkName(frameworkName);
+ let frameworkName = typeof framework === 'string' ? framework : framework?.name;
+ if (!options.ignorePreview) {
+ validateFrameworkName(frameworkName);
+ }
+ if (frameworkName) {
+ corePresets.push(join(frameworkName, 'preset'));
+ }
- corePresets.push(join(frameworkName, 'preset'));
+ frameworkName = frameworkName || 'custom';
try {
await warnOnIncompatibleAddons(config);
diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts
index b85932ca246..2ae75f747e5 100644
--- a/code/lib/core-server/src/build-static.ts
+++ b/code/lib/core-server/src/build-static.ts
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import { copy, emptyDir, ensureDir } from 'fs-extra';
-import { dirname, isAbsolute, join, resolve } from 'path';
+import { dirname, join, relative, resolve } from 'path';
import { global } from '@storybook/global';
import { deprecate, logger } from '@storybook/node-logger';
import { getPrecedingUpgrade, telemetry } from '@storybook/telemetry';
@@ -12,21 +12,15 @@ import {
normalizeStories,
resolveAddonName,
} from '@storybook/core-common';
-import { ConflictingStaticDirConfigError } from '@storybook/core-events/server-errors';
-import isEqual from 'lodash/isEqual.js';
import dedent from 'ts-dedent';
import { outputStats } from './utils/output-stats';
-import {
- copyAllStaticFiles,
- copyAllStaticFilesRelativeToMain,
-} from './utils/copy-all-static-files';
+import { copyAllStaticFilesRelativeToMain } from './utils/copy-all-static-files';
import { getBuilders } from './utils/get-builders';
import { extractStoriesJson } from './utils/stories-json';
import { extractStorybookMetadata } from './utils/metadata';
import { StoryIndexGenerator } from './utils/StoryIndexGenerator';
import { summarizeIndex } from './utils/summarizeIndex';
-import { defaultStaticDirs } from './utils/constants';
import { buildOrThrow } from './utils/build-or-throw';
export type BuildStaticStandaloneOptions = CLIOptions &
@@ -41,17 +35,11 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
throw new Error("Won't remove current directory. Check your outputDir!");
}
- if (options.staticDir?.includes('/')) {
- throw new Error("Won't copy root directory. Check your staticDirs!");
- }
-
- options.outputDir = isAbsolute(options.outputDir)
- ? options.outputDir
- : join(process.cwd(), options.outputDir);
+ options.outputDir = resolve(options.outputDir);
options.configDir = resolve(options.configDir);
/* eslint-enable no-param-reassign */
- logger.info(chalk`=> Cleaning outputDir: {cyan ${options.outputDir.replace(process.cwd(), '')}}`);
+ logger.info(chalk`=> Cleaning outputDir: {cyan ${relative(process.cwd(), options.outputDir)}}`);
if (options.outputDir === '/') {
throw new Error("Won't remove directory '/'. Check your outputDir!");
}
@@ -65,7 +53,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
const frameworkName = typeof framework === 'string' ? framework : framework?.name;
if (frameworkName) {
corePresets.push(join(frameworkName, 'preset'));
- } else {
+ } else if (!options.ignorePreview) {
logger.warn(`you have not specified a framework in your ${options.configDir}/main.js`);
}
@@ -106,16 +94,14 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
build,
});
- const [features, core, staticDirs, indexers, deprecatedStoryIndexers, stories, docsOptions] =
- await Promise.all([
- presets.apply('features'),
- presets.apply('core'),
- presets.apply('staticDirs'),
- presets.apply('experimental_indexers', []),
- presets.apply('storyIndexers', []),
- presets.apply('stories'),
- presets.apply('docs', {}),
- ]);
+ const [features, core, staticDirs, indexers, stories, docsOptions] = await Promise.all([
+ presets.apply('features'),
+ presets.apply('core'),
+ presets.apply('staticDirs'),
+ presets.apply('experimental_indexers', []),
+ presets.apply('stories'),
+ presets.apply('docs', {}),
+ ]);
if (features?.storyStoreV7 === false) {
deprecate(
@@ -131,10 +117,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
build,
};
- if (options.staticDir && !isEqual(staticDirs, defaultStaticDirs)) {
- throw new ConflictingStaticDirConfigError();
- }
-
const effects: Promise[] = [];
global.FEATURES = features;
@@ -148,9 +130,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
copyAllStaticFilesRelativeToMain(staticDirs, options.outputDir, options.configDir)
);
}
- if (options.staticDir) {
- effects.push(copyAllStaticFiles(options.staticDir, options.outputDir));
- }
const coreServerPublicDir = join(
dirname(require.resolve('@storybook/core-server/package.json')),
@@ -169,7 +148,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
const normalizedStories = normalizeStories(stories, directories);
const generator = new StoryIndexGenerator(normalizedStories, {
...directories,
- storyIndexers: deprecatedStoryIndexers,
indexers,
docs: docsOptions,
storyStoreV7: !!features?.storyStoreV7,
diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts
index 815b9cb7241..cb68267391f 100644
--- a/code/lib/core-server/src/presets/common-preset.ts
+++ b/code/lib/core-server/src/presets/common-preset.ts
@@ -46,7 +46,7 @@ export const staticDirs: PresetPropertyFn<'staticDirs'> = async (values = []) =>
export const favicon = async (
value: string | undefined,
- options: Pick
+ options: Pick
) => {
if (value) {
return value;
@@ -55,7 +55,7 @@ export const favicon = async (
const statics = staticDirsValue
? staticDirsValue.map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`))
- : options.staticDir;
+ : [];
if (statics && statics.length > 0) {
const lists = await Promise.all(
@@ -187,12 +187,11 @@ export const previewAnnotations = async (base: any, options: Options) => {
export const features: PresetProperty<'features'> = async (existing) => ({
...existing,
- warnOnLegacyHierarchySeparator: true,
buildStoriesJson: false,
storyStoreV7: true,
argTypeTargetsV7: true,
legacyDecoratorFileOrder: false,
- disallowImplicitActionsInRenderV8: false,
+ disallowImplicitActionsInRenderV8: true,
});
export const csfIndexer: Indexer = {
diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts
index fefb477426d..bc161fff6ff 100644
--- a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts
+++ b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts
@@ -6,8 +6,6 @@
import { describe, beforeEach, it, expect, vi } from 'vitest';
import path from 'path';
-// @ts-expect-error -- cannot find declaration file
-import { createStoriesMdxIndexer } from '@storybook/addon-docs/preset';
import { normalizeStoriesEntry } from '@storybook/core-common';
import type { NormalizedStoriesSpecifier, StoryIndexEntry } from '@storybook/types';
import { readCsf, getStorySortParameter } from '@storybook/csf-tools';
@@ -44,8 +42,7 @@ const getStorySortParameterMock = vi.mocked(getStorySortParameter);
const options: StoryIndexGeneratorOptions = {
configDir: path.join(__dirname, '__mockdata__'),
workingDir: path.join(__dirname, '__mockdata__'),
- storyIndexers: [],
- indexers: [csfIndexer, createStoriesMdxIndexer(false)],
+ indexers: [csfIndexer],
storyStoreV7: true,
docs: { defaultName: 'docs', autodocs: false },
};
@@ -292,51 +289,6 @@ describe('StoryIndexGenerator', () => {
});
});
- describe('mdx tagged components', () => {
- it('adds docs entry with docs enabled', async () => {
- const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(
- './src/nested/Page.stories.mdx',
- options
- );
-
- const generator = new StoryIndexGenerator([specifier], {
- ...options,
- });
- await generator.initialize();
-
- expect(await generator.getIndex()).toMatchInlineSnapshot(`
- {
- "entries": {
- "page--docs": {
- "id": "page--docs",
- "importPath": "./src/nested/Page.stories.mdx",
- "name": "docs",
- "storiesImports": [],
- "tags": [
- "stories-mdx",
- "docs",
- ],
- "title": "Page",
- "type": "docs",
- },
- "page--story-one": {
- "id": "page--story-one",
- "importPath": "./src/nested/Page.stories.mdx",
- "name": "StoryOne",
- "tags": [
- "stories-mdx",
- "story",
- ],
- "title": "Page",
- "type": "story",
- },
- },
- "v": 4,
- }
- `);
- }, 20_000);
- });
-
describe('autodocs', () => {
const autodocsOptions = {
...options,
diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts
index d8f4e8ba95e..96e72091073 100644
--- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts
+++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts
@@ -11,20 +11,17 @@ import type {
DocsIndexEntry,
ComponentTitle,
NormalizedStoriesSpecifier,
- StoryIndexer,
DocsOptions,
Path,
Tag,
StoryIndex,
StoryName,
Indexer,
- IndexerOptions,
- DeprecatedIndexer,
StorybookConfigRaw,
} from '@storybook/types';
import { userOrAutoTitleFromSpecifier, sortStoriesV7 } from '@storybook/preview-api';
import { commonGlobOptions, normalizeStoryPath } from '@storybook/core-common';
-import { deprecate, logger, once } from '@storybook/node-logger';
+import { logger, once } from '@storybook/node-logger';
import { getStorySortParameter } from '@storybook/csf-tools';
import { storyNameFromExport, toId } from '@storybook/csf';
import { analyze } from '@storybook/docs-mdx';
@@ -53,7 +50,6 @@ export type StoryIndexGeneratorOptions = {
workingDir: Path;
configDir: Path;
storyStoreV7: boolean;
- storyIndexers: StoryIndexer[];
indexers: Indexer[];
docs: DocsOptions;
build?: StorybookConfigRaw['build'];
@@ -284,25 +280,10 @@ export class StoryIndexGenerator {
return title;
};
- const indexer = (this.options.indexers as StoryIndexer[])
- .concat(this.options.storyIndexers)
- .find((ind) => ind.test.exec(absolutePath));
+ const indexer = this.options.indexers.find((ind) => ind.test.exec(absolutePath));
invariant(indexer, `No matching indexer found for ${absolutePath}`);
- if (indexer.indexer) {
- deprecate(
- dedent`'storyIndexers' is deprecated, please use 'experimental_indexers' instead. Found a deprecated indexer with matcher: ${indexer.test}
- - Refer to the migration guide at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storyindexers-is-replaced-with-experimental_indexers`
- );
- return this.extractStoriesFromDeprecatedIndexer({
- indexer: indexer.indexer,
- indexerOptions: { makeTitle: defaultMakeTitle },
- absolutePath,
- importPath,
- });
- }
-
const indexInputs = await indexer.createIndex(absolutePath, { makeTitle: defaultMakeTitle });
const entries: ((StoryIndexEntryWithMetaId | DocsCacheEntry) & { tags: Tag[] })[] =
@@ -362,69 +343,6 @@ export class StoryIndexGenerator {
};
}
- async extractStoriesFromDeprecatedIndexer({
- indexer,
- indexerOptions,
- absolutePath,
- importPath,
- }: {
- indexer: DeprecatedIndexer['indexer'];
- indexerOptions: IndexerOptions;
- absolutePath: Path;
- importPath: Path;
- }) {
- const csf = await indexer(absolutePath, indexerOptions);
-
- const entries = [];
-
- const componentTags = csf.meta.tags || [];
- csf.stories.forEach(({ id, name, tags: storyTags, parameters }) => {
- if (!parameters?.docsOnly) {
- const tags = (csf.meta.tags ?? []).concat(storyTags ?? [], 'story');
- invariant(csf.meta.title);
- entries.push({
- id,
- title: csf.meta.title,
- name,
- importPath,
- tags,
- type: 'story',
- // We need to keep track of the csf meta id so we know the component id when referencing docs below in `extractDocs`
- metaId: csf.meta.id,
- });
- }
- });
-
- if (csf.stories.length) {
- const { autodocs } = this.options.docs;
- const componentAutodocs = componentTags.includes(AUTODOCS_TAG);
- const autodocsOptedIn = autodocs === true || (autodocs === 'tag' && componentAutodocs);
- // We need a docs entry attached to the CSF file if either:
- // a) it is a stories.mdx transpiled to CSF, OR
- // b) we have docs page enabled for this file
- if (componentTags.includes(STORIES_MDX_TAG) || autodocsOptedIn) {
- const name = this.options.docs.defaultName ?? 'Docs';
- invariant(csf.meta.title, 'expected a title property in csf.meta');
- const id = toId(csf.meta.id || csf.meta.title, name);
- entries.unshift({
- id,
- title: csf.meta.title,
- name,
- importPath,
- type: 'docs',
- tags: [
- ...componentTags,
- 'docs',
- ...(autodocsOptedIn && !componentAutodocs ? [AUTODOCS_TAG] : []),
- ],
- storiesImports: [],
- });
- }
- }
-
- return { entries, type: 'stories', dependents: [] } as StoriesCacheEntry;
- }
-
async extractDocs(specifier: NormalizedStoriesSpecifier, absolutePath: Path) {
const relativePath = path.relative(this.options.workingDir, absolutePath);
try {
diff --git a/code/lib/core-server/src/utils/__mockdata__/src/nested/Page.stories.mdx b/code/lib/core-server/src/utils/__mockdata__/src/nested/Page.stories.mdx
deleted file mode 100644
index 402d2a302ec..00000000000
--- a/code/lib/core-server/src/utils/__mockdata__/src/nested/Page.stories.mdx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { Meta, Story } from '@storybook/addon-docs';
-
-
-
-
diff --git a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts
index 360a687eaae..451a350755b 100644
--- a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts
+++ b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts
@@ -15,7 +15,6 @@ vi.mock('@storybook/node-logger');
const options: StoryIndexGeneratorOptions = {
configDir: path.join(__dirname, '..', '__mockdata__'),
workingDir: path.join(__dirname, '..', '__mockdata__'),
- storyIndexers: [],
indexers: [],
storyStoreV7: true,
docs: { defaultName: 'docs', autodocs: false },
@@ -604,53 +603,4 @@ describe('docs entries from story extraction', () => {
}
`);
});
- it(`Only adds a docs entry and not a story entry when an input has the "docsOnly" tag`, async () => {
- const relativePath = './src/nested/Page.stories.mdx';
- const absolutePath = path.join(options.workingDir, relativePath);
- const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(relativePath, options);
-
- const generator = new StoryIndexGenerator([specifier], {
- ...options,
- docs: { defaultName: 'docs', autodocs: false },
- indexers: [
- {
- test: /\.stories\.mdx?$/,
- createIndex: async (fileName) => [
- {
- exportName: '__page',
- __id: 'page--page',
- name: 'Page',
- title: 'Page',
- tags: [STORIES_MDX_TAG, 'stories-mdx-docsOnly'],
- importPath: fileName,
- type: 'story',
- },
- ],
- },
- ],
- });
- const result = await generator.extractStories(specifier, absolutePath);
-
- expect(result).toMatchInlineSnapshot(`
- {
- "dependents": [],
- "entries": [
- {
- "id": "page--docs",
- "importPath": "./src/nested/Page.stories.mdx",
- "name": "docs",
- "storiesImports": [],
- "tags": [
- "stories-mdx",
- "stories-mdx-docsOnly",
- "docs",
- ],
- "title": "Page",
- "type": "docs",
- },
- ],
- "type": "stories",
- }
- `);
- });
});
diff --git a/code/lib/core-server/src/utils/copy-all-static-files.ts b/code/lib/core-server/src/utils/copy-all-static-files.ts
index 44f7bf12d31..5b0fb522735 100644
--- a/code/lib/core-server/src/utils/copy-all-static-files.ts
+++ b/code/lib/core-server/src/utils/copy-all-static-files.ts
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import fs from 'fs-extra';
-import path from 'path';
+import { join, relative } from 'path';
import { logger } from '@storybook/node-logger';
import { getDirectoryFromWorkingDir } from '@storybook/core-common';
import { parseStaticDir } from './server-statics';
@@ -11,11 +11,19 @@ export async function copyAllStaticFiles(staticDirs: any[] | undefined, outputDi
staticDirs.map(async (dir) => {
try {
const { staticDir, staticPath, targetDir } = await parseStaticDir(dir);
- const targetPath = path.join(outputDir, targetDir);
- logger.info(chalk`=> Copying static files: {cyan ${staticDir}} => {cyan ${targetDir}}`);
+ const targetPath = join(outputDir, targetDir);
+
+ // we copy prebuild static files from node_modules/@storybook/manager & preview
+ if (!staticDir.includes('node_modules')) {
+ logger.info(
+ chalk`=> Copying static files: {cyan ${print(staticDir)}} => {cyan ${print(
+ targetDir
+ )}}`
+ );
+ }
// Storybook's own files should not be overwritten, so we skip such files if we find them
- const skipPaths = ['index.html', 'iframe.html'].map((f) => path.join(targetPath, f));
+ const skipPaths = ['index.html', 'iframe.html'].map((f) => join(targetPath, f));
await fs.copy(staticPath, targetPath, {
dereference: true,
preserveTimestamps: true,
@@ -49,9 +57,13 @@ export async function copyAllStaticFilesRelativeToMain(
})
);
- const targetPath = path.join(outputDir, to);
- const skipPaths = ['index.html', 'iframe.html'].map((f) => path.join(targetPath, f));
- logger.info(chalk`=> Copying static files: {cyan ${from}} at {cyan ${targetPath}}`);
+ const targetPath = join(outputDir, to);
+ const skipPaths = ['index.html', 'iframe.html'].map((f) => join(targetPath, f));
+ if (!from.includes('node_modules')) {
+ logger.info(
+ chalk`=> Copying static files: {cyan ${print(from)}} at {cyan ${print(targetPath)}}`
+ );
+ }
await fs.copy(from, targetPath, {
dereference: true,
preserveTimestamps: true,
@@ -59,3 +71,6 @@ export async function copyAllStaticFilesRelativeToMain(
});
}, Promise.resolve());
}
+function print(p: string): string {
+ return relative(process.cwd(), p);
+}
diff --git a/code/lib/core-server/src/utils/getStoryIndexGenerator.ts b/code/lib/core-server/src/utils/getStoryIndexGenerator.ts
index 74401020256..078ddcb012d 100644
--- a/code/lib/core-server/src/utils/getStoryIndexGenerator.ts
+++ b/code/lib/core-server/src/utils/getStoryIndexGenerator.ts
@@ -10,7 +10,6 @@ export async function getStoryIndexGenerator(
buildStoriesJson?: boolean;
storyStoreV7?: boolean;
argTypeTargetsV7?: boolean;
- warnOnLegacyHierarchySeparator?: boolean;
},
options: Options,
serverChannel: ServerChannel
@@ -24,14 +23,12 @@ export async function getStoryIndexGenerator(
workingDir,
};
const stories = options.presets.apply('stories');
- const deprecatedStoryIndexers = options.presets.apply('storyIndexers', []);
const indexers = options.presets.apply('experimental_indexers', []);
const docsOptions = options.presets.apply('docs', {});
const normalizedStories = normalizeStories(await stories, directories);
const generator = new StoryIndexGenerator(normalizedStories, {
...directories,
- storyIndexers: await deprecatedStoryIndexers,
indexers: await indexers,
docs: await docsOptions,
workingDir,
diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts
index 386db92d143..2a0b93e1ca4 100644
--- a/code/lib/core-server/src/utils/server-statics.ts
+++ b/code/lib/core-server/src/utils/server-statics.ts
@@ -1,28 +1,20 @@
import { logger } from '@storybook/node-logger';
import type { Options } from '@storybook/types';
import { getDirectoryFromWorkingDir } from '@storybook/core-common';
-import { ConflictingStaticDirConfigError } from '@storybook/core-events/server-errors';
import chalk from 'chalk';
import type { Router } from 'express';
import express from 'express';
import { pathExists } from 'fs-extra';
import path, { basename, isAbsolute } from 'path';
-import isEqual from 'lodash/isEqual.js';
import { dedent } from 'ts-dedent';
-import { defaultStaticDirs } from './constants';
export async function useStatics(router: Router, options: Options) {
const staticDirs = (await options.presets.apply('staticDirs')) ?? [];
const faviconPath = await options.presets.apply('favicon');
- if (options.staticDir && !isEqual(staticDirs, defaultStaticDirs)) {
- throw new ConflictingStaticDirConfigError();
- }
-
const statics = [
...staticDirs.map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`)),
- ...(options.staticDir || []),
];
if (statics && statics.length > 0) {
@@ -77,7 +69,7 @@ export const parseStaticDir = async (arg: string) => {
throw new Error(
dedent(chalk`
Failed to load static files, no such directory: {cyan ${staticPath}}
- Make sure this directory exists, or omit the {bold -s (--static-dir)} option.
+ Make sure this directory exists.
`)
);
}
diff --git a/code/lib/core-server/src/utils/stories-json.test.ts b/code/lib/core-server/src/utils/stories-json.test.ts
index 197f630eddf..8d1849e4038 100644
--- a/code/lib/core-server/src/utils/stories-json.test.ts
+++ b/code/lib/core-server/src/utils/stories-json.test.ts
@@ -4,8 +4,6 @@ import type { Router, Request, Response } from 'express';
import Watchpack from 'watchpack';
import path from 'path';
import debounce from 'lodash/debounce.js';
-// @ts-expect-error -- cannot find declaration file
-import { createStoriesMdxIndexer } from '@storybook/addon-docs/preset';
import { STORY_INDEX_INVALIDATED } from '@storybook/core-events';
import { normalizeStoriesEntry } from '@storybook/core-common';
@@ -44,8 +42,7 @@ const getInitializedStoryIndexGenerator = async (
inputNormalizedStories = normalizedStories
) => {
const options: StoryIndexGeneratorOptions = {
- storyIndexers: [],
- indexers: [csfIndexer, createStoriesMdxIndexer(false)],
+ indexers: [csfIndexer],
configDir: workingDir,
workingDir,
storyStoreV7: true,
@@ -239,29 +236,6 @@ describe('useStoriesJson', () => {
"title": "nested/Button",
"type": "story",
},
- "nested-page--docs": {
- "id": "nested-page--docs",
- "importPath": "./src/nested/Page.stories.mdx",
- "name": "docs",
- "storiesImports": [],
- "tags": [
- "stories-mdx",
- "docs",
- ],
- "title": "nested/Page",
- "type": "docs",
- },
- "nested-page--story-one": {
- "id": "nested-page--story-one",
- "importPath": "./src/nested/Page.stories.mdx",
- "name": "StoryOne",
- "tags": [
- "stories-mdx",
- "story",
- ],
- "title": "nested/Page",
- "type": "story",
- },
"second-nested-g--story-one": {
"id": "second-nested-g--story-one",
"importPath": "./src/second-nested/G.stories.ts",
diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json
index cdc7af4d91d..a3dc0ce82f6 100644
--- a/code/lib/core-webpack/package.json
+++ b/code/lib/core-webpack/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core-webpack",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json
index c5a678fc825..b3769a22ca3 100644
--- a/code/lib/csf-plugin/package.json
+++ b/code/lib/csf-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/csf-plugin",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Enrich CSF files via static analysis",
"keywords": [
"storybook"
diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json
index 9fac705c176..4da5a9f0429 100644
--- a/code/lib/csf-tools/package.json
+++ b/code/lib/csf-tools/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/csf-tools",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Parse and manipulate CSF and Storybook config files",
"keywords": [
"storybook"
diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts
index 74b9676f3f9..c503cf79567 100644
--- a/code/lib/csf-tools/src/CsfFile.test.ts
+++ b/code/lib/csf-tools/src/CsfFile.test.ts
@@ -5,8 +5,8 @@ import yaml from 'js-yaml';
import { loadCsf } from './CsfFile';
expect.addSnapshotSerializer({
- print: (val: any) => yaml.dump(typeof val === 'string' ? val : val.toString()).trimEnd(),
- test: (val) => typeof val !== 'string',
+ print: (val: any) => yaml.dump(val).trimEnd(),
+ test: (val) => typeof val !== 'string' && !(val instanceof Error),
});
const makeTitle = (userTitle?: string) => {
@@ -33,7 +33,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--a
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--b
+ `);
});
it('exported const stories', () => {
@@ -47,7 +61,19 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __id: foo-bar--a
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __id: foo-bar--b
+ `);
});
it('underscores', () => {
@@ -59,7 +85,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--basic
+ name: Basic
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--basic
+ `);
});
it('exclude stories', () => {
@@ -72,7 +107,16 @@ describe('CsfFile', () => {
export const C = () => {};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ excludeStories:
+ - B
+ - C
+ stories:
+ - id: foo-bar--a
+ name: A
+ `);
});
it('include stories', () => {
@@ -84,7 +128,15 @@ describe('CsfFile', () => {
export const IncludeA = () => {};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ includeStories:
+ - IncludeA
+ stories:
+ - id: foo-bar--include-a
+ name: Include A
+ `);
});
it('storyName annotation', () => {
@@ -96,7 +148,13 @@ describe('CsfFile', () => {
A.storyName = 'Some story';
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: Some story
+ `);
});
it('no title', () => {
@@ -108,7 +166,16 @@ describe('CsfFile', () => {
export const B = () => {};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ component: '''foo'''
+ title: Default Title
+ stories:
+ - id: default-title--a
+ name: A
+ - id: default-title--b
+ name: B
+ `);
});
it('custom component id', () => {
@@ -120,7 +187,16 @@ describe('CsfFile', () => {
export const B = () => {};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ id: custom-id
+ stories:
+ - id: custom-id--a
+ name: A
+ - id: custom-id--b
+ name: B
+ `);
});
it('custom parameters.__id', () => {
@@ -132,7 +208,16 @@ describe('CsfFile', () => {
export const CustomParemetersId = { parameters: { __id: 'custom-id' } };
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ id: custom-meta-id
+ stories:
+ - id: custom-meta-id--just-custom-meta-id
+ name: Just Custom Meta Id
+ - id: custom-id
+ name: Custom Paremeters Id
+ `);
});
it('typescript', () => {
@@ -146,7 +231,15 @@ describe('CsfFile', () => {
export const B: StoryFn = () => <>B>;
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar/baz
+ stories:
+ - id: foo-bar-baz--a
+ name: A
+ - id: foo-bar-baz--b
+ name: B
+ `);
});
it('typescript satisfies', () => {
@@ -161,7 +254,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: AA
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--b
+ `);
});
it('typescript as', () => {
@@ -176,7 +283,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: AA
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--b
+ `);
});
it('typescript meta var', () => {
@@ -191,7 +312,15 @@ describe('CsfFile', () => {
export const B: StoryFn = () => <>B>;
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar/baz
+ stories:
+ - id: foo-bar-baz--a
+ name: A
+ - id: foo-bar-baz--b
+ name: B
+ `);
});
it('typescript satisfies meta var', () => {
@@ -206,7 +335,15 @@ describe('CsfFile', () => {
export const B: StoryFn = () => <>B>;
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar/baz
+ stories:
+ - id: foo-bar-baz--a
+ name: A
+ - id: foo-bar-baz--b
+ name: B
+ `);
});
it('component object', () => {
@@ -218,7 +355,16 @@ describe('CsfFile', () => {
export const B = () => {};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ component: '{}'
+ title: Default Title
+ stories:
+ - id: default-title--a
+ name: A
+ - id: default-title--b
+ name: B
+ `);
});
it('template bind', () => {
@@ -232,7 +378,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ `);
});
it('meta variable', () => {
@@ -245,7 +400,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--a
+ `);
});
it('docs-only story', () => {
@@ -258,7 +422,17 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--page
+ name: Page
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--page
+ docsOnly: true
+ `);
});
it('docs-only story with local vars', () => {
@@ -274,7 +448,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - stories-mdx
+ includeStories:
+ - __page
+ stories:
+ - id: foo-bar--page
+ name: Page
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--page
+ docsOnly: true
+ `);
});
it('title variable', () => {
@@ -288,7 +476,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--a
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--b
+ `);
});
it('re-exported stories', () => {
@@ -300,7 +502,15 @@ describe('CsfFile', () => {
export { B } from './B';
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ - id: foo-bar--b
+ name: B
+ `);
});
it('named exports order', () => {
@@ -314,7 +524,21 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--b
+ name: B
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--b
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--a
+ `);
});
it('as default export', () => {
@@ -330,7 +554,15 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __id: foo-bar--a
+ `);
});
it('support for parameter decorators', () => {
@@ -353,7 +585,11 @@ describe('CsfFile', () => {
title: 'Chip',
}
`)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: Chip
+ stories: []
+ `);
});
});
@@ -429,7 +665,15 @@ describe('CsfFile', () => {
export function B() {}
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ - id: foo-bar--b
+ name: B
+ `);
});
});
@@ -488,7 +732,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: false
+ __id: foo-bar--a
+ `);
});
it('Object export with args render', () => {
@@ -502,7 +755,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ `);
});
it('Object export with default render', () => {
@@ -514,7 +776,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: A
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ `);
});
it('Object export with name', () => {
@@ -528,7 +799,16 @@ describe('CsfFile', () => {
`,
true
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ stories:
+ - id: foo-bar--a
+ name: Apple
+ parameters:
+ __isArgsStory: true
+ __id: foo-bar--a
+ `);
});
it('Object export with storyName', () => {
@@ -559,7 +839,10 @@ describe('CsfFile', () => {
export default { title: 'foo/bar', x: 1, y: 2 };
`;
const csf = loadCsf(input, { makeTitle }).parse();
- expect(csf.imports).toMatchInlineSnapshot(`./Button,./Check`);
+ expect(csf.imports).toMatchInlineSnapshot(`
+ - ./Button
+ - ./Check
+ `);
});
// eslint-disable-next-line jest/no-disabled-tests
it.skip('dynamic imports', () => {
@@ -591,7 +874,17 @@ describe('CsfFile', () => {
A.tags = ['Y'];
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ `);
});
it('csf3', () => {
@@ -605,7 +898,17 @@ describe('CsfFile', () => {
};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ `);
});
it('variables', () => {
@@ -621,7 +924,17 @@ describe('CsfFile', () => {
};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ `);
});
it('array error', () => {
@@ -662,7 +975,18 @@ describe('CsfFile', () => {
A.tags = ['Y'];
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ - play-fn
+ `);
});
it('story csf3', () => {
@@ -677,7 +1001,18 @@ describe('CsfFile', () => {
};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ - play-fn
+ `);
});
it('meta csf2', () => {
@@ -691,7 +1026,18 @@ describe('CsfFile', () => {
};
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ - play-fn
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ `);
});
it('meta csf3', () => {
@@ -703,7 +1049,18 @@ describe('CsfFile', () => {
A.tags = ['Y'];
`
)
- ).toMatchInlineSnapshot(`'[object Object]'`);
+ ).toMatchInlineSnapshot(`
+ meta:
+ title: foo/bar
+ tags:
+ - X
+ - play-fn
+ stories:
+ - id: foo-bar--a
+ name: A
+ tags:
+ - 'Y'
+ `);
});
});
@@ -730,7 +1087,30 @@ describe('CsfFile', () => {
{ makeTitle, fileName: 'foo/bar.stories.js' }
).parse();
- expect(indexInputs).toMatchInlineSnapshot(`'[object Object],[object Object]'`);
+ expect(indexInputs).toMatchInlineSnapshot(`
+ - type: story
+ importPath: foo/bar.stories.js
+ exportName: A
+ name: A
+ title: custom foo title
+ metaId: component-id
+ tags:
+ - component-tag
+ - story-tag
+ - play-fn
+ __id: component-id--a
+ - type: story
+ importPath: foo/bar.stories.js
+ exportName: B
+ name: B
+ title: custom foo title
+ metaId: component-id
+ tags:
+ - component-tag
+ - story-tag
+ - play-fn
+ __id: component-id--b
+ `);
});
it('supports custom parameters.__id', () => {
@@ -749,7 +1129,17 @@ describe('CsfFile', () => {
{ makeTitle, fileName: 'foo/bar.stories.js' }
).parse();
- expect(indexInputs).toMatchInlineSnapshot(`'[object Object]'`);
+ expect(indexInputs).toMatchInlineSnapshot(`
+ - type: story
+ importPath: foo/bar.stories.js
+ exportName: A
+ name: A
+ title: custom foo title
+ metaId: component-id
+ tags:
+ - component-tag
+ __id: custom-story-id
+ `);
});
it('removes duplicate tags', () => {
@@ -767,7 +1157,20 @@ describe('CsfFile', () => {
{ makeTitle, fileName: 'foo/bar.stories.js' }
).parse();
- expect(indexInputs).toMatchInlineSnapshot(`'[object Object]'`);
+ expect(indexInputs).toMatchInlineSnapshot(`
+ - type: story
+ importPath: foo/bar.stories.js
+ exportName: A
+ name: A
+ title: custom foo title
+ tags:
+ - component-tag
+ - component-tag-dup
+ - inherit-tag-dup
+ - story-tag
+ - story-tag-dup
+ __id: custom-foo-title--a
+ `);
});
it('throws if getting indexInputs without filename option', () => {
@@ -786,13 +1189,9 @@ describe('CsfFile', () => {
).parse();
expect(() => csf.indexInputs).toThrowErrorMatchingInlineSnapshot(`
- >-
- Error: Cannot automatically create index inputs with CsfFile.indexInputs
- because the CsfFile instance was created without a the fileName option.
-
- Either add the fileName option when creating the CsfFile instance, or create
- the index inputs manually.
-`);
+ [Error: Cannot automatically create index inputs with CsfFile.indexInputs because the CsfFile instance was created without a the fileName option.
+ Either add the fileName option when creating the CsfFile instance, or create the index inputs manually.]
+ `);
});
});
});
diff --git a/code/lib/csf-tools/src/enrichCsf.test.ts b/code/lib/csf-tools/src/enrichCsf.test.ts
index d9871e93522..562cacd8c04 100644
--- a/code/lib/csf-tools/src/enrichCsf.test.ts
+++ b/code/lib/csf-tools/src/enrichCsf.test.ts
@@ -641,7 +641,7 @@ describe('enrichCsf', () => {
title: 'Button',
parameters: {
foo: 'bar',
- docs: { inlineStories: true }
+ docs: { story: { inline: true } }
}
}
export const Basic = () => React.createElement(Button);
@@ -652,7 +652,7 @@ describe('enrichCsf', () => {
title: 'Button',
parameters: {
foo: 'bar',
- docs: { inlineStories: true }
+ docs: { story: { inline: true } }
}
}
export const Basic = () =>
@@ -665,7 +665,9 @@ describe('enrichCsf', () => {
parameters: {
foo: 'bar',
docs: {
- inlineStories: true,
+ story: {
+ inline: true
+ },
description: {
component: "The most basic button"
}
diff --git a/code/lib/csf-tools/src/getStorySortParameter.test.ts b/code/lib/csf-tools/src/getStorySortParameter.test.ts
index 4d6a8b8cc81..bd34207de7c 100644
--- a/code/lib/csf-tools/src/getStorySortParameter.test.ts
+++ b/code/lib/csf-tools/src/getStorySortParameter.test.ts
@@ -292,7 +292,6 @@ export default {
expect(
getStorySortParameter(dedent`
const config = {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
@@ -310,7 +309,6 @@ export default {
expect(
getStorySortParameter(dedent`
const parameters = {
- actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json
index 183f4409000..c623f5ad7f4 100644
--- a/code/lib/docs-tools/package.json
+++ b/code/lib/docs-tools/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/docs-tools",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Shared utility functions for frameworks to implement docs",
"keywords": [
"storybook"
diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json
index 7b959d261b6..3dc3263f781 100644
--- a/code/lib/instrumenter/package.json
+++ b/code/lib/instrumenter/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/instrumenter",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/instrumenter/src/instrumenter.test.ts b/code/lib/instrumenter/src/instrumenter.test.ts
index a2266ba8ac8..980c930ab3b 100644
--- a/code/lib/instrumenter/src/instrumenter.test.ts
+++ b/code/lib/instrumenter/src/instrumenter.test.ts
@@ -1,7 +1,6 @@
/* eslint-disable no-underscore-dangle */
import { addons, mockChannel } from '@storybook/preview-api';
import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
-import { logger } from '@storybook/client-logger';
import {
FORCE_REMOUNT,
SET_CURRENT_STORY,
@@ -418,23 +417,23 @@ describe('Instrumenter', () => {
);
});
- it('catches thrown errors and throws an ignoredException instead', () => {
+ it('rethrows errors', () => {
const { fn } = instrument({
fn: () => {
throw new Error('Boom!');
},
});
- expect(fn).toThrow('ignoredException');
+ expect(fn).toThrow('Boom!');
});
- it('catches nested exceptions and throws an ignoredException instead', () => {
+ it('catches nested exceptions and rethrows', () => {
const { fn1, fn2 } = instrument({
fn1: (_: any) => {},
fn2: () => {
throw new Error('Boom!');
},
});
- expect(() => fn1(fn2())).toThrow('ignoredException');
+ expect(() => fn1(fn2())).toThrow('Boom!');
});
it('bubbles child exceptions up to parent (in callback)', () => {
@@ -448,15 +447,19 @@ describe('Instrumenter', () => {
vi.spyOn(instrumented, 'fn1');
const { fn1, fn2 } = instrumented;
- expect(() =>
+ let error;
+ try {
fn1(() => {
fn2();
- })
- ).toThrow('ignoredException');
+ });
+ } catch (e) {
+ error = e;
+ }
expect(fn1).toHaveBeenCalled();
- expect(logger.warn).toHaveBeenCalledWith(new Error('Boom!'));
- expect((logger.warn as any).mock.calls[0][0].callId).toBe('kind--story [0] fn1 [0] fn2');
+ expect(error).toEqual(new Error('Boom!'));
+ // @ts-expect-error callId is what is tested
+ expect(error.callId).toBe('kind--story [0] fn1 [0] fn2');
});
it("re-throws anything that isn't an error", () => {
diff --git a/code/lib/instrumenter/src/instrumenter.ts b/code/lib/instrumenter/src/instrumenter.ts
index 51d6989a9c7..ef171b4bcd0 100644
--- a/code/lib/instrumenter/src/instrumenter.ts
+++ b/code/lib/instrumenter/src/instrumenter.ts
@@ -2,11 +2,10 @@
import type { Channel } from '@storybook/channels';
import { addons } from '@storybook/preview-api';
import type { StoryId } from '@storybook/types';
-import { once, logger } from '@storybook/client-logger';
+import { once } from '@storybook/client-logger';
import './typings.d.ts';
import {
FORCE_REMOUNT,
- IGNORED_EXCEPTION,
SET_CURRENT_STORY,
STORY_RENDER_PHASE_CHANGED,
} from '@storybook/core-events';
@@ -403,10 +402,6 @@ export class Instrumenter {
}
invoke(fn: Function, object: Record, call: Call, options: Options) {
- // TODO this doesnt work because the abortSignal we have here is the newly created one
- // const { abortSignal } = global.window.__STORYBOOK_PREVIEW__ || {};
- // if (abortSignal && abortSignal.aborted) throw IGNORED_EXCEPTION;
-
const { callRefsByResult, renderPhase } = this.getState(call.storyId);
// Map complex values to a JSON-serializable representation.
@@ -475,7 +470,7 @@ export class Instrumenter {
diff = undefined,
actual = undefined,
expected = undefined,
- } = processError(e);
+ } = e.name === 'AssertionError' ? processError(e) : e;
const exception = { name, message, stack, callId, showDiff, diff, actual, expected };
this.update({ ...info, status: CallStates.ERROR, exception });
@@ -495,13 +490,6 @@ export class Instrumenter {
}
throw e;
}
-
- // We need to throw to break out of the play function, but we don't want to trigger a redbox
- // so we throw an ignoredException, which is caught and silently ignored by Storybook.
- if (e !== alreadyCompletedException) {
- logger.warn(e);
- throw IGNORED_EXCEPTION;
- }
}
throw e;
};
diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json
index 749e3cee113..84b5a21eea9 100644
--- a/code/lib/manager-api/package.json
+++ b/code/lib/manager-api/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/manager-api",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook Manager API & Context",
"keywords": [
"storybook"
@@ -54,7 +54,6 @@
"dequal": "^2.0.2",
"lodash": "^4.17.21",
"memoizerific": "^1.11.3",
- "semver": "^7.3.7",
"store2": "^2.14.2",
"telejson": "^7.2.0",
"ts-dedent": "^2.0.0"
@@ -63,10 +62,12 @@
"@jest/globals": "^29.3.1",
"@types/lodash": "^4.14.167",
"@types/qs": "^6",
+ "@types/semver": "^7.3.4",
"flush-promises": "^1.0.2",
"qs": "^6.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "semver": "^7.3.7",
"typescript": "^5.3.2"
},
"publishConfig": {
diff --git a/code/lib/manager-api/src/modules/channel.ts b/code/lib/manager-api/src/modules/channel.ts
index 0ab1dc91008..64df9b32a4c 100644
--- a/code/lib/manager-api/src/modules/channel.ts
+++ b/code/lib/manager-api/src/modules/channel.ts
@@ -1,5 +1,4 @@
/* eslint-disable no-param-reassign */
-import { STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL } from '@storybook/core-events';
import type { Listener } from '@storybook/channels';
import type { API_Provider } from '@storybook/types';
@@ -38,16 +37,6 @@ export interface SubAPI {
* @param handler - The callback function to be called when the event is emitted.
*/
once: (type: string, handler: Listener) => void;
- /**
- * Emits an event to collapse all stories in the UI.
- * @deprecated Use `emit(STORIES_COLLAPSE_ALL)` instead. This API will be removed in Storybook 8.0.
- */
- collapseAll: () => void;
- /**
- * Emits an event to expand all stories in the UI.
- * @deprecated Use `emit(STORIES_EXPAND_ALL)` instead. This API will be removed in Storybook 8.0.
- */
- expandAll: () => void;
}
export type SubState = Record;
@@ -75,12 +64,6 @@ export const init: ModuleFn = ({ provider }) => {
}
provider.channel?.emit(type, data, ...args);
},
- collapseAll: () => {
- api.emit(STORIES_COLLAPSE_ALL, {});
- },
- expandAll: () => {
- api.emit(STORIES_EXPAND_ALL);
- },
};
return { api, state: {} };
};
diff --git a/code/lib/manager-api/src/modules/settings.ts b/code/lib/manager-api/src/modules/settings.ts
index aa4924474cd..34a06c6c6dc 100644
--- a/code/lib/manager-api/src/modules/settings.ts
+++ b/code/lib/manager-api/src/modules/settings.ts
@@ -19,13 +19,6 @@ export interface SubAPI {
* @returns A boolean indicating whether the settings screen is active.
*/
isSettingsScreenActive: () => boolean;
- /**
- * Navigates to the specified settings page.
- * @param path - The path of the settings page to navigate to. The path should include the `/settings` prefix.
- * @example navigateToSettingsPage(`/settings/about`).
- * @deprecated Use `changeSettingsTab` instead.
- */
- navigateToSettingsPage: (path: string) => Promise;
}
export interface SubState {
@@ -53,17 +46,6 @@ export const init: ModuleFn = ({ store, navigate, fullAPI }):
navigate(`/settings/${path}`);
},
isSettingsScreenActive,
- navigateToSettingsPage: async (path) => {
- if (!isSettingsScreenActive()) {
- const { settings, storyId } = store.getState();
-
- await store.setState({
- settings: { ...settings, lastTrackedStoryId: storyId },
- });
- }
-
- navigate(path);
- },
retrieveSelection() {
const { settings } = store.getState();
diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts
index d8c01196cc9..12c1391d88a 100644
--- a/code/lib/manager-api/src/version.ts
+++ b/code/lib/manager-api/src/version.ts
@@ -1 +1 @@
-export const version = '8.0.0-alpha.4';
+export const version = '8.0.0-alpha.8';
diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json
index 0665c34bb0b..73e1e9f5c26 100644
--- a/code/lib/node-logger/package.json
+++ b/code/lib/node-logger/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/node-logger",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json
index 79b6f15a5af..5eef064e569 100644
--- a/code/lib/preview-api/package.json
+++ b/code/lib/preview-api/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preview-api",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts
index b3d7aa04bde..494ceec4c7a 100644
--- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts
+++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts
@@ -111,7 +111,9 @@ describe('PreviewWeb', () => {
await waitForRender();
expect(docsRoot.outerHTML).toMatchInlineSnapshot('"
INSIDE
"');
- });
+ // Extended timeout to try and avoid
+ // Error: Event was not emitted in time: storyRendered,docsRendered,storyThrewException,storyErrored,storyMissing
+ }, 10_000);
// TODO @tmeasday please help fixing this test
it.skip('sends docs rendering exceptions to showException', async () => {
diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts
index 84a5bd78252..79188c8c8d9 100644
--- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts
+++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts
@@ -12,7 +12,6 @@ import {
FORCE_REMOUNT,
FORCE_RE_RENDER,
GLOBALS_UPDATED,
- IGNORED_EXCEPTION,
PREVIEW_KEYDOWN,
RESET_STORY_ARGS,
SET_CURRENT_STORY,
@@ -130,6 +129,9 @@ beforeEach(() => {
projectAnnotations.decorators[0].mockClear();
docsRenderer.render.mockClear();
vi.mocked(logger.warn).mockClear();
+ // eslint-disable-next-line no-console
+ vi.mocked(console.error).mockReset();
+
mockStoryIndex.mockReset().mockReturnValue(storyIndex);
addons.setChannel(mockChannel as any);
@@ -629,24 +631,6 @@ describe('PreviewWeb', () => {
expect(mockChannel.emit).toHaveBeenCalledWith(STORY_RENDERED, 'component-one--a');
});
-
- it('does not show error display if the render function throws IGNORED_EXCEPTION', async () => {
- document.location.search = '?id=component-one--a';
- projectAnnotations.renderToCanvas.mockImplementation(() => {
- throw IGNORED_EXCEPTION;
- });
-
- const preview = new PreviewWeb();
- await preview.initialize({ importFn, getProjectAnnotations });
-
- await waitForRender();
-
- expect(mockChannel.emit).toHaveBeenCalledWith(
- STORY_THREW_EXCEPTION,
- serializeError(IGNORED_EXCEPTION)
- );
- expect(preview.view.showErrorDisplay).not.toHaveBeenCalled();
- });
});
describe('CSF docs entries', () => {
diff --git a/code/lib/preview-api/src/modules/preview-web/render/StoryRender.ts b/code/lib/preview-api/src/modules/preview-web/render/StoryRender.ts
index b50489ecb78..ad704d43382 100644
--- a/code/lib/preview-api/src/modules/preview-web/render/StoryRender.ts
+++ b/code/lib/preview-api/src/modules/preview-web/render/StoryRender.ts
@@ -1,3 +1,4 @@
+/* eslint-disable no-console */
import type {
Renderer,
RenderContext,
@@ -12,11 +13,11 @@ import type {
ViewMode,
} from '@storybook/types';
import type { Channel } from '@storybook/channels';
-import { logger } from '@storybook/client-logger';
import {
STORY_RENDER_PHASE_CHANGED,
STORY_RENDERED,
PLAY_FUNCTION_THREW_EXCEPTION,
+ UNHANDLED_ERRORS_WHILE_PLAYING,
} from '@storybook/core-events';
import type { StoryStore } from '../../store';
import type { Render, RenderType } from './Render';
@@ -218,22 +219,43 @@ export class StoryRender implements Render = new Set();
+ const onError = (event: ErrorEvent | PromiseRejectionEvent) =>
+ unhandledErrors.add('error' in event ? event.error : event.reason);
+
// The phase should be 'rendering' but it might be set to 'aborted' by another render cycle
if (this.renderOptions.autoplay && forceRemount && playFunction && this.phase !== 'errored') {
+ window.addEventListener('error', onError);
+ window.addEventListener('unhandledrejection', onError);
this.disableKeyListeners = true;
try {
await this.runPhase(abortSignal, 'playing', async () => {
await playFunction(renderContext.storyContext);
});
- await this.runPhase(abortSignal, 'played');
+ if (!ignoreUnhandledErrors && unhandledErrors.size > 0) {
+ await this.runPhase(abortSignal, 'errored');
+ } else {
+ await this.runPhase(abortSignal, 'played');
+ }
} catch (error) {
- logger.error(error);
await this.runPhase(abortSignal, 'errored', async () => {
this.channel.emit(PLAY_FUNCTION_THREW_EXCEPTION, serializeError(error));
});
if (this.story.parameters.throwPlayFunctionExceptions !== false) throw error;
+ console.error(error);
+ }
+ if (!ignoreUnhandledErrors && unhandledErrors.size > 0) {
+ this.channel.emit(
+ UNHANDLED_ERRORS_WHILE_PLAYING,
+ Array.from(unhandledErrors).map(serializeError)
+ );
}
this.disableKeyListeners = false;
+ window.removeEventListener('unhandledrejection', onError);
+ window.removeEventListener('error', onError);
if (abortSignal.aborted) return;
}
diff --git a/code/lib/preview-api/vitest.config.ts b/code/lib/preview-api/vitest.config.ts
index ddec70e554d..622642938f2 100644
--- a/code/lib/preview-api/vitest.config.ts
+++ b/code/lib/preview-api/vitest.config.ts
@@ -6,7 +6,7 @@ export default mergeConfig(
vitestCommonConfig,
defineConfig({
test: {
- environment: 'node',
+ environment: 'jsdom',
name: __dirname.split(sep).slice(-2).join(posix.sep),
},
})
diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json
index e915b1cf7e4..f7e34a1d9cd 100644
--- a/code/lib/preview/package.json
+++ b/code/lib/preview/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preview",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json
index bd3b107a83f..e13b5b2f3f9 100644
--- a/code/lib/react-dom-shim/package.json
+++ b/code/lib/react-dom-shim/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-dom-shim",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/router/package.json b/code/lib/router/package.json
index 08744e7192e..04883c6c9d8 100644
--- a/code/lib/router/package.json
+++ b/code/lib/router/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/router",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook Router",
"keywords": [
"storybook"
diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json
index ee5d0745df1..154007cfc6a 100644
--- a/code/lib/source-loader/package.json
+++ b/code/lib/source-loader/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/source-loader",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Source loader",
"keywords": [
"lib",
diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json
index 382868ca56c..877b60b0b3e 100644
--- a/code/lib/telemetry/package.json
+++ b/code/lib/telemetry/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/telemetry",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Telemetry logging for crash reports and usage statistics",
"keywords": [
"storybook"
diff --git a/code/lib/test/package.json b/code/lib/test/package.json
index ccbf58aea9a..15da6f44b61 100644
--- a/code/lib/test/package.json
+++ b/code/lib/test/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/test",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"
diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json
index 01cb4665f94..4c9a709946b 100644
--- a/code/lib/theming/package.json
+++ b/code/lib/theming/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/theming",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook Components",
"keywords": [
"storybook"
diff --git a/code/lib/types/package.json b/code/lib/types/package.json
index f96b1bacb75..082aa0769ac 100644
--- a/code/lib/types/package.json
+++ b/code/lib/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/types",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook TS Types",
"keywords": [
"storybook"
diff --git a/code/lib/types/src/modules/addons.ts b/code/lib/types/src/modules/addons.ts
index 6002d713e52..49d97e4c3a1 100644
--- a/code/lib/types/src/modules/addons.ts
+++ b/code/lib/types/src/modules/addons.ts
@@ -305,11 +305,6 @@ export type BaseStory =
export interface Addon_RenderOptions {
active: boolean;
- /**
- * @deprecated You should not use key anymore as of Storybook 7.2 this render method is invoked as a React component.
- * This property will be removed in 8.0.
- * */
- key?: unknown;
}
export type Addon_Type =
@@ -533,9 +528,4 @@ export enum Addon_TypesEnum {
* @unstable This will get replaced with a new API in 8.0, use at your own risk.
*/
experimental_SIDEBAR_TOP = 'sidebar-top',
-
- /**
- * @deprecated This property does nothing, and will be removed in Storybook 8.0.
- */
- NOTES_ELEMENT = 'notes-element',
}
diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts
index 53dcecdcc68..a189c8fe5f5 100644
--- a/code/lib/types/src/modules/core-common.ts
+++ b/code/lib/types/src/modules/core-common.ts
@@ -7,7 +7,7 @@ import type { Router } from 'express';
import type { Server } from 'http';
import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest';
-import type { StoriesEntry, Indexer, StoryIndexer } from './indexer';
+import type { StoriesEntry, Indexer } from './indexer';
/**
* ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now!
@@ -157,6 +157,7 @@ export interface LoadOptions {
packageJson: PackageJson;
outputDir?: string;
configDir?: string;
+ cacheKey?: string;
ignorePreview?: boolean;
extendServer?: (server: Server) => void;
}
@@ -171,10 +172,6 @@ export interface CLIOptions {
host?: string;
initialPath?: string;
exactPort?: boolean;
- /**
- * @deprecated Use 'staticDirs' Storybook Configuration option instead
- */
- staticDir?: string[];
configDir?: string;
https?: boolean;
sslCa?: string[];
@@ -374,12 +371,6 @@ export interface StorybookConfigRaw {
*/
argTypeTargetsV7?: boolean;
- /**
- * Warn when there is a pre-6.0 hierarchy separator ('.' / '|') in the story title.
- * Will be removed in 7.0.
- */
- warnOnLegacyHierarchySeparator?: boolean;
-
/**
* Use legacy MDX1, to help smooth migration to 7.0
*/
@@ -425,8 +416,6 @@ export interface StorybookConfigRaw {
previewAnnotations?: Entry[];
- storyIndexers?: StoryIndexer[];
-
experimental_indexers?: Indexer[];
docs?: DocsOptions;
@@ -518,12 +507,6 @@ export interface StorybookConfig {
*/
previewAnnotations?: PresetValue;
- /**
- * Process CSF files for the story index.
- * @deprecated use {@link experimental_indexers} instead
- */
- storyIndexers?: PresetValue;
-
/**
* Process CSF files for the story index.
*/
diff --git a/code/lib/types/src/modules/indexer.ts b/code/lib/types/src/modules/indexer.ts
index 4f0838bba05..56d435cdb53 100644
--- a/code/lib/types/src/modules/indexer.ts
+++ b/code/lib/types/src/modules/indexer.ts
@@ -67,22 +67,8 @@ export type Indexer = BaseIndexer & {
* @returns A promise that resolves to an array of {@link IndexInput} objects.
*/
createIndex: (fileName: string, options: IndexerOptions) => Promise;
- /**
- * @deprecated Use {@link index} instead
- */
- indexer?: never;
-};
-
-export type DeprecatedIndexer = BaseIndexer & {
- indexer: (fileName: string, options: IndexerOptions) => Promise;
- createIndex?: never;
};
-/**
- * @deprecated Use {@link Indexer} instead
- */
-export type StoryIndexer = Indexer | DeprecatedIndexer;
-
export interface BaseIndexEntry {
id: StoryId;
name: StoryName;
diff --git a/code/package.json b/code/package.json
index 2f60707b53b..1141320db2f 100644
--- a/code/package.json
+++ b/code/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/root",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"private": true,
"description": "Storybook root",
"homepage": "https://storybook.js.org/",
@@ -229,6 +229,7 @@
"react-dom": "^18.2.0",
"semver": "^7.3.7",
"serve-static": "^1.14.1",
+ "svelte": "^5.0.0-next.28",
"trash": "^7.0.0",
"ts-dedent": "^2.0.0",
"ts-node": "^10.9.1",
diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json
index 6257783889c..00e0c3ae3f6 100644
--- a/code/presets/create-react-app/package.json
+++ b/code/presets/create-react-app/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preset-create-react-app",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Create React App preset",
"keywords": [
"storybook"
@@ -53,6 +53,7 @@
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0",
"@storybook/types": "workspace:*",
"@types/babel__core": "^7.1.7",
+ "@types/semver": "^7.3.4",
"pnp-webpack-plugin": "^1.7.0",
"semver": "^7.3.5"
},
diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json
index f7bd2136473..79310af1d1e 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json
index 5337cd7fc1b..b037246b106 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json
index 5f53ffa47e3..3dedeab48ff 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading",
"keywords": [
"storybook"
diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json
index f6230eb9945..fb78b0d00d8 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json
index c600ccf2270..f026579c323 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json
index 81cf91bd55a..7ae5f8e5920 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json
index d81881d241c..2e87f7d3a20 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": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit",
diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json
index 932080a04f5..07796f7497f 100644
--- a/code/renderers/html/package.json
+++ b/code/renderers/html/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/html",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook HTML renderer",
"keywords": [
"storybook"
diff --git a/code/renderers/html/src/public-types.ts b/code/renderers/html/src/public-types.ts
index e0b41f5bc62..2dff13d9aa9 100644
--- a/code/renderers/html/src/public-types.ts
+++ b/code/renderers/html/src/public-types.ts
@@ -35,17 +35,6 @@ export type StoryFn = AnnotatedStoryFn;
*/
export type StoryObj = StoryAnnotations;
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
export type StoryContext = GenericStoryContext;
diff --git a/code/renderers/html/src/types.ts b/code/renderers/html/src/types.ts
index e8f264aed80..c6152653b11 100644
--- a/code/renderers/html/src/types.ts
+++ b/code/renderers/html/src/types.ts
@@ -14,10 +14,6 @@ export interface ShowErrorArgs {
description: string;
}
-/**
- * @deprecated Use `HtmlRenderer` instead.
- */
-export type HtmlFramework = HtmlRenderer;
export interface HtmlRenderer extends WebRenderer {
component: string | HTMLElement | ArgsStoryFn;
storyResult: StoryFnHtmlReturnType;
diff --git a/code/renderers/html/template/cli/js/Button.stories.js b/code/renderers/html/template/cli/js/Button.stories.js
index 81d0ba1fb15..5898325eb57 100644
--- a/code/renderers/html/template/cli/js/Button.stories.js
+++ b/code/renderers/html/template/cli/js/Button.stories.js
@@ -1,3 +1,4 @@
+import { fn } from '@storybook/test';
import { createButton } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -19,6 +20,8 @@ export default {
options: ['small', 'medium', 'large'],
},
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
diff --git a/code/renderers/html/template/cli/ts-3-8/Button.stories.ts b/code/renderers/html/template/cli/ts-3-8/Button.stories.ts
index f91d91ae731..90ce057cae5 100644
--- a/code/renderers/html/template/cli/ts-3-8/Button.stories.ts
+++ b/code/renderers/html/template/cli/ts-3-8/Button.stories.ts
@@ -1,4 +1,5 @@
import type { StoryObj, Meta } from '@storybook/html';
+import { fn } from '@storybook/test';
import type { ButtonProps } from './Button';
import { createButton } from './Button';
@@ -21,6 +22,8 @@ const meta: Meta = {
options: ['small', 'medium', 'large'],
},
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
export default meta;
diff --git a/code/renderers/html/template/cli/ts-3-8/Header.ts b/code/renderers/html/template/cli/ts-3-8/Header.ts
index 7bee7625965..5c6cec5c81b 100644
--- a/code/renderers/html/template/cli/ts-3-8/Header.ts
+++ b/code/renderers/html/template/cli/ts-3-8/Header.ts
@@ -3,9 +3,9 @@ import { createButton } from './Button';
export interface HeaderProps {
user?: { name: string };
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const createHeader = ({ user, onLogout, onLogin, onCreateAccount }: HeaderProps) => {
diff --git a/code/renderers/html/template/cli/ts-4-9/Button.stories.ts b/code/renderers/html/template/cli/ts-4-9/Button.stories.ts
index 2a86ecbec3b..a9a7ff7b3bc 100644
--- a/code/renderers/html/template/cli/ts-4-9/Button.stories.ts
+++ b/code/renderers/html/template/cli/ts-4-9/Button.stories.ts
@@ -1,4 +1,5 @@
import type { StoryObj, Meta } from '@storybook/html';
+import { fn } from '@storybook/test';
import type { ButtonProps } from './Button';
import { createButton } from './Button';
@@ -21,6 +22,8 @@ const meta = {
options: ['small', 'medium', 'large'],
},
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
} satisfies Meta;
export default meta;
diff --git a/code/renderers/html/template/cli/ts-4-9/Header.ts b/code/renderers/html/template/cli/ts-4-9/Header.ts
index 7bee7625965..5c6cec5c81b 100644
--- a/code/renderers/html/template/cli/ts-4-9/Header.ts
+++ b/code/renderers/html/template/cli/ts-4-9/Header.ts
@@ -3,9 +3,9 @@ import { createButton } from './Button';
export interface HeaderProps {
user?: { name: string };
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const createHeader = ({ user, onLogout, onLogin, onCreateAccount }: HeaderProps) => {
diff --git a/code/renderers/html/template/stories/html-mdx.stories.mdx b/code/renderers/html/template/stories/html-mdx.stories.mdx
deleted file mode 100644
index ec1e3ced3b6..00000000000
--- a/code/renderers/html/template/stories/html-mdx.stories.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Meta, Story, Canvas } from '@storybook/addon-docs';
-
-
-
-## HTML-specific MDX Stories
-
-
-
-
diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json
index b2674fdf89b..1329733fc1d 100644
--- a/code/renderers/preact/package.json
+++ b/code/renderers/preact/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook Preact renderer",
"keywords": [
"storybook"
diff --git a/code/renderers/preact/src/public-types.ts b/code/renderers/preact/src/public-types.ts
index b8f62d0dfca..bb0f10559e9 100644
--- a/code/renderers/preact/src/public-types.ts
+++ b/code/renderers/preact/src/public-types.ts
@@ -35,17 +35,6 @@ export type StoryFn = AnnotatedStoryFn;
*/
export type StoryObj = StoryAnnotations;
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
export type StoryContext = GenericStoryContext;
diff --git a/code/renderers/preact/src/types.ts b/code/renderers/preact/src/types.ts
index 233528349a1..1a8e545c854 100644
--- a/code/renderers/preact/src/types.ts
+++ b/code/renderers/preact/src/types.ts
@@ -10,13 +10,6 @@ export interface ShowErrorArgs {
description: string;
}
-/**
- * @dep
- */
-/**
- * @deprecated Use `PreactRenderer` instead.
- */
-export type PreactFramework = PreactRenderer;
export interface PreactRenderer extends WebRenderer {
component: AnyComponent;
storyResult: StoryFnPreactReturnType;
diff --git a/code/renderers/preact/template/cli/Button.stories.jsx b/code/renderers/preact/template/cli/Button.stories.jsx
index 53ce0d71dd4..5017c7144be 100644
--- a/code/renderers/preact/template/cli/Button.stories.jsx
+++ b/code/renderers/preact/template/cli/Button.stories.jsx
@@ -1,3 +1,4 @@
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -9,6 +10,8 @@ export default {
backgroundColor: { control: 'color' },
onClick: { action: 'onClick' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json
index 9ac2e9253e4..77b8bc412b1 100644
--- a/code/renderers/react/package.json
+++ b/code/renderers/react/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/react",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook React renderer",
"keywords": [
"storybook"
diff --git a/code/renderers/react/src/public-types.test.tsx b/code/renderers/react/src/public-types.test.tsx
index adf800d8528..2f112ec9f07 100644
--- a/code/renderers/react/src/public-types.test.tsx
+++ b/code/renderers/react/src/public-types.test.tsx
@@ -88,7 +88,7 @@ describe('Args can be provided in multiple ways', () => {
});
});
-it('✅ All void functions are optional', () => {
+it('✅ Void functions are not changed', () => {
interface CmpProps {
label: string;
disabled: boolean;
@@ -106,13 +106,16 @@ it('✅ All void functions are optional', () => {
});
const Basic: StoryObj = {
- args: { disabled: false, onLoading: () =>
,
+ onKeyDown: fn(),
+ onClick: fn(),
+ submitAction: fn(),
+ },
};
- type Expected = ReactStory<
- CmpProps,
- SetOptional
- >;
+ type Expected = ReactStory>;
expectTypeOf(Basic).toEqualTypeOf();
});
diff --git a/code/renderers/react/src/public-types.ts b/code/renderers/react/src/public-types.ts
index 95ad7111a3e..eaacc7fa14d 100644
--- a/code/renderers/react/src/public-types.ts
+++ b/code/renderers/react/src/public-types.ts
@@ -11,15 +11,13 @@ import type {
StrictArgs,
ProjectAnnotations,
} from '@storybook/types';
-import type { ComponentProps, ComponentType, JSXElementConstructor } from 'react';
+import type { ComponentProps, ComponentType } from 'react';
import type { SetOptional, Simplify } from 'type-fest';
import type { ReactRenderer } from './types';
export type { Args, ArgTypes, Parameters, StrictArgs } from '@storybook/types';
export type { ReactRenderer };
-type JSXElement = keyof JSX.IntrinsicElements | JSXElementConstructor;
-
/**
* Metadata to configure the stories for a component.
*
@@ -57,7 +55,7 @@ export type StoryObj = [TMetaOrCmpOrArgs] extends [
? StoryAnnotations<
ReactRenderer,
AddMocks,
- SetOptional)>
+ SetOptional
>
: never
: TMetaOrCmpOrArgs extends ComponentType
@@ -74,84 +72,6 @@ type AddMocks = Simplify<{
: TArgs[T];
}>;
-type ActionArgs = {
- // This can be read as: filter TArgs on functions where we can assign a void function to that function.
- // The docs addon argsEnhancers can only safely provide a default value for void functions.
- // Other kind of required functions should be provided by the user.
- [P in keyof TArgs as TArgs[P] extends (...args: any[]) => any
- ? ((...args: any[]) => void) extends TArgs[P]
- ? P
- : never
- : never]: TArgs[P];
-};
-
-/**
- * @deprecated Use `Meta` instead, e.g. ComponentMeta -> Meta.
- *
- * For the common case where a component's stories are simple components that receives args as props:
- *
- * ```tsx
- * export default { ... } as ComponentMeta;
- * ```
- */
-export type ComponentMeta = Meta>;
-
-/**
- * @deprecated Use `StoryFn` instead, e.g. ComponentStoryFn -> StoryFn.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * For the common case where a (CSFv2) story is a simple component that receives args as props:
- *
- * ```tsx
- * const Template: ComponentStoryFn = (args) =>
- * ```
- */
-export type ComponentStoryFn = StoryFn>;
-
-/**
- * @deprecated Use `StoryObj` instead, e.g. ComponentStoryObj -> StoryObj.
- *
- * For the common case where a (CSFv3) story is a simple component that receives args as props:
- *
- * ```tsx
- * const MyStory: ComponentStoryObj = {
- * args: { buttonArg1: 'val' },
- * }
- * ```
- */
-export type ComponentStoryObj = StoryObj>;
-
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
-/**
- * @deprecated Use `StoryFn` instead, e.g. ComponentStory -> StoryFn.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/.
- *
- * For the common case where a (CSFv3) story is a simple component that receives args as props:
- *
- * ```tsx
- * const MyStory: ComponentStory = {
- * args: { buttonArg1: 'val' },
- * }
- * ```
- */
-export type ComponentStory = ComponentStoryFn;
-
-/**
- * @deprecated Use Decorator instead.
- */
-export type DecoratorFn = DecoratorFunction;
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
export type StoryContext = GenericStoryContext;
diff --git a/code/renderers/react/src/testing-api.ts b/code/renderers/react/src/testing-api.ts
index 545147fab2d..385e0dc4c80 100644
--- a/code/renderers/react/src/testing-api.ts
+++ b/code/renderers/react/src/testing-api.ts
@@ -10,7 +10,6 @@ import type {
Store_CSFExports,
StoriesWithPartialProps,
} from '@storybook/types';
-import { deprecate } from '@storybook/client-logger';
import { render } from './render';
import type { Meta } from './public-types';
@@ -37,17 +36,6 @@ export function setProjectAnnotations(
originalSetProjectAnnotations(projectAnnotations);
}
-/** Preserved for users migrating from `@storybook/testing-react`.
- *
- * @deprecated Use setProjectAnnotations instead
- */
-export function setGlobalConfig(
- projectAnnotations: ProjectAnnotations | ProjectAnnotations[]
-) {
- deprecate(`setGlobalConfig is deprecated. Use setProjectAnnotations instead.`);
- setProjectAnnotations(projectAnnotations);
-}
-
// This will not be necessary once we have auto preset loading
const defaultProjectAnnotations: ProjectAnnotations = {
render,
diff --git a/code/renderers/react/src/types.ts b/code/renderers/react/src/types.ts
index 637f1b5a5eb..b90766013de 100644
--- a/code/renderers/react/src/types.ts
+++ b/code/renderers/react/src/types.ts
@@ -3,10 +3,6 @@ import type { WebRenderer } from '@storybook/types';
export type { RenderContext, StoryContext } from '@storybook/types';
-/**
- * @deprecated Use `ReactRenderer` instead.
- */
-export type ReactFramework = ReactRenderer;
export interface ReactRenderer extends WebRenderer {
component: ComponentType;
storyResult: StoryFnReactReturnType;
diff --git a/code/renderers/react/template/cli/js/Button.stories.js b/code/renderers/react/template/cli/js/Button.stories.js
index 3a3f67ec8fb..97b9ec0ed85 100644
--- a/code/renderers/react/template/cli/js/Button.stories.js
+++ b/code/renderers/react/template/cli/js/Button.stories.js
@@ -1,3 +1,4 @@
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
@@ -14,6 +15,8 @@ export default {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
diff --git a/code/renderers/react/template/cli/ts-3-8/Button.stories.ts b/code/renderers/react/template/cli/ts-3-8/Button.stories.ts
index b65080126a4..18be3ab1aa1 100644
--- a/code/renderers/react/template/cli/ts-3-8/Button.stories.ts
+++ b/code/renderers/react/template/cli/ts-3-8/Button.stories.ts
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
+import { fn } from '@storybook/test';
import { Button } from './Button';
@@ -16,6 +17,8 @@ const meta: Meta = {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
export default meta;
diff --git a/code/renderers/react/template/cli/ts-3-8/Header.tsx b/code/renderers/react/template/cli/ts-3-8/Header.tsx
index 01504601311..c806ddf023e 100644
--- a/code/renderers/react/template/cli/ts-3-8/Header.tsx
+++ b/code/renderers/react/template/cli/ts-3-8/Header.tsx
@@ -9,9 +9,9 @@ type User = {
interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
diff --git a/code/renderers/react/template/cli/ts-4-9/Button.stories.ts b/code/renderers/react/template/cli/ts-4-9/Button.stories.ts
index 742c3aa7b02..455a9d8601c 100644
--- a/code/renderers/react/template/cli/ts-4-9/Button.stories.ts
+++ b/code/renderers/react/template/cli/ts-4-9/Button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
-
+import { fn } from '@storybook/test';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
@@ -16,6 +16,8 @@ const meta = {
argTypes: {
backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
} satisfies Meta;
export default meta;
diff --git a/code/renderers/react/template/cli/ts-4-9/Header.tsx b/code/renderers/react/template/cli/ts-4-9/Header.tsx
index 01504601311..c806ddf023e 100644
--- a/code/renderers/react/template/cli/ts-4-9/Header.tsx
+++ b/code/renderers/react/template/cli/ts-4-9/Header.tsx
@@ -9,9 +9,9 @@ type User = {
interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
diff --git a/code/renderers/react/template/stories/react-mdx.stories.mdx b/code/renderers/react/template/stories/react-mdx.stories.mdx
deleted file mode 100644
index e8676a0e22d..00000000000
--- a/code/renderers/react/template/stories/react-mdx.stories.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { global as globalThis } from '@storybook/global';
-import { Meta, Story, Canvas } from '@storybook/addon-docs';
-
-
-
-# React-specific MDX Stories
-
-export const Button = globalThis.Components.Button;
-
-export const Template = (args) => ;
-
-
-
-
-
-
diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json
index 908b0fd9efb..ce81de49cdc 100644
--- a/code/renderers/server/package.json
+++ b/code/renderers/server/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/server",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook Server renderer",
"keywords": [
"storybook"
diff --git a/code/renderers/server/src/public-types.ts b/code/renderers/server/src/public-types.ts
index 17a947a51d3..5e36d7a6439 100644
--- a/code/renderers/server/src/public-types.ts
+++ b/code/renderers/server/src/public-types.ts
@@ -34,17 +34,6 @@ export type StoryFn = AnnotatedStoryFn;
*/
export type StoryObj = StoryAnnotations;
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
export type { ServerRenderer };
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
diff --git a/code/renderers/server/src/types.ts b/code/renderers/server/src/types.ts
index 4b562f771fb..c386ec965df 100644
--- a/code/renderers/server/src/types.ts
+++ b/code/renderers/server/src/types.ts
@@ -5,10 +5,6 @@ export type { RenderContext } from '@storybook/types';
export type StoryFnServerReturnType = any;
export type StoryContext = StoryContextBase;
-/**
- * @deprecated Use `ServerRenderer` instead.
- */
-export type ServerFramework = ServerRenderer;
export interface ServerRenderer extends WebRenderer {
component: string;
storyResult: StoryFnServerReturnType;
diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json
index 590a8154058..386a15f4d13 100644
--- a/code/renderers/svelte/package.json
+++ b/code/renderers/svelte/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook Svelte renderer",
"keywords": [
"storybook"
@@ -64,7 +64,7 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"expect-type": "^0.15.0",
- "svelte": "^5.0.0-next.22",
+ "svelte": "^5.0.0-next.28",
"svelte-check": "^3.6.1",
"typescript": "^5.3.2"
},
diff --git a/code/renderers/svelte/src/render.ts b/code/renderers/svelte/src/render.ts
index b1821b69235..05fc9daf852 100644
--- a/code/renderers/svelte/src/render.ts
+++ b/code/renderers/svelte/src/render.ts
@@ -36,7 +36,7 @@ function teardown(canvasElement: SvelteRenderer['canvasElement']) {
function createRoot(target: HTMLElement, props: any) {
if ((svelte as any).createRoot) {
// Svelte v5
- return svelte.createRoot(PreviewRender, {
+ return (svelte as any).createRoot(PreviewRender, {
target,
props,
});
diff --git a/code/renderers/svelte/template/cli/ts-3-8/Button.stories.ts b/code/renderers/svelte/template/cli/ts-3-8/Button.stories.ts
index 55f3b1c8e50..3db95e9d53f 100644
--- a/code/renderers/svelte/template/cli/ts-3-8/Button.stories.ts
+++ b/code/renderers/svelte/template/cli/ts-3-8/Button.stories.ts
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/svelte';
-
import Button from './Button.svelte';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
diff --git a/code/renderers/svelte/template/cli/ts-4-9/Button.stories.ts b/code/renderers/svelte/template/cli/ts-4-9/Button.stories.ts
index 119cb87f61d..1132dd8f75f 100644
--- a/code/renderers/svelte/template/cli/ts-4-9/Button.stories.ts
+++ b/code/renderers/svelte/template/cli/ts-4-9/Button.stories.ts
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/svelte';
-
import Button from './Button.svelte';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
diff --git a/code/renderers/svelte/template/stories/svelte-mdx.stories.mdx b/code/renderers/svelte/template/stories/svelte-mdx.stories.mdx
deleted file mode 100644
index 396812ea573..00000000000
--- a/code/renderers/svelte/template/stories/svelte-mdx.stories.mdx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { global as globalThis } from '@storybook/global';
-import { Meta, Story, Canvas } from '@storybook/addon-docs';
-import ButtonView from './views/ButtonJavaScript.svelte';
-import BorderDecoratorRed from './views/BorderDecoratorRed.svelte';
-
-
-
-# Svelte-specific MDX stories
-
-## Primary
-
-
-
-## Secondary
-
-
-
-
diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json
index 9fb1fe52e4c..f710f9a92c4 100644
--- a/code/renderers/vue3/package.json
+++ b/code/renderers/vue3/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue3",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook Vue 3 renderer",
"keywords": [
"storybook"
@@ -51,6 +51,7 @@
"@storybook/global": "^5.0.0",
"@storybook/preview-api": "workspace:*",
"@storybook/types": "workspace:*",
+ "@vue/compiler-core": "^3.0.0",
"lodash": "^4.17.21",
"ts-dedent": "^2.0.0",
"type-fest": "~2.19",
@@ -60,13 +61,11 @@
"@digitak/esrun": "^3.2.2",
"@types/prettier": "2.7.2",
"@vitejs/plugin-vue": "^4.4.0",
- "@vue/compiler-core": "^3.3.4",
"typescript": "^5.3.2",
"vue": "^3.2.47",
"vue-tsc": "latest"
},
"peerDependencies": {
- "@vue/compiler-core": "^3.0.0",
"vue": "^3.0.0"
},
"engines": {
diff --git a/code/renderers/vue3/src/public-types.ts b/code/renderers/vue3/src/public-types.ts
index 51e58dc0b08..2bc2653eb0c 100644
--- a/code/renderers/vue3/src/public-types.ts
+++ b/code/renderers/vue3/src/public-types.ts
@@ -74,17 +74,6 @@ type ComponentPropsOrProps = TCmpOrArgs extends Constructor
? ComponentPropsAndSlots
: TCmpOrArgs;
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
export type StoryContext = GenericStoryContext;
diff --git a/code/renderers/vue3/src/render.ts b/code/renderers/vue3/src/render.ts
index cf27f67357c..c7051ac847f 100644
--- a/code/renderers/vue3/src/render.ts
+++ b/code/renderers/vue3/src/render.ts
@@ -1,9 +1,10 @@
-/* eslint-disable local-rules/no-uncategorized-errors */
+/* eslint-disable local-rules/no-uncategorized-errors,no-underscore-dangle */
/* eslint-disable no-param-reassign */
import type { App } from 'vue';
-import { createApp, h, reactive, isVNode, isReactive } from 'vue';
+import { createApp, h, isReactive, isVNode, reactive } from 'vue';
import type { ArgsStoryFn, RenderContext } from '@storybook/types';
import type { Args, StoryContext } from '@storybook/csf';
+import type { PreviewWeb } from '@storybook/preview-api';
import type { StoryFnVueReturnType, StoryID, VueRenderer } from './types';
export const render: ArgsStoryFn = (props, context) => {
@@ -79,7 +80,22 @@ export async function renderToCanvas(
},
});
- vueApp.config.errorHandler = (e: unknown) => showException(e as Error);
+ vueApp.config.errorHandler = (e: unknown, instance, info) => {
+ const preview = (window as Record)
+ .__STORYBOOK_PREVIEW__ as PreviewWeb;
+ const isPlaying = preview?.storyRenders.some(
+ (renderer) => renderer.id === id && renderer.phase === 'playing'
+ );
+ // Errors thrown during playing need be shown in the interactions panel.
+ if (isPlaying) {
+ // Make sure that Vue won't swallow this error, by stacking it as a different event.
+ setTimeout(() => {
+ throw e;
+ }, 0);
+ } else {
+ showException(e as Error);
+ }
+ };
await runSetupFunctions(vueApp, storyContext);
vueApp.mount(canvasElement);
diff --git a/code/renderers/vue3/src/types.ts b/code/renderers/vue3/src/types.ts
index 1094f678062..dfa6bed7870 100644
--- a/code/renderers/vue3/src/types.ts
+++ b/code/renderers/vue3/src/types.ts
@@ -16,10 +16,6 @@ export type StoryContext = StoryContextBase;
export type StorybookVueApp = { vueApp: App; storyContext: StoryContext };
-/**
- * @deprecated Use `VueRenderer` instead.
- */
-export type VueFramework = VueRenderer;
export interface VueRenderer extends WebRenderer {
// We are omitting props, as we don't use it internally, and more importantly, it completely changes the assignability of meta.component.
// Try not omitting, and check the type errros in the test file, if you want to learn more.
diff --git a/code/renderers/vue3/template/cli/js/Button.stories.js b/code/renderers/vue3/template/cli/js/Button.stories.js
index 5dc3bbc92b1..8374e0636bc 100644
--- a/code/renderers/vue3/template/cli/js/Button.stories.js
+++ b/code/renderers/vue3/template/cli/js/Button.stories.js
@@ -1,3 +1,4 @@
+import { fn } from '@storybook/test';
import MyButton from './Button.vue';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -6,17 +7,11 @@ export default {
component: MyButton,
tags: ['autodocs'],
argTypes: {
- backgroundColor: {
- control: 'color',
- },
- onClick: {},
- size: {
- control: {
- type: 'select',
- },
- options: ['small', 'medium', 'large'],
- },
+ size: { control: { type: 'select' }, options: ['small', 'medium', 'large'] },
+ backgroundColor: { control: 'color' },
},
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ args: { onClick: fn() },
};
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
diff --git a/code/renderers/vue3/template/cli/ts-3-8/Button.stories.ts b/code/renderers/vue3/template/cli/ts-3-8/Button.stories.ts
index c368a36d078..60d4690fa46 100644
--- a/code/renderers/vue3/template/cli/ts-3-8/Button.stories.ts
+++ b/code/renderers/vue3/template/cli/ts-3-8/Button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/vue3';
-
+import { fn } from '@storybook/test';
import Button from './Button.vue';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -11,9 +11,12 @@ const meta: Meta = {
argTypes: {
size: { control: 'select', options: ['small', 'medium', 'large'] },
backgroundColor: { control: 'color' },
- onClick: { action: 'clicked' },
},
- args: { primary: false }, // default value
+ args: {
+ primary: false,
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ onClick: fn(),
+ },
};
export default meta;
diff --git a/code/renderers/vue3/template/cli/ts-4-9/Button.stories.ts b/code/renderers/vue3/template/cli/ts-4-9/Button.stories.ts
index 39013172fbe..a69991a58bf 100644
--- a/code/renderers/vue3/template/cli/ts-4-9/Button.stories.ts
+++ b/code/renderers/vue3/template/cli/ts-4-9/Button.stories.ts
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/vue3';
-
+import { fn } from '@storybook/test';
import Button from './Button.vue';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
@@ -11,9 +11,12 @@ const meta = {
argTypes: {
size: { control: 'select', options: ['small', 'medium', 'large'] },
backgroundColor: { control: 'color' },
- onClick: { action: 'clicked' },
},
- args: { primary: false }, // default value
+ args: {
+ primary: false,
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
+ onClick: fn(),
+ },
} satisfies Meta;
export default meta;
diff --git a/code/renderers/vue3/template/stories/vue3-mdx.stories.mdx b/code/renderers/vue3/template/stories/vue3-mdx.stories.mdx
deleted file mode 100644
index e84f893819d..00000000000
--- a/code/renderers/vue3/template/stories/vue3-mdx.stories.mdx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { global as globalThis } from '@storybook/global';
-import { Meta, Story, Canvas } from '@storybook/addon-docs';
-
-
-
-# Vue3-specific MDX Stories
-
-export const Button = globalThis.Components.Button;
-
-export const Template = (args, { argTypes }) => ({
- components: { MyButton: Button },
- template: '',
- setup() {
- return { args };
- },
-});
-
-## Primary
-
-
-
-## Secondary
-
-
-
-## From template
-
-
diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json
index e43e1a46de1..27d7384a2b8 100644
--- a/code/renderers/web-components/package.json
+++ b/code/renderers/web-components/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/web-components",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook web-components renderer",
"keywords": [
"lit",
diff --git a/code/renderers/web-components/src/public-types.ts b/code/renderers/web-components/src/public-types.ts
index 9beed94f444..19ccdf4b27a 100644
--- a/code/renderers/web-components/src/public-types.ts
+++ b/code/renderers/web-components/src/public-types.ts
@@ -35,17 +35,6 @@ export type StoryFn = AnnotatedStoryFn = StoryAnnotations;
-/**
- * @deprecated Use `StoryFn` instead.
- * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
- * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
- *
- * Story function that represents a CSFv2 component example.
- *
- * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
- */
-export type Story = StoryFn;
-
export type Decorator = DecoratorFunction;
export type Loader = LoaderFunction;
export type StoryContext = GenericStoryContext;
diff --git a/code/renderers/web-components/src/types.ts b/code/renderers/web-components/src/types.ts
index 32cbce64c69..f58e7eaa01f 100644
--- a/code/renderers/web-components/src/types.ts
+++ b/code/renderers/web-components/src/types.ts
@@ -10,10 +10,6 @@ export type StoryFnHtmlReturnType =
export type StoryContext = StoryContextBase;
-/**
- * @deprecated Use `WebComponentsRenderer` instead.
- */
-export type WebComponentsFramework = WebComponentsRenderer;
export interface WebComponentsRenderer extends WebRenderer {
component: string;
storyResult: StoryFnHtmlReturnType;
diff --git a/code/renderers/web-components/template/cli/ts-3-8/Header.ts b/code/renderers/web-components/template/cli/ts-3-8/Header.ts
index d1ca01450c8..7c3c8b89375 100644
--- a/code/renderers/web-components/template/cli/ts-3-8/Header.ts
+++ b/code/renderers/web-components/template/cli/ts-3-8/Header.ts
@@ -9,9 +9,9 @@ type User = {
export interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => html`
diff --git a/code/renderers/web-components/template/cli/ts-3-8/Page.ts b/code/renderers/web-components/template/cli/ts-3-8/Page.ts
index 74711e4aa7e..62be582343f 100644
--- a/code/renderers/web-components/template/cli/ts-3-8/Page.ts
+++ b/code/renderers/web-components/template/cli/ts-3-8/Page.ts
@@ -8,9 +8,9 @@ type User = {
export interface PageProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Page = ({ user, onLogin, onLogout, onCreateAccount }: PageProps) => html`
diff --git a/code/renderers/web-components/template/cli/ts-4-9/Header.ts b/code/renderers/web-components/template/cli/ts-4-9/Header.ts
index d1ca01450c8..7c3c8b89375 100644
--- a/code/renderers/web-components/template/cli/ts-4-9/Header.ts
+++ b/code/renderers/web-components/template/cli/ts-4-9/Header.ts
@@ -9,9 +9,9 @@ type User = {
export interface HeaderProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => html`
diff --git a/code/renderers/web-components/template/cli/ts-4-9/Page.ts b/code/renderers/web-components/template/cli/ts-4-9/Page.ts
index 74711e4aa7e..62be582343f 100644
--- a/code/renderers/web-components/template/cli/ts-4-9/Page.ts
+++ b/code/renderers/web-components/template/cli/ts-4-9/Page.ts
@@ -8,9 +8,9 @@ type User = {
export interface PageProps {
user?: User;
- onLogin: () => void;
- onLogout: () => void;
- onCreateAccount: () => void;
+ onLogin?: () => void;
+ onLogout?: () => void;
+ onCreateAccount?: () => void;
}
export const Page = ({ user, onLogin, onLogout, onCreateAccount }: PageProps) => html`
diff --git a/code/ui/.storybook/main.ts b/code/ui/.storybook/main.ts
index 4800dda1e18..a15c3a4fd98 100644
--- a/code/ui/.storybook/main.ts
+++ b/code/ui/.storybook/main.ts
@@ -1,5 +1,6 @@
import path from 'path';
import pluginTurbosnap from 'vite-plugin-turbosnap';
+// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { mergeConfig } from 'vite';
import type { StorybookConfig } from '../../frameworks/react-vite';
diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json
index 3584ccf1253..1141822b19d 100644
--- a/code/ui/blocks/package.json
+++ b/code/ui/blocks/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/blocks",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Storybook Doc Blocks",
"keywords": [
"storybook"
@@ -71,6 +71,7 @@
},
"devDependencies": {
"@storybook/addon-actions": "workspace:*",
+ "@storybook/test": "workspace:*",
"@types/color-convert": "^2.0.0"
},
"peerDependencies": {
diff --git a/code/ui/blocks/src/blocks/Description.tsx b/code/ui/blocks/src/blocks/Description.tsx
index a6cda58ca93..99b9cf7ce75 100644
--- a/code/ui/blocks/src/blocks/Description.tsx
+++ b/code/ui/blocks/src/blocks/Description.tsx
@@ -1,11 +1,5 @@
import type { FC } from 'react';
-import React, { useContext } from 'react';
-import { str } from '@storybook/docs-tools';
-import { deprecate } from '@storybook/client-logger';
-
-import type { DocsContextProps } from './DocsContext';
-import { DocsContext } from './DocsContext';
-import type { Component } from './types';
+import React from 'react';
import type { Of } from './useOf';
import { useOf } from './useOf';
import { Markdown } from './Markdown';
@@ -17,39 +11,14 @@ export enum DescriptionType {
AUTO = 'auto',
}
-type Notes = string | any;
-type Info = string | any;
-
-const DEPRECATION_MIGRATION_LINK =
- 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo';
-
interface DescriptionProps {
/**
* Specify where to get the description from. Can be a component, a CSF file or a story.
* If not specified, the description will be extracted from the meta of the attached CSF file.
*/
of?: Of;
- /**
- * @deprecated Manually specifying description type is deprecated. See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo
- */
- type?: DescriptionType;
- /**
- * @deprecated The 'markdown' prop on the Description block is deprecated. See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo
- */
- markdown?: string;
- /**
- * @deprecated The 'children' prop on the Description block is deprecated. See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo
- */
- children?: string;
}
-const getNotes = (notes?: Notes) =>
- notes && (typeof notes === 'string' ? notes : str(notes.markdown) || str(notes.text));
-
-const getInfo = (info?: Info) => info && (typeof info === 'string' ? info : str(info.text));
-
-const noDescription = (component?: Component): string | null => null;
-
const getDescriptionFromResolvedOf = (resolvedOf: ReturnType): string | null => {
switch (resolvedOf.type) {
case 'story': {
@@ -88,73 +57,15 @@ const getDescriptionFromResolvedOf = (resolvedOf: ReturnType): str
}
};
-const getDescriptionFromDeprecatedProps = (
- { type, markdown, children }: DescriptionProps,
- { storyById }: DocsContextProps
-): string => {
- const { component, parameters } = storyById();
- if (children || markdown) {
- return children || markdown;
- }
- const { notes, info, docs } = parameters;
- if (Boolean(notes) || Boolean(info)) {
- deprecate(
- `Using 'parameters.notes' or 'parameters.info' properties to describe stories is deprecated. See ${DEPRECATION_MIGRATION_LINK}`
- );
- }
-
- const { extractComponentDescription = noDescription, description } = docs || {};
-
- // override component description
- const componentDescriptionParameter = description?.component;
- if (componentDescriptionParameter) {
- return componentDescriptionParameter;
- }
-
- switch (type) {
- case DescriptionType.INFO:
- return getInfo(info);
- case DescriptionType.NOTES:
- return getNotes(notes);
- case DescriptionType.DOCGEN:
- case DescriptionType.AUTO:
- default:
- return extractComponentDescription(component, { component, ...parameters });
- }
-};
-
const DescriptionContainer: FC = (props) => {
- const { of, type, markdown: markdownProp, children } = props;
+ const { of } = props;
if ('of' in props && of === undefined) {
throw new Error('Unexpected `of={undefined}`, did you mistype a CSF file reference?');
}
- const context = useContext(DocsContext);
const resolvedOf = useOf(of || 'meta');
- let markdown;
- if (type || markdownProp || children) {
- // pre 7.0 mode with deprecated props
- markdown = getDescriptionFromDeprecatedProps(props, context);
- } else {
- // 7.0 mode with new 'of' prop
- // pre 7.0 with only 'of' prop only supported referencing a component, which 7.0 supports as well here
- markdown = getDescriptionFromResolvedOf(resolvedOf);
- }
- if (type) {
- deprecate(
- `Manually specifying description type is deprecated. See ${DEPRECATION_MIGRATION_LINK}`
- );
- }
- if (markdownProp) {
- deprecate(
- `The 'markdown' prop on the Description block is deprecated. See ${DEPRECATION_MIGRATION_LINK}`
- );
- }
- if (children) {
- deprecate(
- `The 'children' prop on the Description block is deprecated. See ${DEPRECATION_MIGRATION_LINK}`
- );
- }
+ const markdown = getDescriptionFromResolvedOf(resolvedOf);
+
return markdown ? {markdown} : null;
};
diff --git a/code/ui/blocks/src/blocks/Source.tsx b/code/ui/blocks/src/blocks/Source.tsx
index 30b279d1e9a..033dfd71857 100644
--- a/code/ui/blocks/src/blocks/Source.tsx
+++ b/code/ui/blocks/src/blocks/Source.tsx
@@ -31,12 +31,6 @@ type SourceParameters = SourceCodeProps & {
* Where to read the source code from, see `SourceType`
*/
type?: SourceType;
- /**
- * Transform the detected source for display
- *
- * @deprecated use `transform` prop instead
- */
- transformSource?: (code: string, storyContext: StoryContextForLoaders) => string;
/**
* Transform the detected source for display
*/
@@ -126,31 +120,7 @@ const getSnippet = ({
const code = useSnippet ? snippet : sourceParameters.originalSource || '';
- if (sourceParameters.transformSource) {
- deprecate(dedent`The \`transformSource\` parameter at \`parameters.docs.source.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block
- `);
- }
- if (storyContext.parameters.docs?.transformSource) {
- deprecate(dedent`The \`transformSource\` parameter at \`parameters.docs.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block
- `);
- }
- if (storyContext.parameters.jsx?.transformSource) {
- deprecate(dedent`The \`transformSource\` parameter at \`parameters.jsx.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block
- `);
- }
-
- const transformer =
- transformFromProps ??
- sourceParameters.transform ??
- sourceParameters.transformSource ?? // deprecated
- storyContext.parameters.docs?.transformSource ?? // deprecated
- storyContext.parameters.jsx?.transformSource; // deprecated - used to be implemented in the React renderer's jsxDecorator
+ const transformer = transformFromProps ?? sourceParameters.transform;
return transformer?.(code, storyContext) || code;
};
diff --git a/code/ui/blocks/src/blocks/Story.stories.tsx b/code/ui/blocks/src/blocks/Story.stories.tsx
index dce6292a643..b3f8108feb2 100644
--- a/code/ui/blocks/src/blocks/Story.stories.tsx
+++ b/code/ui/blocks/src/blocks/Story.stories.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
+import { expect, waitFor } from '@storybook/test';
import { Story as StoryBlock } from './Story';
import * as ButtonStories from '../examples/Button.stories';
@@ -86,6 +87,24 @@ export const IFrameProps: Story = {
of: StoryParametersStories.NoParameters,
inline: false,
},
+ parameters: {
+ chromatic: {
+ delay: 3000,
+ },
+ },
+ play: async ({ canvasElement }) => {
+ // this is mostly to fix flakiness in chromatic, specifically on Safari
+ // where the scrollbar appears inconsistently and causes the snapshot to be different
+ await waitFor(
+ async () => {
+ const iframeEl = canvasElement.querySelector('iframe');
+ await expect(
+ iframeEl!.contentDocument!.querySelector('[data-testid="sb-iframe-text"]')
+ ).toBeVisible();
+ },
+ { timeout: 10000 }
+ );
+ },
};
export const IFrameWithParameter: Story = {
diff --git a/code/ui/blocks/src/blocks/Story.tsx b/code/ui/blocks/src/blocks/Story.tsx
index 42f7e5935ae..9480d8946eb 100644
--- a/code/ui/blocks/src/blocks/Story.tsx
+++ b/code/ui/blocks/src/blocks/Story.tsx
@@ -8,9 +8,7 @@ import type {
StoryAnnotations,
StoryId,
} from '@storybook/types';
-import { deprecate } from '@storybook/client-logger';
-import dedent from 'ts-dedent';
import { Story as PureStory, StorySkeleton } from '../components';
import type { DocsContextProps } from './DocsContext';
import { DocsContext } from './DocsContext';
@@ -88,37 +86,11 @@ type StoryParameters = {
export type StoryProps = (StoryDefProps | StoryRefProps) & StoryParameters;
export const getStoryId = (props: StoryProps, context: DocsContextProps): StoryId => {
- const { id, of, meta, story } = props as StoryRefProps;
+ const { of, meta, story } = props as StoryRefProps;
if ('of' in props && of === undefined) {
throw new Error('Unexpected `of={undefined}`, did you mistype a CSF file reference?');
}
- if (id) {
- deprecate(dedent`Referencing stories by \`id\` is deprecated, please use \`of\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-block'`);
- return id;
- }
-
- const { name } = props as StoryDefProps;
- if (name) {
- deprecate(dedent`Referencing stories by \`name\` is deprecated, please use \`of\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-block'`);
- return context.storyIdByName(name);
- }
-
- // The `story={moduleExports}` prop is a legacy prop for stories defined in CSF files, but
- // "declared" in MDX files (the CSF file has no meta export or doesn't match the stories glob).
- // In this case, the `.stories.mdx` file will have actually ended up declaring the story
- // so we can reference the story just the same as an `of={moduleExports}` would have.
- // See https://github.com/storybookjs/mdx2-csf/issues/3
- if (story) {
- deprecate(dedent`The \`story\` prop is deprecated, please export your stories from CSF files and reference them with \`of={}\`.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-block'`);
- }
-
if (meta) context.referenceMeta(meta, false);
const resolved = context.resolveOf(of || story || 'story', ['story']);
return resolved.story.id;
@@ -140,25 +112,7 @@ export const getStoryProps = (
// prefer block props, then story parameters defined by the framework-specific settings
// and optionally overridden by users
- // Deprecated parameters
- const { inlineStories, iframeHeight } = docs as {
- inlineStories?: boolean;
- iframeHeight?: string;
- autoplay?: boolean;
- };
- if (typeof inlineStories !== 'undefined')
- deprecate(dedent`The \`docs.inlineStories\` parameter is deprecated, use \`docs.story.inline\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#autodocs-changes'
- `);
- const inline = props.inline ?? storyParameters.inline ?? inlineStories ?? false;
-
- if (typeof iframeHeight !== 'undefined') {
- deprecate(dedent`The \`docs.iframeHeight\` parameter is deprecated, use \`docs.story.iframeHeight\` instead.
-
- Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#autodocs-changes'
- `);
- }
+ const inline = props.inline ?? storyParameters.inline ?? false;
if (inline) {
const height = props.height ?? storyParameters.height;
@@ -176,12 +130,7 @@ export const getStoryProps = (
};
}
- const height =
- props.height ??
- storyParameters.height ??
- storyParameters.iframeHeight ??
- iframeHeight ??
- '100px';
+ const height = props.height ?? storyParameters.height ?? storyParameters.iframeHeight ?? '100px';
return {
story,
inline: false,
diff --git a/code/ui/blocks/src/blocks/internal/InternalDescription.stories.tsx b/code/ui/blocks/src/blocks/internal/InternalDescription.stories.tsx
deleted file mode 100644
index da4c8772894..00000000000
--- a/code/ui/blocks/src/blocks/internal/InternalDescription.stories.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import React from 'react';
-import type { Meta, StoryObj } from '@storybook/react';
-import { Description, DescriptionType } from '../Description';
-import { Button } from '../../examples/Button';
-
-const meta: Meta = {
- component: Description,
- parameters: {
- relativeCsfPaths: ['../examples/Button.stories'],
- docsStyles: true,
- },
- args: {
- of: Button,
- },
-};
-export default meta;
-
-type Story = StoryObj;
-
-export const InfoType: Story = {
- args: {
- type: DescriptionType.INFO,
- },
-};
-export const NotesType: Story = {
- args: {
- type: DescriptionType.NOTES,
- },
-};
-export const DocgenType: Story = {
- args: {
- type: DescriptionType.DOCGEN,
- },
-};
-export const AutoType: Story = {
- args: {
- type: DescriptionType.AUTO,
- },
-};
-export const Markdown: Story = {
- args: {
- markdown: `# My Example Markdown
-
-An \`inline\` codeblock
-
-\`\`\`tsx
-// TypeScript React code block
-export const MyStory = () => {
-return ;
-};
-\`\`\`
-
-\`\`\`
-code block with with no language
-const a = fn({
-b: 2,
-});
-\`\`\`
-`,
- },
-};
-export const Children: Story = {
- render: (args) => (
-
- {`# My Example Markdown
-
-An \`inline\` codeblock
-
-\`\`\`tsx
-// TypeScript React code block
-export const MyStory = () => {
-return ;
-};
-\`\`\`
-
-\`\`\`
-code block with with no language
-const a = fn({
-b: 2,
-});
-\`\`\`
-`}
-
- ),
-};
diff --git a/code/ui/blocks/src/blocks/internal/InternalSource.stories.tsx b/code/ui/blocks/src/blocks/internal/InternalSource.stories.tsx
index 7490f1d7218..035f1c5e108 100644
--- a/code/ui/blocks/src/blocks/internal/InternalSource.stories.tsx
+++ b/code/ui/blocks/src/blocks/internal/InternalSource.stories.tsx
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';
-import * as ParametersStories from '../../examples/SourceParameters.stories';
import { Source } from '../Source';
@@ -29,21 +28,3 @@ export const Ids: Story = {
],
},
};
-
-export const SourceTransformSourceParameter: Story = {
- args: {
- of: ParametersStories.SourceTransformSource,
- },
-};
-
-export const DocsTransformSourceParameter: Story = {
- args: {
- of: ParametersStories.DocsTransformSource,
- },
-};
-
-export const JsxTransformSourceParameter: Story = {
- args: {
- of: ParametersStories.JsxTransformSource,
- },
-};
diff --git a/code/ui/blocks/src/examples/SimpleSizeTest.tsx b/code/ui/blocks/src/examples/SimpleSizeTest.tsx
index 72e43ab4585..34021666c62 100644
--- a/code/ui/blocks/src/examples/SimpleSizeTest.tsx
+++ b/code/ui/blocks/src/examples/SimpleSizeTest.tsx
@@ -12,7 +12,7 @@ export const SimpleSizeTest = () => {
margin: '-4rem -20px',
}}
>
-
+
This story does nothing. Its only purpose is to show how its size renders in different
conditions (inline/iframe/fixed height) when used in a {''} block.
diff --git a/code/ui/blocks/src/examples/SourceParameters.stories.tsx b/code/ui/blocks/src/examples/SourceParameters.stories.tsx
index 08ebaf5cb46..ec832b109e8 100644
--- a/code/ui/blocks/src/examples/SourceParameters.stories.tsx
+++ b/code/ui/blocks/src/examples/SourceParameters.stories.tsx
@@ -50,56 +50,6 @@ export const Transform = {
},
};
-// deprecated
-export const SourceTransformSource = {
- args: { something: 'else' },
- parameters: {
- docs: {
- source: {
- transformSource: (
- src: string,
- storyContext: StoryContext
- ) => dedent`// this comment has been added via parameters.docs.source.transformSource!
- // this is the story id: ${storyContext.id}
- // these are the current args: ${JSON.stringify(storyContext.args)}
- ${src}`,
- },
- },
- },
-};
-
-// deprecated
-export const DocsTransformSource = {
- args: { something: 'else' },
- parameters: {
- docs: {
- transformSource: (
- src: string,
- storyContext: StoryContext
- ) => dedent`// this comment has been added via parameters.docs.transformSource!
- // this is the story id: ${storyContext.id}
- // these are the current args: ${JSON.stringify(storyContext.args)}
- ${src}`,
- },
- },
-};
-
-// deprecated
-export const JsxTransformSource = {
- args: { something: 'else' },
- parameters: {
- jsx: {
- transformSource: (
- src: string,
- storyContext: StoryContext
- ) => dedent`// this comment has been added via parameters.jsx.transformSource!
- // this is the story id: ${storyContext.id}
- // these are the current args: ${JSON.stringify(storyContext.args)}
- ${src}`,
- },
- },
-};
-
export const Code = {
parameters: { docs: { source: { code } } },
};
diff --git a/code/ui/components/package.json b/code/ui/components/package.json
index b406cdfe20d..a2ebf3bd843 100644
--- a/code/ui/components/package.json
+++ b/code/ui/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/components",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook Components",
"keywords": [
"storybook"
@@ -72,6 +72,7 @@
"devDependencies": {
"@popperjs/core": "^2.6.0",
"@radix-ui/react-scroll-area": "^1.0.5",
+ "@storybook/test": "workspace:*",
"@types/react-syntax-highlighter": "11.0.5",
"@types/util-deprecate": "^1.0.0",
"css": "^3.0.0",
diff --git a/code/ui/components/src/components/Button/Button.tsx b/code/ui/components/src/components/Button/Button.tsx
index 5045f0621ed..37b64a78649 100644
--- a/code/ui/components/src/components/Button/Button.tsx
+++ b/code/ui/components/src/components/Button/Button.tsx
@@ -15,23 +15,23 @@ export interface ButtonProps extends ButtonHTMLAttributes {
active?: boolean;
animation?: 'none' | 'rotate360' | 'glow' | 'jiggle';
- /** @deprecated Use {@link asChild} instead */
+ /** @deprecated Use {@link asChild} instead. This will be removed in Storybook 9.0 */
isLink?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
primary?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
secondary?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
tertiary?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
gray?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
inForm?: boolean;
- /** @deprecated Use {@link size} instead */
+ /** @deprecated Use {@link size} instead. This will be removed in Storybook 9.0 */
small?: boolean;
- /** @deprecated Use {@link variant} instead */
+ /** @deprecated Use {@link variant} instead. This will be removed in Storybook 9.0 */
outline?: boolean;
- /** @deprecated Add your icon as a child directly */
+ /** @deprecated Add your icon as a child directly. This will be removed in Storybook 9.0 */
containsIcon?: boolean;
}
diff --git a/code/ui/components/src/components/tooltip/WithTooltip.stories.tsx b/code/ui/components/src/components/tooltip/WithTooltip.stories.tsx
index 76eab8d7c11..8ccb459095a 100644
--- a/code/ui/components/src/components/tooltip/WithTooltip.stories.tsx
+++ b/code/ui/components/src/components/tooltip/WithTooltip.stories.tsx
@@ -1,6 +1,7 @@
import type { FunctionComponent, ComponentProps } from 'react';
import React from 'react';
import type { StoryObj } from '@storybook/react';
+import { expect, screen } from '@storybook/test';
import { styled } from '@storybook/theming';
import { TooltipMessage } from './TooltipMessage';
import { WithToolTipState as WithTooltip } from './WithTooltip';
@@ -104,6 +105,9 @@ export const SimpleClickStartOpen: StoryObj>
Click me!
),
+ play: async () => {
+ await expect(await screen.findByText('Lorem ipsum dolor sit')).toBeInTheDocument();
+ },
};
export const SimpleClickCloseOnClick: StoryObj> = {
diff --git a/code/ui/components/src/components/tooltip/WithTooltip.tsx b/code/ui/components/src/components/tooltip/WithTooltip.tsx
index bece4bc6427..e76c898d6dd 100644
--- a/code/ui/components/src/components/tooltip/WithTooltip.tsx
+++ b/code/ui/components/src/components/tooltip/WithTooltip.tsx
@@ -36,18 +36,6 @@ export interface WithTooltipPureProps
tooltip: ReactNode | ((p: WithHideFn) => ReactNode);
children: ReactNode;
onDoubleClick?: () => void;
- /**
- * @deprecated use `defaultVisible` property instead. This property will be removed in SB 8.0
- */
- tooltipShown?: boolean;
- /**
- * @deprecated use `closeOnOutsideClick` property instead. This property will be removed in SB 8.0
- */
- closeOnClick?: boolean;
- /**
- * @deprecated use `onVisibleChange` property instead. This property will be removed in SB 8.0
- */
- onVisibilityChange?: (visibility: boolean) => void | boolean;
/**
* If `true`, a click outside the trigger element closes the tooltip
* @default false
@@ -68,9 +56,6 @@ const WithTooltipPure: FC = ({
children,
closeOnTriggerHidden,
mutationObserverOptions,
- closeOnClick,
- tooltipShown,
- onVisibilityChange,
defaultVisible,
delayHide,
visible,
@@ -94,15 +79,12 @@ const WithTooltipPure: FC = ({
{
trigger,
placement,
- defaultVisible: defaultVisible ?? tooltipShown,
+ defaultVisible,
delayHide,
interactive,
- closeOnOutsideClick: closeOnOutsideClick ?? closeOnClick,
+ closeOnOutsideClick,
closeOnTriggerHidden,
- onVisibleChange: (_isVisible) => {
- onVisibilityChange?.(_isVisible);
- onVisibleChange?.(_isVisible);
- },
+ onVisibleChange,
delayShow,
followCursor,
mutationObserverOptions,
diff --git a/code/ui/components/src/components/typography/typography.stories.mdx b/code/ui/components/src/components/typography/typography.mdx
similarity index 100%
rename from code/ui/components/src/components/typography/typography.stories.mdx
rename to code/ui/components/src/components/typography/typography.mdx
diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json
index 46ceaa8859b..92ba5532c00 100644
--- a/code/ui/manager/package.json
+++ b/code/ui/manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/manager",
- "version": "8.0.0-alpha.4",
+ "version": "8.0.0-alpha.8",
"description": "Core Storybook UI",
"keywords": [
"storybook"
diff --git a/code/ui/manager/src/components/layout/Layout.stories.tsx b/code/ui/manager/src/components/layout/Layout.stories.tsx
index 593e83dea5a..aea6f4a1a5f 100644
--- a/code/ui/manager/src/components/layout/Layout.stories.tsx
+++ b/code/ui/manager/src/components/layout/Layout.stories.tsx
@@ -4,6 +4,7 @@ import React, { useState } from 'react';
import { styled } from '@storybook/theming';
import type { Meta, StoryObj } from '@storybook/react';
+import { fn } from '@storybook/test';
import { Layout } from './Layout';
import { LayoutProvider } from './LayoutProvider';
import MobileNavigationStoriesMeta from '../mobile/navigation/MobileNavigation.stories';
@@ -58,6 +59,7 @@ const meta = {
slotSidebar: ,
slotPanel: ,
slotPages: ,
+ setManagerLayoutState: fn(),
},
parameters: {
theme: 'light',
diff --git a/code/ui/manager/src/components/preview/Preview.stories.tsx b/code/ui/manager/src/components/preview/Preview.stories.tsx
index 624542b2f68..0a639c9db64 100644
--- a/code/ui/manager/src/components/preview/Preview.stories.tsx
+++ b/code/ui/manager/src/components/preview/Preview.stories.tsx
@@ -7,7 +7,7 @@ import { Location, BaseLocationProvider } from '@storybook/router';
import { ThemeProvider, ensure as ensureTheme, themes } from '@storybook/theming';
-import type { DecoratorFn } from '@storybook/react';
+import type { Decorator } from '@storybook/react';
import { Preview } from './Preview';
import { PrettyFakeProvider } from '../../FakeProvider';
@@ -80,7 +80,7 @@ export default {
);
- }) as DecoratorFn,
+ }) as Decorator,
],
};
diff --git a/code/ui/manager/src/components/sidebar/Heading.stories.tsx b/code/ui/manager/src/components/sidebar/Heading.stories.tsx
index b958ebe2e1b..34e08e7c02e 100644
--- a/code/ui/manager/src/components/sidebar/Heading.stories.tsx
+++ b/code/ui/manager/src/components/sidebar/Heading.stories.tsx
@@ -1,7 +1,7 @@
/* eslint-disable storybook/use-storybook-testing-library */
// @TODO: use addon-interactions and remove the rule disable above
import React from 'react';
-import type { ComponentMeta, ComponentStoryObj, ComponentStoryFn } from '@storybook/react';
+import type { Meta, StoryObj, StoryFn } from '@storybook/react';
import { ThemeProvider, useTheme } from '@storybook/theming';
import type { Theme } from '@storybook/theming';
import { action } from '@storybook/addon-actions';
@@ -9,7 +9,7 @@ import { screen } from '@testing-library/dom';
import { Heading } from './Heading';
-type Story = ComponentStoryFn;
+type Story = StoryFn;
export default {
component: Heading,
@@ -19,7 +19,7 @@ export default {
decorators: [
(storyFn) =>
{storyFn()}
,
],
-} as ComponentMeta;
+} as Meta;
const menuItems = [
{ title: 'Menu Item 1', onClick: action('onActivateMenuItem'), id: '1' },
@@ -223,7 +223,7 @@ export const NoBrand: Story = () => {
);
};
-export const SkipToCanvasLinkFocused: ComponentStoryObj = {
+export const SkipToCanvasLinkFocused: StoryObj = {
args: {
menu: menuItems,
skipLinkHref: '#storybook-preview-wrapper',
diff --git a/code/ui/manager/src/components/sidebar/Menu.stories.tsx b/code/ui/manager/src/components/sidebar/Menu.stories.tsx
index e04811e76bf..ebc234f75ef 100644
--- a/code/ui/manager/src/components/sidebar/Menu.stories.tsx
+++ b/code/ui/manager/src/components/sidebar/Menu.stories.tsx
@@ -8,7 +8,7 @@ import { styled } from '@storybook/theming';
import { screen, userEvent, within } from '@storybook/testing-library';
import type { State } from '@storybook/manager-api';
import { LinkIcon } from '@storybook/icons';
-import { SidebarMenu, ToolbarMenu } from './Menu';
+import { SidebarMenu } from './Menu';
import { useMenu } from '../../container/Menu';
import { LayoutProvider } from '../layout/LayoutProvider';
@@ -34,11 +34,10 @@ export const Items: Story = {
};
export const Real: Story = {
- render: () => ,
-};
-
-export const Toolbar = {
- render: () => ,
+ args: {
+ isHighlighted: true,
+ },
+ render: (args) => ,
};
const DoubleThemeRenderingHack = styled.div({
diff --git a/code/ui/manager/src/components/sidebar/Menu.tsx b/code/ui/manager/src/components/sidebar/Menu.tsx
index 95290acbc09..9dadfa2b156 100644
--- a/code/ui/manager/src/components/sidebar/Menu.tsx
+++ b/code/ui/manager/src/components/sidebar/Menu.tsx
@@ -5,7 +5,7 @@ import { styled } from '@storybook/theming';
import { transparentize } from 'polished';
import type { Button, TooltipLinkListLink } from '@storybook/components';
import { WithTooltip, TooltipLinkList, Icons, IconButton } from '@storybook/components';
-import { CloseIcon, CogIcon, MenuIcon } from '@storybook/icons';
+import { CloseIcon, CogIcon } from '@storybook/icons';
import { useLayout } from '../layout/LayoutProvider';
export type MenuList = ComponentProps['links'];
@@ -22,48 +22,42 @@ const Icon = styled(Icons)(sharedStyles, ({ theme }) => ({
color: theme.color.secondary,
}));
-export const SidebarIconButton: FC<
- ComponentProps & { highlighted: boolean; active: boolean }
-> = styled(IconButton)<
- ComponentProps & {
- highlighted: boolean;
- active: boolean;
- }
->(({ highlighted, active, theme }) => ({
- position: 'relative',
- overflow: 'visible',
- color: theme.textMutedColor,
- marginTop: 0,
- zIndex: 1,
-
- ...(highlighted && {
- '&:before, &:after': {
- content: '""',
- position: 'absolute',
- top: 6,
- right: 6,
- width: 5,
- height: 5,
- zIndex: 2,
- borderRadius: '50%',
- background: theme.background.app,
- border: `1px solid ${theme.background.app}`,
- boxShadow: `0 0 0 2px ${theme.background.app}`,
- },
- '&:after': {
- background: theme.color.positive,
- border: `1px solid rgba(0, 0, 0, 0.1)`,
- boxShadow: `0 0 0 2px ${theme.background.app}`,
- },
-
- '&:hover:after, &:focus-visible:after': {
- boxShadow: `0 0 0 2px ${transparentize(0.88, theme.color.secondary)}`,
- },
- }),
- ...(active && {
- color: theme.color.secondary,
- }),
-}));
+export const SidebarIconButton: FC & { highlighted: boolean }> =
+ styled(IconButton)<
+ ComponentProps & {
+ highlighted: boolean;
+ }
+ >(({ highlighted, theme }) => ({
+ position: 'relative',
+ overflow: 'visible',
+ marginTop: 0,
+ zIndex: 1,
+
+ ...(highlighted && {
+ '&:before, &:after': {
+ content: '""',
+ position: 'absolute',
+ top: 6,
+ right: 6,
+ width: 5,
+ height: 5,
+ zIndex: 2,
+ borderRadius: '50%',
+ background: theme.background.app,
+ border: `1px solid ${theme.background.app}`,
+ boxShadow: `0 0 0 2px ${theme.background.app}`,
+ },
+ '&:after': {
+ background: theme.color.positive,
+ border: `1px solid rgba(0, 0, 0, 0.1)`,
+ boxShadow: `0 0 0 2px ${theme.background.app}`,
+ },
+
+ '&:hover:after, &:focus-visible:after': {
+ boxShadow: `0 0 0 2px ${transparentize(0.88, theme.color.secondary)}`,
+ },
+ }),
+ }));
const MenuButtonGroup = styled.div({
display: 'flex',
@@ -134,13 +128,13 @@ export const SidebarMenu: FC = ({ menu, isHighlighted, onClick
>
- setMobileMenuOpen(false)}
>
-
+
);
}
@@ -163,33 +157,3 @@ export const SidebarMenu: FC = ({ menu, isHighlighted, onClick
);
};
-
-export const ToolbarMenu: FC<{
- menu: MenuList;
-}> = ({ menu }) => {
- return (
- }
- >
-
-
-
-
- );
-};
-
-// We should not have to reset the margin-top here
-// TODO: remove this once we have a the new IconButton component
-const CloseIconButton = styled(IconButton)({
- marginTop: 0,
-});
diff --git a/code/ui/manager/src/container/Menu.tsx b/code/ui/manager/src/container/Menu.tsx
index 9646acf2cdd..2c8fb64c01a 100644
--- a/code/ui/manager/src/container/Menu.tsx
+++ b/code/ui/manager/src/container/Menu.tsx
@@ -64,7 +64,7 @@ export const useMenu = (
() => ({
id: 'about',
title: 'About your Storybook',
- onClick: () => api.navigateToSettingsPage('/settings/about'),
+ onClick: () => api.changeSettingsTab('about'),
}),
[api]
);
@@ -76,7 +76,7 @@ export const useMenu = (
() => ({
id: 'whats-new',
title: "What's new?",
- onClick: () => api.navigateToSettingsPage('/settings/whats-new'),
+ onClick: () => api.changeSettingsTab('whats-new'),
right: whatsNewNotificationsEnabled && isWhatsNewUnread && (
Check it out
),
@@ -88,7 +88,7 @@ export const useMenu = (
() => ({
id: 'shortcuts',
title: 'Keyboard shortcuts',
- onClick: () => api.navigateToSettingsPage('/settings/shortcuts'),
+ onClick: () => api.changeSettingsTab('shortcuts'),
right: enableShortcuts ? : null,
style: {
borderBottom: `4px solid ${theme.appBorderColor}`,
diff --git a/code/ui/manager/src/container/Sidebar.tsx b/code/ui/manager/src/container/Sidebar.tsx
index 9041badfd5d..7eec79fc83c 100755
--- a/code/ui/manager/src/container/Sidebar.tsx
+++ b/code/ui/manager/src/container/Sidebar.tsx
@@ -1,7 +1,8 @@
import React, { useMemo } from 'react';
import type { Combo, StoriesHash } from '@storybook/manager-api';
-import { types, Consumer } from '@storybook/manager-api';
+import { Consumer } from '@storybook/manager-api';
+import { Addon_TypesEnum } from '@storybook/types';
import type { SidebarProps as SidebarComponentProps } from '../components/sidebar/Sidebar';
import { Sidebar as SidebarComponent } from '../components/sidebar/Sidebar';
@@ -41,9 +42,12 @@ const Sidebar = React.memo(function Sideber({ onMenuClick }: SidebarProps) {
const whatsNewNotificationsEnabled =
state.whatsNewData?.status === 'SUCCESS' && !state.disableWhatsNewNotifications;
- const items = api.getElements(types.experimental_SIDEBAR_BOTTOM);
- const bottom = useMemo(() => Object.values(items), [items]);
- const top = useMemo(() => Object.values(api.getElements(types.experimental_SIDEBAR_TOP)), []);
+ const bottomItems = api.getElements(Addon_TypesEnum.experimental_SIDEBAR_BOTTOM);
+ const topItems = api.getElements(Addon_TypesEnum.experimental_SIDEBAR_TOP);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ const bottom = useMemo(() => Object.values(bottomItems), [...Object.values(bottomItems)]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ const top = useMemo(() => Object.values(topItems), [...Object.values(topItems)]);
return {
title: name,
diff --git a/code/ui/manager/src/globals/exports.ts b/code/ui/manager/src/globals/exports.ts
index adeceb1a1e8..1da23ad426d 100644
--- a/code/ui/manager/src/globals/exports.ts
+++ b/code/ui/manager/src/globals/exports.ts
@@ -139,7 +139,6 @@ export default {
'FORCE_REMOUNT',
'FORCE_RE_RENDER',
'GLOBALS_UPDATED',
- 'IGNORED_EXCEPTION',
'NAVIGATE_URL',
'PLAY_FUNCTION_THREW_EXCEPTION',
'PRELOAD_ENTRIES',
@@ -173,6 +172,7 @@ export default {
'STORY_UNCHANGED',
'TELEMETRY_ERROR',
'TOGGLE_WHATS_NEW_NOTIFICATIONS',
+ 'UNHANDLED_ERRORS_WHILE_PLAYING',
'UPDATE_GLOBALS',
'UPDATE_QUERY_PARAMS',
'UPDATE_STORY_ARGS',
diff --git a/code/ui/manager/src/settings/About.tsx b/code/ui/manager/src/settings/About.tsx
index 797af9dcc73..658bc92030b 100644
--- a/code/ui/manager/src/settings/About.tsx
+++ b/code/ui/manager/src/settings/About.tsx
@@ -2,15 +2,19 @@ import type { FC } from 'react';
import React from 'react';
import { styled } from '@storybook/theming';
-import { Button as BaseButton, Link, StorybookIcon } from '@storybook/components';
+import { Button, Link, StorybookLogo } from '@storybook/components';
import { DocumentIcon, GithubIcon } from '@storybook/icons';
import { UpgradeBlock } from '../components/upgrade/UpgradeBlock';
-const Header = styled.header(({ theme }) => ({
+const Container = styled.div({
+ display: 'flex',
+ alignItems: 'center',
+ flexDirection: 'column',
+ marginTop: 40,
+});
+
+const Header = styled.header({
marginBottom: 32,
- fontSize: theme.typography.size.l2,
- color: theme.base === 'light' ? theme.color.darkest : theme.color.lightest,
- fontWeight: theme.typography.weight.bold,
alignItems: 'center',
display: 'flex',
@@ -19,14 +23,6 @@ const Header = styled.header(({ theme }) => ({
width: 'auto',
marginRight: 8,
},
-}));
-
-const Container = styled.div({
- display: `flex`,
- alignItems: 'center',
- justifyContent: 'center',
- height: 'calc(100% - 40px)',
- flexDirection: 'column',
});
const Footer = styled.div(({ theme }) => ({
@@ -39,18 +35,14 @@ const Footer = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
}));
-const SquareButton = styled(BaseButton)(({ theme }) => ({
- '&&': {
- borderRadius: 4,
- fontSize: '13px',
- lineHeight: '14px',
- color: theme.base === 'light' ? theme.color.darker : theme.color.lightest,
- padding: '9px 12px',
- svg: {
- marginRight: 6,
- },
- },
-}));
+const Actions = styled.div({
+ display: 'flex',
+ flexDirection: 'row',
+ alignItems: 'center',
+ marginBottom: 24,
+ marginTop: 24,
+ gap: 16,
+});
const StyledLink = styled(Link as any)(({ theme }) => ({
'&&': {
@@ -65,28 +57,25 @@ const StyledLink = styled(Link as any)(({ theme }) => ({
const AboutScreen: FC<{ onNavigateToWhatsNew?: () => void }> = ({ onNavigateToWhatsNew }) => {
return (
-
- Storybook
+
-
);
};
diff --git a/code/yarn.lock b/code/yarn.lock
index c410acdff97..d97a6fb453c 100644
--- a/code/yarn.lock
+++ b/code/yarn.lock
@@ -3325,7 +3325,7 @@ __metadata:
languageName: node
linkType: hard
-"@jest/transform@npm:^29.3.1, @jest/transform@npm:^29.7.0":
+"@jest/transform@npm:^29.7.0":
version: 29.7.0
resolution: "@jest/transform@npm:29.7.0"
dependencies:
@@ -3514,15 +3514,46 @@ __metadata:
languageName: node
linkType: hard
-"@mdx-js/react@npm:^2.1.5":
- version: 2.3.0
- resolution: "@mdx-js/react@npm:2.3.0"
+"@mdx-js/mdx@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "@mdx-js/mdx@npm:3.0.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdx": "npm:^2.0.0"
+ collapse-white-space: "npm:^2.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-build-jsx: "npm:^3.0.0"
+ estree-util-is-identifier-name: "npm:^3.0.0"
+ estree-util-to-js: "npm:^2.0.0"
+ estree-walker: "npm:^3.0.0"
+ hast-util-to-estree: "npm:^3.0.0"
+ hast-util-to-jsx-runtime: "npm:^2.0.0"
+ markdown-extensions: "npm:^2.0.0"
+ periscopic: "npm:^3.0.0"
+ remark-mdx: "npm:^3.0.0"
+ remark-parse: "npm:^11.0.0"
+ remark-rehype: "npm:^11.0.0"
+ source-map: "npm:^0.7.0"
+ unified: "npm:^11.0.0"
+ unist-util-position-from-estree: "npm:^2.0.0"
+ unist-util-stringify-position: "npm:^4.0.0"
+ unist-util-visit: "npm:^5.0.0"
+ vfile: "npm:^6.0.0"
+ checksum: 42e631bc12f5dda528f00833f9592d05f4728fc673209f4cb08948c45751c479724f890379810baf60dfa32857793644c8ceb868f162f3798d81caa775b89aac
+ languageName: node
+ linkType: hard
+
+"@mdx-js/react@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "@mdx-js/react@npm:3.0.0"
dependencies:
"@types/mdx": "npm:^2.0.0"
- "@types/react": "npm:>=16"
peerDependencies:
+ "@types/react": ">=16"
react: ">=16"
- checksum: 6d647115703dbe258f7fe372499fa8c6fe17a053ff0f2a208111c9973a71ae738a0ed376770445d39194d217e00e1a015644b24f32c2f7cb4f57988de0649b15
+ checksum: 865f6ebc7ae83c6cb9f7e92db4eddd3f85cd1664391643b4736887ddc32b0ddb5aec012db6fbc9b486b552e08e6d5ad800450fcd9d51c20665667ff0f174d966
languageName: node
linkType: hard
@@ -4130,64 +4161,6 @@ __metadata:
languageName: node
linkType: hard
-"@preact/preset-vite@npm:^2.0.0":
- version: 2.7.0
- resolution: "@preact/preset-vite@npm:2.7.0"
- dependencies:
- "@babel/plugin-transform-react-jsx": "npm:^7.22.15"
- "@babel/plugin-transform-react-jsx-development": "npm:^7.22.5"
- "@prefresh/vite": "npm:^2.4.1"
- "@rollup/pluginutils": "npm:^4.1.1"
- babel-plugin-transform-hook-names: "npm:^1.0.2"
- debug: "npm:^4.3.4"
- kolorist: "npm:^1.8.0"
- resolve: "npm:^1.22.8"
- peerDependencies:
- "@babel/core": 7.x
- vite: 2.x || 3.x || 4.x || 5.x
- checksum: 95a5a87d804d9f33d98f7c8db93fe27de0d626b2794e745734bcad7a7d89db5a3ad37712feb188f1857d834658de33167f524b3040e8cea48ef422da6a1e74db
- languageName: node
- linkType: hard
-
-"@prefresh/babel-plugin@npm:0.5.1":
- version: 0.5.1
- resolution: "@prefresh/babel-plugin@npm:0.5.1"
- checksum: f9153c210427adbddb4403502f8fa845f6207516de2d162f5d550683a87173dc3eaabc6be2bb4f1206b882cdd23339f2092567be8d09794a3d06a5626942b1e4
- languageName: node
- linkType: hard
-
-"@prefresh/core@npm:^1.5.1":
- version: 1.5.2
- resolution: "@prefresh/core@npm:1.5.2"
- peerDependencies:
- preact: ^10.0.0
- checksum: 53d1ce714ed098ccc11f3a8e2826ff6b90237445c24df6281eb162791b534d1d7626a43c0c1c7427139d2ade658e1ba7020963c001135bbdbeeb15073008529b
- languageName: node
- linkType: hard
-
-"@prefresh/utils@npm:^1.2.0":
- version: 1.2.0
- resolution: "@prefresh/utils@npm:1.2.0"
- checksum: 38cdc6cbb5e18df36996161214eb1097db3361cb0b6402a8012cbe500ba8fb5bcbdc39a687d3b6d67e99f6c340ed77d59f27ab167dfc1655eb4d783740d87d52
- languageName: node
- linkType: hard
-
-"@prefresh/vite@npm:^2.4.1":
- version: 2.4.4
- resolution: "@prefresh/vite@npm:2.4.4"
- dependencies:
- "@babel/core": "npm:^7.22.1"
- "@prefresh/babel-plugin": "npm:0.5.1"
- "@prefresh/core": "npm:^1.5.1"
- "@prefresh/utils": "npm:^1.2.0"
- "@rollup/pluginutils": "npm:^4.2.1"
- peerDependencies:
- preact: ^10.4.0
- vite: ">=2.0.0"
- checksum: 31c3fcdcfbfd31921d41f01ca027515d4411f4169c2d3810578bf87b61609d155a1a410c977f098839982adb8da2d88674382cc4a5e55b6fe249a59be60a2483
- languageName: node
- linkType: hard
-
"@radix-ui/number@npm:1.0.1":
version: 1.0.1
resolution: "@radix-ui/number@npm:1.0.1"
@@ -4366,16 +4339,6 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/pluginutils@npm:^4.1.1, @rollup/pluginutils@npm:^4.2.1":
- version: 4.2.1
- resolution: "@rollup/pluginutils@npm:4.2.1"
- dependencies:
- estree-walker: "npm:^2.0.1"
- picomatch: "npm:^2.2.2"
- checksum: 3ee56b2c8f1ed8dfd0a92631da1af3a2dfdd0321948f089b3752b4de1b54dc5076701eadd0e5fc18bd191b77af594ac1db6279e83951238ba16bf8a414c64c48
- languageName: node
- linkType: hard
-
"@rollup/pluginutils@npm:^5.0.2":
version: 5.1.0
resolution: "@rollup/pluginutils@npm:5.1.0"
@@ -4732,8 +4695,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/addon-docs@workspace:addons/docs"
dependencies:
- "@jest/transform": "npm:^29.3.1"
- "@mdx-js/react": "npm:^2.1.5"
+ "@babel/core": "npm:^7.12.3"
+ "@mdx-js/mdx": "npm:^3.0.0"
+ "@mdx-js/react": "npm:^3.0.0"
"@rollup/pluginutils": "npm:^5.0.2"
"@storybook/blocks": "workspace:*"
"@storybook/client-logger": "workspace:*"
@@ -4741,10 +4705,10 @@ __metadata:
"@storybook/csf-plugin": "workspace:*"
"@storybook/csf-tools": "workspace:*"
"@storybook/global": "npm:^5.0.0"
- "@storybook/mdx2-csf": "npm:^1.0.0"
"@storybook/node-logger": "workspace:*"
"@storybook/preview-api": "workspace:*"
"@storybook/react-dom-shim": "workspace:*"
+ "@storybook/test": "workspace:*"
"@storybook/theming": "workspace:*"
"@storybook/types": "workspace:*"
fs-extra: "npm:^11.1.0"
@@ -5106,6 +5070,7 @@ __metadata:
"@storybook/icons": "npm:^1.2.1"
"@storybook/manager-api": "workspace:*"
"@storybook/preview-api": "workspace:*"
+ "@storybook/test": "workspace:*"
"@storybook/theming": "workspace:*"
"@storybook/types": "workspace:*"
"@types/color-convert": "npm:^2.0.0"
@@ -5136,14 +5101,12 @@ __metadata:
"@storybook/manager": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@types/ejs": "npm:^3.1.1"
- "@types/find-cache-dir": "npm:^3.2.1"
"@yarnpkg/esbuild-plugin-pnp": "npm:^3.0.0-rc.10"
browser-assert: "npm:^1.2.1"
ejs: "npm:^3.1.8"
esbuild: "npm:^0.18.0"
esbuild-plugin-alias: "npm:^0.2.1"
express: "npm:^4.17.3"
- find-cache-dir: "npm:^3.0.0"
fs-extra: "npm:^11.1.0"
process: "npm:^0.11.10"
slash: "npm:^5.0.0"
@@ -5174,14 +5137,13 @@ __metadata:
fs-extra: "npm:^11.1.0"
glob: "npm:^10.0.0"
magic-string: "npm:^0.30.0"
- rollup: "npm:^3.20.1"
slash: "npm:^5.0.0"
typescript: "npm:^5.3.2"
vite: "npm:^4.0.4"
peerDependencies:
"@preact/preset-vite": "*"
typescript: ">= 4.3.x"
- vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ vite: ^4.0.0 || ^5.0.0
vite-plugin-glimmerx: "*"
peerDependenciesMeta:
"@preact/preset-vite":
@@ -5382,6 +5344,7 @@ __metadata:
"@storybook/csf": "npm:^0.1.2"
"@storybook/global": "npm:^5.0.0"
"@storybook/icons": "npm:^1.2.1"
+ "@storybook/test": "workspace:*"
"@storybook/theming": "workspace:*"
"@storybook/types": "workspace:*"
"@types/react-syntax-highlighter": "npm:11.0.5"
@@ -5462,7 +5425,7 @@ __metadata:
"@storybook/core-events": "workspace:*"
"@storybook/csf": "npm:^0.1.2"
"@storybook/csf-tools": "workspace:*"
- "@storybook/docs-mdx": "npm:^0.1.0"
+ "@storybook/docs-mdx": "npm:3.0.0"
"@storybook/global": "npm:^5.0.0"
"@storybook/manager": "workspace:*"
"@storybook/node-logger": "workspace:*"
@@ -5595,10 +5558,10 @@ __metadata:
languageName: node
linkType: hard
-"@storybook/docs-mdx@npm:^0.1.0":
- version: 0.1.0
- resolution: "@storybook/docs-mdx@npm:0.1.0"
- checksum: e4d510f0452a7a3cb09d9617920c18b974f836299dfba38d6b2e62fbfea418d71f340b6c280a87201b1336a7221c7cc16b47794c1f8e81d01dcfa1f599343085
+"@storybook/docs-mdx@npm:3.0.0":
+ version: 3.0.0
+ resolution: "@storybook/docs-mdx@npm:3.0.0"
+ checksum: 4f4242fc05b57e8dc239204c71fd0d1481c9abbf20d12dd0f3dace74f77a7ff7cbe0bd07d7d785873b45747be64cad273423d3dc0cf89b52e9f117592a4b054f
languageName: node
linkType: hard
@@ -5793,6 +5756,7 @@ __metadata:
"@storybook/types": "workspace:*"
"@types/lodash": "npm:^4.14.167"
"@types/qs": "npm:^6"
+ "@types/semver": "npm:^7.3.4"
dequal: "npm:^2.0.2"
flush-promises: "npm:^1.0.2"
lodash: "npm:^4.17.21"
@@ -5852,13 +5816,6 @@ __metadata:
languageName: unknown
linkType: soft
-"@storybook/mdx2-csf@npm:^1.0.0":
- version: 1.1.0
- resolution: "@storybook/mdx2-csf@npm:1.1.0"
- checksum: ba4496a51efae35edb3e509e488cd16066ccf0768d2dc527bbc2650d0bc0f630540985205772d63d1711d1a5dae66136a919077c90fa2ac7a02a13de43446baa
- languageName: node
- linkType: hard
-
"@storybook/nextjs@workspace:*, @storybook/nextjs@workspace:frameworks/nextjs":
version: 0.0.0-use.local
resolution: "@storybook/nextjs@workspace:frameworks/nextjs"
@@ -5890,6 +5847,7 @@ __metadata:
"@types/babel__preset-env": "npm:^7"
"@types/loader-utils": "npm:^2.0.5"
"@types/node": "npm:^18.0.0"
+ "@types/semver": "npm:^7.3.4"
css-loader: "npm:^6.7.3"
find-up: "npm:^5.0.0"
fs-extra: "npm:^11.1.0"
@@ -5941,7 +5899,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/preact-vite@workspace:frameworks/preact-vite"
dependencies:
- "@preact/preset-vite": "npm:^2.0.0"
"@storybook/builder-vite": "workspace:*"
"@storybook/preact": "workspace:*"
"@types/node": "npm:^18.0.0"
@@ -5949,7 +5906,7 @@ __metadata:
vite: "npm:^4.0.0"
peerDependencies:
preact: ">=10"
- vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft
@@ -5995,6 +5952,7 @@ __metadata:
"@storybook/types": "workspace:*"
"@types/babel__core": "npm:^7.1.7"
"@types/node": "npm:^18.0.0"
+ "@types/semver": "npm:^7.3.4"
pnp-webpack-plugin: "npm:^1.7.0"
semver: "npm:^7.3.5"
typescript: "npm:^5.3.2"
@@ -6223,7 +6181,6 @@ __metadata:
"@storybook/builder-vite": "workspace:*"
"@storybook/react": "workspace:*"
"@types/node": "npm:^18.0.0"
- "@vitejs/plugin-react": "npm:^3.0.1"
magic-string: "npm:^0.30.0"
react-docgen: "npm:^7.0.0"
typescript: "npm:^5.3.2"
@@ -6231,7 +6188,7 @@ __metadata:
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
- vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft
@@ -6439,6 +6396,7 @@ __metadata:
react-dom: "npm:^18.2.0"
semver: "npm:^7.3.7"
serve-static: "npm:^1.14.1"
+ svelte: "npm:^5.0.0-next.28"
trash: "npm:^7.0.0"
ts-dedent: "npm:^2.0.0"
ts-node: "npm:^10.9.1"
@@ -6535,18 +6493,19 @@ __metadata:
"@storybook/builder-vite": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@storybook/svelte": "workspace:*"
- "@sveltejs/vite-plugin-svelte": "npm:^2.4.2"
+ "@sveltejs/vite-plugin-svelte": "npm:^3.0.1"
"@types/node": "npm:^18.0.0"
magic-string: "npm:^0.30.0"
- svelte: "npm:^5.0.0-next.16"
+ svelte: "npm:^5.0.0-next.28"
svelte-preprocess: "npm:^5.1.1"
sveltedoc-parser: "npm:^4.2.1"
ts-dedent: "npm:^2.2.0"
typescript: "npm:^5.3.2"
vite: "npm:^4.0.0"
peerDependencies:
+ "@sveltejs/vite-plugin-svelte": ^2.0.0 || ^3.0.0
svelte: ^4.0.0 || ^5.0.0-next.16
- vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft
@@ -6580,7 +6539,7 @@ __metadata:
"@storybook/types": "workspace:*"
"@sveltejs/vite-plugin-svelte": "npm:^3.0.1"
expect-type: "npm:^0.15.0"
- svelte: "npm:^5.0.0-next.22"
+ svelte: "npm:^5.0.0-next.28"
svelte-check: "npm:^3.6.1"
sveltedoc-parser: "npm:^4.2.1"
ts-dedent: "npm:^2.0.0"
@@ -6722,13 +6681,12 @@ __metadata:
"@storybook/core-server": "workspace:*"
"@storybook/vue3": "workspace:*"
"@types/node": "npm:^18.0.0"
- "@vitejs/plugin-vue": "npm:^4.0.0"
magic-string: "npm:^0.30.0"
typescript: "npm:^5.3.2"
vite: "npm:^4.0.0"
vue-docgen-api: "npm:^4.40.0"
peerDependencies:
- vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft
@@ -6763,7 +6721,7 @@ __metadata:
"@storybook/types": "workspace:*"
"@types/prettier": "npm:2.7.2"
"@vitejs/plugin-vue": "npm:^4.4.0"
- "@vue/compiler-core": "npm:^3.3.4"
+ "@vue/compiler-core": "npm:^3.0.0"
lodash: "npm:^4.17.21"
ts-dedent: "npm:^2.0.0"
type-fest: "npm:~2.19"
@@ -6772,7 +6730,6 @@ __metadata:
vue-component-type-helpers: "npm:latest"
vue-tsc: "npm:latest"
peerDependencies:
- "@vue/compiler-core": ^3.0.0
vue: ^3.0.0
languageName: unknown
linkType: soft
@@ -6838,19 +6795,6 @@ __metadata:
languageName: node
linkType: hard
-"@sveltejs/vite-plugin-svelte-inspector@npm:^1.0.4":
- version: 1.0.4
- resolution: "@sveltejs/vite-plugin-svelte-inspector@npm:1.0.4"
- dependencies:
- debug: "npm:^4.3.4"
- peerDependencies:
- "@sveltejs/vite-plugin-svelte": ^2.2.0
- svelte: ^3.54.0 || ^4.0.0
- vite: ^4.0.0
- checksum: f21cb6bde0d8cce505c558dcb786d00e514c270848d9ff21dca12bc8335588e1bd05215fe3cd7478c8a6779bae7a75629b68d484fcdf309d759f25ee58ea771e
- languageName: node
- linkType: hard
-
"@sveltejs/vite-plugin-svelte-inspector@npm:^2.0.0-next.0 || ^2.0.0":
version: 2.0.0
resolution: "@sveltejs/vite-plugin-svelte-inspector@npm:2.0.0"
@@ -6864,24 +6808,6 @@ __metadata:
languageName: node
linkType: hard
-"@sveltejs/vite-plugin-svelte@npm:^2.4.2":
- version: 2.5.3
- resolution: "@sveltejs/vite-plugin-svelte@npm:2.5.3"
- dependencies:
- "@sveltejs/vite-plugin-svelte-inspector": "npm:^1.0.4"
- debug: "npm:^4.3.4"
- deepmerge: "npm:^4.3.1"
- kleur: "npm:^4.1.5"
- magic-string: "npm:^0.30.3"
- svelte-hmr: "npm:^0.15.3"
- vitefu: "npm:^0.2.4"
- peerDependencies:
- svelte: ^3.54.0 || ^4.0.0 || ^5.0.0-next.0
- vite: ^4.0.0
- checksum: 613a4ad18a946ddee7b82cae0d892040a9459a5ac5137cbaa91a4b7b67d504409b5dbc02d268136a740b09e42531b7516f80a0f687ca4fe2b0d99e6e483c5d06
- languageName: node
- linkType: hard
-
"@sveltejs/vite-plugin-svelte@npm:^3.0.1":
version: 3.0.1
resolution: "@sveltejs/vite-plugin-svelte@npm:3.0.1"
@@ -7688,6 +7614,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/hast@npm:^3.0.0":
+ version: 3.0.3
+ resolution: "@types/hast@npm:3.0.3"
+ dependencies:
+ "@types/unist": "npm:*"
+ checksum: 0779740926efc1f856976abd95fcb04f4b45d885ec65ef148505722e15cd8fdf4e84d93bf29908131ae6b040f3ca1c1f0cf9fef1b35d52c90c76ff90cfc1214f
+ languageName: node
+ linkType: hard
+
"@types/hoist-non-react-statics@npm:^3.3.1":
version: 3.3.2
resolution: "@types/hoist-non-react-statics@npm:3.3.2"
@@ -7847,6 +7782,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/mdast@npm:^4.0.0":
+ version: 4.0.3
+ resolution: "@types/mdast@npm:4.0.3"
+ dependencies:
+ "@types/unist": "npm:*"
+ checksum: e6994404f5ce58073aa6c1a37ceac3060326470a464e2d751580a9f89e2dbca3a2a6222b849bdaaa5bffbe89033c50a886d17e49fca3b040a4ffcf970e387a0c
+ languageName: node
+ linkType: hard
+
"@types/mdx@npm:^2.0.0":
version: 2.0.8
resolution: "@types/mdx@npm:2.0.8"
@@ -8067,7 +8011,7 @@ __metadata:
languageName: node
linkType: hard
-"@types/react@npm:*, @types/react@npm:>=16, @types/react@npm:^18.0.37":
+"@types/react@npm:*, @types/react@npm:^18.0.37":
version: 18.2.43
resolution: "@types/react@npm:18.2.43"
dependencies:
@@ -8224,6 +8168,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/unist@npm:*, @types/unist@npm:^3.0.0":
+ version: 3.0.2
+ resolution: "@types/unist@npm:3.0.2"
+ checksum: 39f220ce184a773c55c18a127062bfc4d0d30c987250cd59bab544d97be6cfec93717a49ef96e81f024b575718f798d4d329eb81c452fc57d6d051af8b043ebf
+ languageName: node
+ linkType: hard
+
"@types/unist@npm:^2, @types/unist@npm:^2.0.0, @types/unist@npm:^2.0.2":
version: 2.0.8
resolution: "@types/unist@npm:2.0.8"
@@ -8479,6 +8430,13 @@ __metadata:
languageName: node
linkType: hard
+"@ungap/structured-clone@npm:^1.0.0":
+ version: 1.2.0
+ resolution: "@ungap/structured-clone@npm:1.2.0"
+ checksum: 8209c937cb39119f44eb63cf90c0b73e7c754209a6411c707be08e50e29ee81356dca1a848a405c8bdeebfe2f5e4f831ad310ae1689eeef65e7445c090c6657d
+ languageName: node
+ linkType: hard
+
"@urql/core@npm:>=4.1.0, @urql/core@npm:^4.1.0":
version: 4.2.0
resolution: "@urql/core@npm:4.2.0"
@@ -8523,7 +8481,7 @@ __metadata:
languageName: node
linkType: hard
-"@vitejs/plugin-vue@npm:^4.0.0, @vitejs/plugin-vue@npm:^4.4.0":
+"@vitejs/plugin-vue@npm:^4.4.0":
version: 4.5.2
resolution: "@vitejs/plugin-vue@npm:4.5.2"
peerDependencies:
@@ -8711,7 +8669,7 @@ __metadata:
languageName: node
linkType: hard
-"@vue/compiler-core@npm:3.3.11, @vue/compiler-core@npm:^3.3.4":
+"@vue/compiler-core@npm:3.3.11":
version: 3.3.11
resolution: "@vue/compiler-core@npm:3.3.11"
dependencies:
@@ -8723,6 +8681,18 @@ __metadata:
languageName: node
linkType: hard
+"@vue/compiler-core@npm:^3.0.0":
+ version: 3.3.13
+ resolution: "@vue/compiler-core@npm:3.3.13"
+ dependencies:
+ "@babel/parser": "npm:^7.23.5"
+ "@vue/shared": "npm:3.3.13"
+ estree-walker: "npm:^2.0.2"
+ source-map-js: "npm:^1.0.2"
+ checksum: d0544ef5c12adb1f25523349dfb5468ee59928892c8476c491b66806840ab7de7a2c15b943ae3805dc8adcfd1a88435db08b97a0d23977eafe7e448a2a001754
+ languageName: node
+ linkType: hard
+
"@vue/compiler-dom@npm:3.0.0":
version: 3.0.0
resolution: "@vue/compiler-dom@npm:3.0.0"
@@ -8927,6 +8897,13 @@ __metadata:
languageName: node
linkType: hard
+"@vue/shared@npm:3.3.13":
+ version: 3.3.13
+ resolution: "@vue/shared@npm:3.3.13"
+ checksum: 8f49e0ee51f7f1edce16aa7a97b5a7a36d8cf36dfd03c9dba194b6eb0e9685eb71335f0a2b17af17753b742fa2346f96ec371a3c0a56677a4e7eeb0f13426a56
+ languageName: node
+ linkType: hard
+
"@vue/typescript@npm:1.8.15":
version: 1.8.15
resolution: "@vue/typescript@npm:1.8.15"
@@ -9850,6 +9827,15 @@ __metadata:
languageName: node
linkType: hard
+"astring@npm:^1.8.0":
+ version: 1.8.6
+ resolution: "astring@npm:1.8.6"
+ bin:
+ astring: bin/astring
+ checksum: 31f09144597048c11072417959a412f208f8f95ba8dce408dfbc3367acb929f31fbcc00ed5eb61ccbf7c2f1173b9ac8bfcaaa37134a9455050c669b2b036ed88
+ languageName: node
+ linkType: hard
+
"async-disk-cache@npm:^1.2.1":
version: 1.3.5
resolution: "async-disk-cache@npm:1.3.5"
@@ -10189,15 +10175,6 @@ __metadata:
languageName: node
linkType: hard
-"babel-plugin-transform-hook-names@npm:^1.0.2":
- version: 1.0.2
- resolution: "babel-plugin-transform-hook-names@npm:1.0.2"
- peerDependencies:
- "@babel/core": ^7.12.10
- checksum: 517b85fe0611d742b3fffad5d0e119fcbd29bf69f95c6970b9ede4cb66453c7106a2d3bf048b35255b78a9d6a9565ad37e73b46c0be1fe557e941c792fad79f0
- languageName: node
- linkType: hard
-
"babel-preset-current-node-syntax@npm:^1.0.0":
version: 1.0.1
resolution: "babel-preset-current-node-syntax@npm:1.0.1"
@@ -11201,9 +11178,9 @@ __metadata:
linkType: hard
"caniuse-lite@npm:^1.0.30001406, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001565":
- version: 1.0.30001566
- resolution: "caniuse-lite@npm:1.0.30001566"
- checksum: cd163075b1a9feaf9c9f657c3551279fcdac471471d67ee57ab2286c7b5480168e6336e359741b469fa40e94716f0f95ec185d87bd57d58894d66d8c21d7db04
+ version: 1.0.30001570
+ resolution: "caniuse-lite@npm:1.0.30001570"
+ checksum: e47230d2016edea56e002fa462a5289f697b48dcfbf703fb01aecc6c98ad4ecaf945ab23c253cb7af056c2d05f266e4e4cbebf45132100e2c9367439cb95b95b
languageName: node
linkType: hard
@@ -11678,6 +11655,13 @@ __metadata:
languageName: node
linkType: hard
+"collapse-white-space@npm:^2.0.0":
+ version: 2.1.0
+ resolution: "collapse-white-space@npm:2.1.0"
+ checksum: b2e2800f4ab261e62eb27a1fbe853378296e3a726d6695117ed033e82d61fb6abeae4ffc1465d5454499e237005de9cfc52c9562dc7ca4ac759b9a222ef14453
+ languageName: node
+ linkType: hard
+
"collection-visit@npm:^1.0.0":
version: 1.0.0
resolution: "collection-visit@npm:1.0.0"
@@ -11779,6 +11763,13 @@ __metadata:
languageName: node
linkType: hard
+"comma-separated-tokens@npm:^2.0.0":
+ version: 2.0.3
+ resolution: "comma-separated-tokens@npm:2.0.3"
+ checksum: 91f90f1aae320f1755d6957ef0b864fe4f54737f3313bd95e0802686ee2ca38bff1dd381964d00ae5db42912dd1f4ae5c2709644e82706ffc6f6842a813cdd67
+ languageName: node
+ linkType: hard
+
"commander@npm:11.0.0":
version: 11.0.0
resolution: "commander@npm:11.0.0"
@@ -12914,6 +12905,15 @@ __metadata:
languageName: node
linkType: hard
+"devlop@npm:^1.0.0, devlop@npm:^1.1.0":
+ version: 1.1.0
+ resolution: "devlop@npm:1.1.0"
+ dependencies:
+ dequal: "npm:^2.0.0"
+ checksum: e0928ab8f94c59417a2b8389c45c55ce0a02d9ac7fd74ef62d01ba48060129e1d594501b77de01f3eeafc7cb00773819b0df74d96251cf20b31c5b3071f45c0e
+ languageName: node
+ linkType: hard
+
"diff-sequences@npm:^28.1.1":
version: 28.1.1
resolution: "diff-sequences@npm:28.1.1"
@@ -14423,6 +14423,27 @@ __metadata:
languageName: node
linkType: hard
+"estree-util-attach-comments@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "estree-util-attach-comments@npm:3.0.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ checksum: ee69bb5c45e2ad074725b90ed181c1c934b29d81bce4b0c7761431e83c4c6ab1b223a6a3d6a4fbeb92128bc5d5ee201d5dd36cf1770aa5e16a40b0cf36e8a1f1
+ languageName: node
+ linkType: hard
+
+"estree-util-build-jsx@npm:^3.0.0":
+ version: 3.0.1
+ resolution: "estree-util-build-jsx@npm:3.0.1"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-is-identifier-name: "npm:^3.0.0"
+ estree-walker: "npm:^3.0.0"
+ checksum: 274c119817b8e7caa14a9778f1e497fea56cdd2b01df1a1ed037f843178992d3afe85e0d364d485e1e2e239255763553d1b647b15e4a7ba50851bcb43dc6bf80
+ languageName: node
+ linkType: hard
+
"estree-util-is-identifier-name@npm:^2.0.0":
version: 2.1.0
resolution: "estree-util-is-identifier-name@npm:2.1.0"
@@ -14430,6 +14451,24 @@ __metadata:
languageName: node
linkType: hard
+"estree-util-is-identifier-name@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "estree-util-is-identifier-name@npm:3.0.0"
+ checksum: d1881c6ed14bd588ebd508fc90bf2a541811dbb9ca04dec2f39d27dcaa635f85b5ed9bbbe7fc6fb1ddfca68744a5f7c70456b4b7108b6c4c52780631cc787c5b
+ languageName: node
+ linkType: hard
+
+"estree-util-to-js@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "estree-util-to-js@npm:2.0.0"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ astring: "npm:^1.8.0"
+ source-map: "npm:^0.7.0"
+ checksum: ac88cb831401ef99e365f92f4af903755d56ae1ce0e0f0fb8ff66e678141f3d529194f0fb15f6c78cd7554c16fda36854df851d58f9e05cfab15bddf7a97cea0
+ languageName: node
+ linkType: hard
+
"estree-util-visit@npm:^1.0.0":
version: 1.2.1
resolution: "estree-util-visit@npm:1.2.1"
@@ -14440,6 +14479,16 @@ __metadata:
languageName: node
linkType: hard
+"estree-util-visit@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "estree-util-visit@npm:2.0.0"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/unist": "npm:^3.0.0"
+ checksum: acda8b03cc8f890d79c7c7361f6c95331ba84b7ccc0c32b49f447fc30206b20002b37ffdfc97b6ad16e6fe065c63ecbae1622492e2b6b4775c15966606217f39
+ languageName: node
+ linkType: hard
+
"estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2":
version: 2.0.2
resolution: "estree-walker@npm:2.0.2"
@@ -16381,6 +16430,62 @@ __metadata:
languageName: node
linkType: hard
+"hast-util-to-estree@npm:^3.0.0":
+ version: 3.1.0
+ resolution: "hast-util-to-estree@npm:3.1.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ comma-separated-tokens: "npm:^2.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-attach-comments: "npm:^3.0.0"
+ estree-util-is-identifier-name: "npm:^3.0.0"
+ hast-util-whitespace: "npm:^3.0.0"
+ mdast-util-mdx-expression: "npm:^2.0.0"
+ mdast-util-mdx-jsx: "npm:^3.0.0"
+ mdast-util-mdxjs-esm: "npm:^2.0.0"
+ property-information: "npm:^6.0.0"
+ space-separated-tokens: "npm:^2.0.0"
+ style-to-object: "npm:^0.4.0"
+ unist-util-position: "npm:^5.0.0"
+ zwitch: "npm:^2.0.0"
+ checksum: 9003a8bac26a4580d5fc9f2a271d17330dd653266425e9f5539feecd2f7538868d6630a18f70698b8b804bf14c306418a3f4ab3119bb4692aca78b0c08b1291e
+ languageName: node
+ linkType: hard
+
+"hast-util-to-jsx-runtime@npm:^2.0.0":
+ version: 2.3.0
+ resolution: "hast-util-to-jsx-runtime@npm:2.3.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ "@types/unist": "npm:^3.0.0"
+ comma-separated-tokens: "npm:^2.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-is-identifier-name: "npm:^3.0.0"
+ hast-util-whitespace: "npm:^3.0.0"
+ mdast-util-mdx-expression: "npm:^2.0.0"
+ mdast-util-mdx-jsx: "npm:^3.0.0"
+ mdast-util-mdxjs-esm: "npm:^2.0.0"
+ property-information: "npm:^6.0.0"
+ space-separated-tokens: "npm:^2.0.0"
+ style-to-object: "npm:^1.0.0"
+ unist-util-position: "npm:^5.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: df7a36dcc792df7667a54438f044b721753d5e09692606d23bf7336bf4651670111fe7728eebbf9f0e4f96ab3346a05bb23037fa1b1d115482b3bc5bde8b6912
+ languageName: node
+ linkType: hard
+
+"hast-util-whitespace@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "hast-util-whitespace@npm:3.0.0"
+ dependencies:
+ "@types/hast": "npm:^3.0.0"
+ checksum: b898bc9fe27884b272580d15260b6bbdabe239973a147e97fa98c45fa0ffec967a481aaa42291ec34fb56530dc2d484d473d7e2bae79f39c83f3762307edfea8
+ languageName: node
+ linkType: hard
+
"hastscript@npm:^6.0.0":
version: 6.0.0
resolution: "hastscript@npm:6.0.0"
@@ -17048,6 +17153,20 @@ __metadata:
languageName: node
linkType: hard
+"inline-style-parser@npm:0.1.1":
+ version: 0.1.1
+ resolution: "inline-style-parser@npm:0.1.1"
+ checksum: 08832a533f51a1e17619f2eabf2f5ec5e956d6dcba1896351285c65df022c9420de61d73256e1dca8015a52abf96cc84ddc3b73b898b22de6589d3962b5e501b
+ languageName: node
+ linkType: hard
+
+"inline-style-parser@npm:0.2.2":
+ version: 0.2.2
+ resolution: "inline-style-parser@npm:0.2.2"
+ checksum: 82099645fd99451301ff243706f70917c066e3033d32bdb1074a54eb1909e08d1cafb48c426a643facbe8248cff362082e90ca14760b3d44e09a858fe668b3fe
+ languageName: node
+ linkType: hard
+
"inquirer@npm:9.2.11":
version: 9.2.11
resolution: "inquirer@npm:9.2.11"
@@ -18635,13 +18754,6 @@ __metadata:
languageName: node
linkType: hard
-"kolorist@npm:^1.8.0":
- version: 1.8.0
- resolution: "kolorist@npm:1.8.0"
- checksum: 73075db44a692bf6c34a649f3b4b3aea4993b84f6b754cbf7a8577e7c7db44c0bad87752bd23b0ce533f49de2244ce2ce03b7b1b667a85ae170a94782cc50f9b
- languageName: node
- linkType: hard
-
"language-subtag-registry@npm:~0.3.2":
version: 0.3.22
resolution: "language-subtag-registry@npm:0.3.22"
@@ -19295,7 +19407,7 @@ __metadata:
languageName: node
linkType: hard
-"magic-string@npm:0.30.5, magic-string@npm:^0.30.0, magic-string@npm:^0.30.3, magic-string@npm:^0.30.4, magic-string@npm:^0.30.5":
+"magic-string@npm:0.30.5, magic-string@npm:^0.30.0, magic-string@npm:^0.30.4, magic-string@npm:^0.30.5":
version: 0.30.5
resolution: "magic-string@npm:0.30.5"
dependencies:
@@ -19480,6 +19592,13 @@ __metadata:
languageName: node
linkType: hard
+"markdown-extensions@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "markdown-extensions@npm:2.0.0"
+ checksum: 406139da2aa0d5ebad86195c8e8c02412f873c452b4c087ae7bc767af37956141be449998223bb379eea179b5fd38dfa610602b6f29c22ddab5d51e627a7e41d
+ languageName: node
+ linkType: hard
+
"markdown-table@npm:^3.0.0":
version: 3.0.3
resolution: "markdown-table@npm:3.0.3"
@@ -19587,6 +19706,26 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-from-markdown@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "mdast-util-from-markdown@npm:2.0.0"
+ dependencies:
+ "@types/mdast": "npm:^4.0.0"
+ "@types/unist": "npm:^3.0.0"
+ decode-named-character-reference: "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ mdast-util-to-string: "npm:^4.0.0"
+ micromark: "npm:^4.0.0"
+ micromark-util-decode-numeric-character-reference: "npm:^2.0.0"
+ micromark-util-decode-string: "npm:^2.0.0"
+ micromark-util-normalize-identifier: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ unist-util-stringify-position: "npm:^4.0.0"
+ checksum: fb66e917f66e33fc60d6964264c4abd519fd8829a4a58ff9c61b2ba5c337554fb954b9ec31ca1c34e83c1163a73f310c39072d656f9a2d3184fe39c87cbba65a
+ languageName: node
+ linkType: hard
+
"mdast-util-gfm-autolink-literal@npm:^1.0.0":
version: 1.0.3
resolution: "mdast-util-gfm-autolink-literal@npm:1.0.3"
@@ -19677,6 +19816,20 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-mdx-expression@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "mdast-util-mdx-expression@npm:2.0.0"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdast": "npm:^4.0.0"
+ devlop: "npm:^1.0.0"
+ mdast-util-from-markdown: "npm:^2.0.0"
+ mdast-util-to-markdown: "npm:^2.0.0"
+ checksum: 512848cbc44b9dc7cffc1bb3f95f7e67f0d6562870e56a67d25647f475d411e136b915ba417c8069fb36eac1839d0209fb05fb323d377f35626a82fcb0879363
+ languageName: node
+ linkType: hard
+
"mdast-util-mdx-jsx@npm:^2.0.0, mdast-util-mdx-jsx@npm:^2.1.2":
version: 2.1.4
resolution: "mdast-util-mdx-jsx@npm:2.1.4"
@@ -19697,6 +19850,27 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-mdx-jsx@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "mdast-util-mdx-jsx@npm:3.0.0"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdast": "npm:^4.0.0"
+ "@types/unist": "npm:^3.0.0"
+ ccount: "npm:^2.0.0"
+ devlop: "npm:^1.1.0"
+ mdast-util-from-markdown: "npm:^2.0.0"
+ mdast-util-to-markdown: "npm:^2.0.0"
+ parse-entities: "npm:^4.0.0"
+ stringify-entities: "npm:^4.0.0"
+ unist-util-remove-position: "npm:^5.0.0"
+ unist-util-stringify-position: "npm:^4.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: c14fc72587acd482086be56bb809a142b4d732833593c9a14c1ebb863e549aafbc9391507b177eac8788b2a9de624b8665a2092c75243bbe80f808728ffa421a
+ languageName: node
+ linkType: hard
+
"mdast-util-mdx@npm:^2.0.0":
version: 2.0.1
resolution: "mdast-util-mdx@npm:2.0.1"
@@ -19710,6 +19884,19 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-mdx@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "mdast-util-mdx@npm:3.0.0"
+ dependencies:
+ mdast-util-from-markdown: "npm:^2.0.0"
+ mdast-util-mdx-expression: "npm:^2.0.0"
+ mdast-util-mdx-jsx: "npm:^3.0.0"
+ mdast-util-mdxjs-esm: "npm:^2.0.0"
+ mdast-util-to-markdown: "npm:^2.0.0"
+ checksum: 4faea13f77d6bc9aa64ee41a5e4779110b73444a17fda363df6ebe880ecfa58b321155b71f8801c3faa6d70d6222a32a00cbd6dbf5fad8db417f4688bc9c74e1
+ languageName: node
+ linkType: hard
+
"mdast-util-mdxjs-esm@npm:^1.0.0, mdast-util-mdxjs-esm@npm:^1.3.1":
version: 1.3.1
resolution: "mdast-util-mdxjs-esm@npm:1.3.1"
@@ -19723,6 +19910,20 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-mdxjs-esm@npm:^2.0.0":
+ version: 2.0.1
+ resolution: "mdast-util-mdxjs-esm@npm:2.0.1"
+ dependencies:
+ "@types/estree-jsx": "npm:^1.0.0"
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdast": "npm:^4.0.0"
+ devlop: "npm:^1.0.0"
+ mdast-util-from-markdown: "npm:^2.0.0"
+ mdast-util-to-markdown: "npm:^2.0.0"
+ checksum: 5bda92fc154141705af2b804a534d891f28dac6273186edf1a4c5e3f045d5b01dbcac7400d27aaf91b7e76e8dce007c7b2fdf136c11ea78206ad00bdf9db46bc
+ languageName: node
+ linkType: hard
+
"mdast-util-phrasing@npm:^3.0.0":
version: 3.0.1
resolution: "mdast-util-phrasing@npm:3.0.1"
@@ -19733,6 +19934,32 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-phrasing@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "mdast-util-phrasing@npm:4.0.0"
+ dependencies:
+ "@types/mdast": "npm:^4.0.0"
+ unist-util-is: "npm:^6.0.0"
+ checksum: bf281d159d1a9a9705ed8fdbadb70c9633d1c25716ff2c282b6c2ecbc1f05cff10f73e5280d754ed833b09d42b00260c4b8d0a5fed4ce3236d4cffb5230b50cf
+ languageName: node
+ linkType: hard
+
+"mdast-util-to-hast@npm:^13.0.0":
+ version: 13.0.2
+ resolution: "mdast-util-to-hast@npm:13.0.2"
+ dependencies:
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdast": "npm:^4.0.0"
+ "@ungap/structured-clone": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-util-sanitize-uri: "npm:^2.0.0"
+ trim-lines: "npm:^3.0.0"
+ unist-util-position: "npm:^5.0.0"
+ unist-util-visit: "npm:^5.0.0"
+ checksum: f6e9a5b1ab94483ce1cf2ef229578fde4fe7d085f8b9d88a048823da5f93f9469adc98839e8db73f7475e8128a6df30eccad9cd0f9ee0a1d410e74db19b82d8c
+ languageName: node
+ linkType: hard
+
"mdast-util-to-markdown@npm:^0.6.0":
version: 0.6.5
resolution: "mdast-util-to-markdown@npm:0.6.5"
@@ -19763,6 +19990,22 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-to-markdown@npm:^2.0.0":
+ version: 2.1.0
+ resolution: "mdast-util-to-markdown@npm:2.1.0"
+ dependencies:
+ "@types/mdast": "npm:^4.0.0"
+ "@types/unist": "npm:^3.0.0"
+ longest-streak: "npm:^3.0.0"
+ mdast-util-phrasing: "npm:^4.0.0"
+ mdast-util-to-string: "npm:^4.0.0"
+ micromark-util-decode-string: "npm:^2.0.0"
+ unist-util-visit: "npm:^5.0.0"
+ zwitch: "npm:^2.0.0"
+ checksum: 8bd37a9627a438ef6418d6642661904d0cc03c5c732b8b018a8e238ef5cc82fe8aef1940b19c6f563245e58b9659f35e527209bd3fe145f3c723ba14d18fc3e6
+ languageName: node
+ linkType: hard
+
"mdast-util-to-string@npm:^1.0.0, mdast-util-to-string@npm:^1.0.2":
version: 1.1.0
resolution: "mdast-util-to-string@npm:1.1.0"
@@ -19786,6 +20029,15 @@ __metadata:
languageName: node
linkType: hard
+"mdast-util-to-string@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "mdast-util-to-string@npm:4.0.0"
+ dependencies:
+ "@types/mdast": "npm:^4.0.0"
+ checksum: 2d3c1af29bf3fe9c20f552ee9685af308002488f3b04b12fa66652c9718f66f41a32f8362aa2d770c3ff464c034860b41715902ada2306bb0a055146cef064d7
+ languageName: node
+ linkType: hard
+
"mdn-data@npm:2.0.30":
version: 2.0.30
resolution: "mdn-data@npm:2.0.30"
@@ -19907,6 +20159,30 @@ __metadata:
languageName: node
linkType: hard
+"micromark-core-commonmark@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-core-commonmark@npm:2.0.0"
+ dependencies:
+ decode-named-character-reference: "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-factory-destination: "npm:^2.0.0"
+ micromark-factory-label: "npm:^2.0.0"
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-factory-title: "npm:^2.0.0"
+ micromark-factory-whitespace: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-chunked: "npm:^2.0.0"
+ micromark-util-classify-character: "npm:^2.0.0"
+ micromark-util-html-tag-name: "npm:^2.0.0"
+ micromark-util-normalize-identifier: "npm:^2.0.0"
+ micromark-util-resolve-all: "npm:^2.0.0"
+ micromark-util-subtokenize: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: e087824b98d1f1d0db34791ac53945b0d68fb5e541c6c9da6700cc3db54d6b697d8110d3120d5d30e2fb39443aabddccd3e2bbf684795359f38b5a696fdc5913
+ languageName: node
+ linkType: hard
+
"micromark-extension-gfm-autolink-literal@npm:^1.0.0":
version: 1.0.5
resolution: "micromark-extension-gfm-autolink-literal@npm:1.0.5"
@@ -20016,6 +20292,22 @@ __metadata:
languageName: node
linkType: hard
+"micromark-extension-mdx-expression@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "micromark-extension-mdx-expression@npm:3.0.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-factory-mdx-expression: "npm:^2.0.0"
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-events-to-acorn: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: fa799c594d8ff9ecbbd28e226959c4928590cfcddb60a926d9d859d00fc7acd25684b6f78dbe6a7f0830879a402b4a3628efd40bb9df1f5846e6d2b7332715f7
+ languageName: node
+ linkType: hard
+
"micromark-extension-mdx-jsx@npm:^1.0.0":
version: 1.0.5
resolution: "micromark-extension-mdx-jsx@npm:1.0.5"
@@ -20034,6 +20326,24 @@ __metadata:
languageName: node
linkType: hard
+"micromark-extension-mdx-jsx@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "micromark-extension-mdx-jsx@npm:3.0.0"
+ dependencies:
+ "@types/acorn": "npm:^4.0.0"
+ "@types/estree": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-is-identifier-name: "npm:^3.0.0"
+ micromark-factory-mdx-expression: "npm:^2.0.0"
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: 18a81c8def7f3a2088dc435bba19e649c19f679464b1a01e2c680f9518820e70fb0974b8403c790aee8f44205833a280b56ba157fe5a5b2903b476c5de5ba353
+ languageName: node
+ linkType: hard
+
"micromark-extension-mdx-md@npm:^1.0.0":
version: 1.0.1
resolution: "micromark-extension-mdx-md@npm:1.0.1"
@@ -20043,6 +20353,15 @@ __metadata:
languageName: node
linkType: hard
+"micromark-extension-mdx-md@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-extension-mdx-md@npm:2.0.0"
+ dependencies:
+ micromark-util-types: "npm:^2.0.0"
+ checksum: bae91c61273de0e5ba80a980c03470e6cd9d7924aa936f46fbda15d780704d9386e945b99eda200e087b96254fbb4271a9545d5ce02676cd6ae67886a8bf82df
+ languageName: node
+ linkType: hard
+
"micromark-extension-mdxjs-esm@npm:^1.0.0":
version: 1.0.5
resolution: "micromark-extension-mdxjs-esm@npm:1.0.5"
@@ -20060,6 +20379,23 @@ __metadata:
languageName: node
linkType: hard
+"micromark-extension-mdxjs-esm@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "micromark-extension-mdxjs-esm@npm:3.0.0"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-core-commonmark: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-events-to-acorn: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ unist-util-position-from-estree: "npm:^2.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: 13e3f726495a960650cdedcba39198ace5bdc953ccb12c14d71fc9ed9bb88e40cc3ba9231e973f6984da3b3573e7ddb23ce409f7c16f52a8d57b608bf46c748d
+ languageName: node
+ linkType: hard
+
"micromark-extension-mdxjs@npm:^1.0.0":
version: 1.0.1
resolution: "micromark-extension-mdxjs@npm:1.0.1"
@@ -20076,6 +20412,22 @@ __metadata:
languageName: node
linkType: hard
+"micromark-extension-mdxjs@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "micromark-extension-mdxjs@npm:3.0.0"
+ dependencies:
+ acorn: "npm:^8.0.0"
+ acorn-jsx: "npm:^5.0.0"
+ micromark-extension-mdx-expression: "npm:^3.0.0"
+ micromark-extension-mdx-jsx: "npm:^3.0.0"
+ micromark-extension-mdx-md: "npm:^2.0.0"
+ micromark-extension-mdxjs-esm: "npm:^3.0.0"
+ micromark-util-combine-extensions: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: fd84f036ddad0aabbc12e7f1b3e9dcfe31573bbc413c5ae903779ef0366d7a4c08193547e7ba75718c9f45654e45f52e575cfc2f23a5f89205a8a70d9a506aea
+ languageName: node
+ linkType: hard
+
"micromark-factory-destination@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-factory-destination@npm:1.1.0"
@@ -20087,6 +20439,17 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-destination@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-factory-destination@npm:2.0.0"
+ dependencies:
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: b73492f687d41a6a379159c2f3acbf813042346bcea523d9041d0cc6124e6715f0779dbb2a0b3422719e9764c3b09f9707880aa159557e3cb4aeb03b9d274915
+ languageName: node
+ linkType: hard
+
"micromark-factory-label@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-factory-label@npm:1.1.0"
@@ -20099,6 +20462,18 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-label@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-factory-label@npm:2.0.0"
+ dependencies:
+ devlop: "npm:^1.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 8ffad00487a7891941b1d1f51d53a33c7a659dcf48617edb7a4008dad7aff67ec316baa16d55ca98ae3d75ce1d81628dbf72fedc7c6f108f740dec0d5d21c8ee
+ languageName: node
+ linkType: hard
+
"micromark-factory-mdx-expression@npm:^1.0.0":
version: 1.0.9
resolution: "micromark-factory-mdx-expression@npm:1.0.9"
@@ -20115,6 +20490,22 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-mdx-expression@npm:^2.0.0":
+ version: 2.0.1
+ resolution: "micromark-factory-mdx-expression@npm:2.0.1"
+ dependencies:
+ "@types/estree": "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-events-to-acorn: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ unist-util-position-from-estree: "npm:^2.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: d9cf475a73a7fbfa09aba0d057e033d57e45b7adff78692be9efb4405c4a1717ece4594a632f92a4302e4f8f2ae96355785b616e3f5b2fe8599ec24cfdeee12d
+ languageName: node
+ linkType: hard
+
"micromark-factory-space@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-factory-space@npm:1.1.0"
@@ -20125,6 +20516,16 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-space@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-factory-space@npm:2.0.0"
+ dependencies:
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 103ca954dade963d4ff1d2f27d397833fe855ddc72590205022832ef68b775acdea67949000cee221708e376530b1de78c745267b0bf8366740840783eb37122
+ languageName: node
+ linkType: hard
+
"micromark-factory-title@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-factory-title@npm:1.1.0"
@@ -20137,6 +20538,18 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-title@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-factory-title@npm:2.0.0"
+ dependencies:
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 2b2188e7a011b1b001faf8c860286d246d5c3485ef8819270c60a5808f4c7613e49d4e481dbdff62600ef7acdba0f5100be2d125cbd2a15e236c26b3668a8ebd
+ languageName: node
+ linkType: hard
+
"micromark-factory-whitespace@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-factory-whitespace@npm:1.1.0"
@@ -20149,6 +20562,18 @@ __metadata:
languageName: node
linkType: hard
+"micromark-factory-whitespace@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-factory-whitespace@npm:2.0.0"
+ dependencies:
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 4e91baab0cc71873095134bd0e225d01d9786cde352701402d71b72d317973954754e8f9f1849901f165530e6421202209f4d97c460a27bb0808ec5a3fc3148c
+ languageName: node
+ linkType: hard
+
"micromark-util-character@npm:^1.0.0":
version: 1.2.0
resolution: "micromark-util-character@npm:1.2.0"
@@ -20159,6 +20584,16 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-character@npm:^2.0.0":
+ version: 2.0.1
+ resolution: "micromark-util-character@npm:2.0.1"
+ dependencies:
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 5b91c90f29c8873a9f2f2385bbeb70f481b0e56c26092451d1796cd323257927a69eccca19b079d83d5751ec6fc92964214a3c868114555f87631426631df6b9
+ languageName: node
+ linkType: hard
+
"micromark-util-chunked@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-chunked@npm:1.1.0"
@@ -20168,6 +20603,15 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-chunked@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-chunked@npm:2.0.0"
+ dependencies:
+ micromark-util-symbol: "npm:^2.0.0"
+ checksum: 043b5f2abc8c13a1e2e4c378ead191d1a47ed9e0cd6d0fa5a0a430b2df9e17ada9d5de5a20688a000bbc5932507e746144acec60a9589d9a79fa60918e029203
+ languageName: node
+ linkType: hard
+
"micromark-util-classify-character@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-classify-character@npm:1.1.0"
@@ -20179,6 +20623,17 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-classify-character@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-classify-character@npm:2.0.0"
+ dependencies:
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 2bf5fa5050faa9b69f6c7e51dbaaf02329ab70fabad8229984381b356afbbf69db90f4617bec36d814a7d285fb7cad8e3c4e38d1daf4387dc9e240aa7f9a292a
+ languageName: node
+ linkType: hard
+
"micromark-util-combine-extensions@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-combine-extensions@npm:1.1.0"
@@ -20189,6 +20644,16 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-combine-extensions@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-combine-extensions@npm:2.0.0"
+ dependencies:
+ micromark-util-chunked: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: cd4c8d1a85255527facb419ff3b3cc3d7b7f27005c5ef5fa7ef2c4d0e57a9129534fc292a188ec2d467c2c458642d369c5f894bc8a9e142aed6696cc7989d3ea
+ languageName: node
+ linkType: hard
+
"micromark-util-decode-numeric-character-reference@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-decode-numeric-character-reference@npm:1.1.0"
@@ -20198,6 +20663,15 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-decode-numeric-character-reference@npm:^2.0.0":
+ version: 2.0.1
+ resolution: "micromark-util-decode-numeric-character-reference@npm:2.0.1"
+ dependencies:
+ micromark-util-symbol: "npm:^2.0.0"
+ checksum: 3f6d684ee8f317c67806e19b3e761956256cb936a2e0533aad6d49ac5604c6536b2041769c6febdd387ab7175b7b7e551851bf2c1f78da943e7a3671ca7635ac
+ languageName: node
+ linkType: hard
+
"micromark-util-decode-string@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-decode-string@npm:1.1.0"
@@ -20210,6 +20684,18 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-decode-string@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-decode-string@npm:2.0.0"
+ dependencies:
+ decode-named-character-reference: "npm:^1.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-decode-numeric-character-reference: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ checksum: f5413bebb21bdb686cfa1bcfa7e9c93093a523d1b42443ead303b062d2d680a94e5e8424549f57b8ba9d786a758e5a26a97f56068991bbdbca5d1885b3aa7227
+ languageName: node
+ linkType: hard
+
"micromark-util-encode@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-encode@npm:1.1.0"
@@ -20217,6 +20703,13 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-encode@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-encode@npm:2.0.0"
+ checksum: ebdaafff23100bbf4c74e63b4b1612a9ddf94cd7211d6a076bc6fb0bc32c1b48d6fb615aa0953e607c62c97d849f97f1042260d3eb135259d63d372f401bbbb2
+ languageName: node
+ linkType: hard
+
"micromark-util-events-to-acorn@npm:^1.0.0":
version: 1.2.3
resolution: "micromark-util-events-to-acorn@npm:1.2.3"
@@ -20233,6 +20726,22 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-events-to-acorn@npm:^2.0.0":
+ version: 2.0.2
+ resolution: "micromark-util-events-to-acorn@npm:2.0.2"
+ dependencies:
+ "@types/acorn": "npm:^4.0.0"
+ "@types/estree": "npm:^1.0.0"
+ "@types/unist": "npm:^3.0.0"
+ devlop: "npm:^1.0.0"
+ estree-util-visit: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: 2bd2660a49efddb625e6adcabdc3384ae4c50c7a04270737270f4aab53d09e8253e6d2607cd947c4c77f8a9900278915babb240e61fd143dc5bab51d9fd50709
+ languageName: node
+ linkType: hard
+
"micromark-util-html-tag-name@npm:^1.0.0":
version: 1.2.0
resolution: "micromark-util-html-tag-name@npm:1.2.0"
@@ -20240,6 +20749,13 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-html-tag-name@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-html-tag-name@npm:2.0.0"
+ checksum: 988aa26367449bd345b627ae32cf605076daabe2dc1db71b578a8a511a47123e14af466bcd6dcbdacec60142f07bc2723ec5f7a0eed0f5319ce83b5e04825429
+ languageName: node
+ linkType: hard
+
"micromark-util-normalize-identifier@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-normalize-identifier@npm:1.1.0"
@@ -20249,6 +20765,15 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-normalize-identifier@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-normalize-identifier@npm:2.0.0"
+ dependencies:
+ micromark-util-symbol: "npm:^2.0.0"
+ checksum: 93bf8789b8449538f22cf82ac9b196363a5f3b2f26efd98aef87c4c1b1f8c05be3ef6391ff38316ff9b03c1a6fd077342567598019ddd12b9bd923dacc556333
+ languageName: node
+ linkType: hard
+
"micromark-util-resolve-all@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-resolve-all@npm:1.1.0"
@@ -20258,6 +20783,15 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-resolve-all@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-resolve-all@npm:2.0.0"
+ dependencies:
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 3b912e88453dcefe728a9080c8934a75ac4732056d6576ceecbcaf97f42c5d6fa2df66db8abdc8427eb167c5ffddefe26713728cfe500bc0e314ed260d6e2746
+ languageName: node
+ linkType: hard
+
"micromark-util-sanitize-uri@npm:^1.0.0":
version: 1.2.0
resolution: "micromark-util-sanitize-uri@npm:1.2.0"
@@ -20269,6 +20803,17 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-sanitize-uri@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-sanitize-uri@npm:2.0.0"
+ dependencies:
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-encode: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ checksum: 74763ca1c927dd520d3ab8fd9856a19740acf76fc091f0a1f5d4e99c8cd5f1b81c5a0be3efb564941a071fb6d85fd951103f2760eb6cff77b5ab3abe08341309
+ languageName: node
+ linkType: hard
+
"micromark-util-subtokenize@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-subtokenize@npm:1.1.0"
@@ -20281,6 +20826,18 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-subtokenize@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-subtokenize@npm:2.0.0"
+ dependencies:
+ devlop: "npm:^1.0.0"
+ micromark-util-chunked: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 1907c56c4974d430b984c50b3eb0930241112d931e611f178dee17d58f2976614950631b70f4e9c7e49dbccf21f91654ee61f250e028bf2f2b0f3d3aeb168da8
+ languageName: node
+ linkType: hard
+
"micromark-util-symbol@npm:^1.0.0":
version: 1.1.0
resolution: "micromark-util-symbol@npm:1.1.0"
@@ -20288,6 +20845,13 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-symbol@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-symbol@npm:2.0.0"
+ checksum: 4e76186c185ce4cefb9cea8584213d9ffacd77099d1da30c0beb09fa21f46f66f6de4c84c781d7e34ff763fe3a06b530e132fa9004882afab9e825238d0aa8b3
+ languageName: node
+ linkType: hard
+
"micromark-util-types@npm:^1.0.0, micromark-util-types@npm:^1.0.1":
version: 1.1.0
resolution: "micromark-util-types@npm:1.1.0"
@@ -20295,6 +20859,13 @@ __metadata:
languageName: node
linkType: hard
+"micromark-util-types@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "micromark-util-types@npm:2.0.0"
+ checksum: d74e913b9b61268e0d6939f4209e3abe9dada640d1ee782419b04fd153711112cfaaa3c4d5f37225c9aee1e23c3bb91a1f5223e1e33ba92d33e83956a53e61de
+ languageName: node
+ linkType: hard
+
"micromark@npm:^3.0.0":
version: 3.2.0
resolution: "micromark@npm:3.2.0"
@@ -20320,6 +20891,31 @@ __metadata:
languageName: node
linkType: hard
+"micromark@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "micromark@npm:4.0.0"
+ dependencies:
+ "@types/debug": "npm:^4.0.0"
+ debug: "npm:^4.0.0"
+ decode-named-character-reference: "npm:^1.0.0"
+ devlop: "npm:^1.0.0"
+ micromark-core-commonmark: "npm:^2.0.0"
+ micromark-factory-space: "npm:^2.0.0"
+ micromark-util-character: "npm:^2.0.0"
+ micromark-util-chunked: "npm:^2.0.0"
+ micromark-util-combine-extensions: "npm:^2.0.0"
+ micromark-util-decode-numeric-character-reference: "npm:^2.0.0"
+ micromark-util-encode: "npm:^2.0.0"
+ micromark-util-normalize-identifier: "npm:^2.0.0"
+ micromark-util-resolve-all: "npm:^2.0.0"
+ micromark-util-sanitize-uri: "npm:^2.0.0"
+ micromark-util-subtokenize: "npm:^2.0.0"
+ micromark-util-symbol: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ checksum: 7e91c8d19ff27bc52964100853f1b3b32bb5b2ece57470a34ba1b2f09f4e2a183d90106c4ae585c9f2046969ee088576fed79b2f7061cba60d16652ccc2c64fd
+ languageName: node
+ linkType: hard
+
"micromark@npm:~2.11.0":
version: 2.11.4
resolution: "micromark@npm:2.11.4"
@@ -22378,7 +22974,7 @@ __metadata:
languageName: node
linkType: hard
-"periscopic@npm:^3.1.0":
+"periscopic@npm:^3.0.0, periscopic@npm:^3.1.0":
version: 3.1.0
resolution: "periscopic@npm:3.1.0"
dependencies:
@@ -22410,7 +23006,7 @@ __metadata:
languageName: node
linkType: hard
-"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.2, picomatch@npm:^2.2.3, picomatch@npm:^2.3.0, picomatch@npm:^2.3.1":
+"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.0, picomatch@npm:^2.3.1":
version: 2.3.1
resolution: "picomatch@npm:2.3.1"
checksum: 26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be
@@ -23077,6 +23673,13 @@ __metadata:
languageName: node
linkType: hard
+"property-information@npm:^6.0.0":
+ version: 6.4.0
+ resolution: "property-information@npm:6.4.0"
+ checksum: 48ba202f12c6abc82d37135452377dd528fae90a151bcffb28582d58d9db6e42ce835c91e2fcb12e875200b32bcaed90de4807dfb37c687f7cccf2597ccb55e1
+ languageName: node
+ linkType: hard
+
"proxy-addr@npm:~2.0.7":
version: 2.0.7
resolution: "proxy-addr@npm:2.0.7"
@@ -24378,6 +24981,16 @@ __metadata:
languageName: node
linkType: hard
+"remark-mdx@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "remark-mdx@npm:3.0.0"
+ dependencies:
+ mdast-util-mdx: "npm:^3.0.0"
+ micromark-extension-mdxjs: "npm:^3.0.0"
+ checksum: e7a59428c55753f89f1bd299bc92cfd96fb3289285384b631f8af253d8df6473ebdba085e6d1a846b55b46700aafc76f35810a3268733e6a7c676bc2a8648f17
+ languageName: node
+ linkType: hard
+
"remark-message-control@npm:^6.0.0":
version: 6.0.0
resolution: "remark-message-control@npm:6.0.0"
@@ -24399,6 +25012,18 @@ __metadata:
languageName: node
linkType: hard
+"remark-parse@npm:^11.0.0":
+ version: 11.0.0
+ resolution: "remark-parse@npm:11.0.0"
+ dependencies:
+ "@types/mdast": "npm:^4.0.0"
+ mdast-util-from-markdown: "npm:^2.0.0"
+ micromark-util-types: "npm:^2.0.0"
+ unified: "npm:^11.0.0"
+ checksum: 6eed15ddb8680eca93e04fcb2d1b8db65a743dcc0023f5007265dda558b09db595a087f622062ccad2630953cd5cddc1055ce491d25a81f3317c858348a8dd38
+ languageName: node
+ linkType: hard
+
"remark-parse@npm:^9.0.0":
version: 9.0.0
resolution: "remark-parse@npm:9.0.0"
@@ -24432,6 +25057,19 @@ __metadata:
languageName: node
linkType: hard
+"remark-rehype@npm:^11.0.0":
+ version: 11.0.0
+ resolution: "remark-rehype@npm:11.0.0"
+ dependencies:
+ "@types/hast": "npm:^3.0.0"
+ "@types/mdast": "npm:^4.0.0"
+ mdast-util-to-hast: "npm:^13.0.0"
+ unified: "npm:^11.0.0"
+ vfile: "npm:^6.0.0"
+ checksum: d88180819f6695bc4f257cffcbe201973fc946144cc0101da589f25f3238932e384e98a8897b6060948ad2b5679eb2de5a720866b8b6f36b74e9f20e3e0b1d5d
+ languageName: node
+ linkType: hard
+
"remark-slug@npm:^6.0.0":
version: 6.1.0
resolution: "remark-slug@npm:6.1.0"
@@ -24647,7 +25285,7 @@ __metadata:
languageName: node
linkType: hard
-"resolve@npm:1.22.8, resolve@npm:^1.10.0, resolve@npm:^1.12.0, resolve@npm:^1.13.1, resolve@npm:^1.14.2, resolve@npm:^1.15.1, resolve@npm:^1.17.0, resolve@npm:^1.19.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4, resolve@npm:^1.22.8, resolve@npm:^1.4.0":
+"resolve@npm:1.22.8, resolve@npm:^1.10.0, resolve@npm:^1.12.0, resolve@npm:^1.13.1, resolve@npm:^1.14.2, resolve@npm:^1.15.1, resolve@npm:^1.17.0, resolve@npm:^1.19.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4, resolve@npm:^1.4.0":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
dependencies:
@@ -24673,7 +25311,7 @@ __metadata:
languageName: node
linkType: hard
-"resolve@patch:resolve@npm%3A1.22.8#optional!builtin, resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.12.0#optional!builtin, resolve@patch:resolve@npm%3A^1.13.1#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin, resolve@patch:resolve@npm%3A^1.15.1#optional!builtin, resolve@patch:resolve@npm%3A^1.17.0#optional!builtin, resolve@patch:resolve@npm%3A^1.19.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin, resolve@patch:resolve@npm%3A^1.22.8#optional!builtin, resolve@patch:resolve@npm%3A^1.4.0#optional!builtin":
+"resolve@patch:resolve@npm%3A1.22.8#optional!builtin, resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.12.0#optional!builtin, resolve@patch:resolve@npm%3A^1.13.1#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin, resolve@patch:resolve@npm%3A^1.15.1#optional!builtin, resolve@patch:resolve@npm%3A^1.17.0#optional!builtin, resolve@patch:resolve@npm%3A^1.19.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin, resolve@patch:resolve@npm%3A^1.4.0#optional!builtin":
version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d"
dependencies:
@@ -24826,7 +25464,7 @@ __metadata:
languageName: node
linkType: hard
-"rollup@npm:^3.20.1, rollup@npm:^3.27.1":
+"rollup@npm:^3.27.1":
version: 3.29.4
resolution: "rollup@npm:3.29.4"
dependencies:
@@ -25875,7 +26513,7 @@ __metadata:
languageName: node
linkType: hard
-"source-map@npm:0.7.4, source-map@npm:^0.7.3, source-map@npm:^0.7.4":
+"source-map@npm:0.7.4, source-map@npm:^0.7.0, source-map@npm:^0.7.3, source-map@npm:^0.7.4":
version: 0.7.4
resolution: "source-map@npm:0.7.4"
checksum: dc0cf3768fe23c345ea8760487f8c97ef6fca8a73c83cd7c9bf2fde8bc2c34adb9c0824d6feb14bc4f9e37fb522e18af621543f1289038a66ac7586da29aa7dc
@@ -25912,6 +26550,13 @@ __metadata:
languageName: node
linkType: hard
+"space-separated-tokens@npm:^2.0.0":
+ version: 2.0.2
+ resolution: "space-separated-tokens@npm:2.0.2"
+ checksum: 6173e1d903dca41dcab6a2deed8b4caf61bd13b6d7af8374713500570aa929ff9414ae09a0519f4f8772df993300305a395d4871f35bc4ca72b6db57e1f30af8
+ languageName: node
+ linkType: hard
+
"spawn-command@npm:^0.0.2-1":
version: 0.0.2
resolution: "spawn-command@npm:0.0.2"
@@ -26454,6 +27099,24 @@ __metadata:
languageName: node
linkType: hard
+"style-to-object@npm:^0.4.0":
+ version: 0.4.4
+ resolution: "style-to-object@npm:0.4.4"
+ dependencies:
+ inline-style-parser: "npm:0.1.1"
+ checksum: 3a733080da66952881175b17d65f92985cf94c1ca358a92cf21b114b1260d49b94a404ed79476047fb95698d64c7e366ca7443f0225939e2fb34c38bbc9c7639
+ languageName: node
+ linkType: hard
+
+"style-to-object@npm:^1.0.0":
+ version: 1.0.5
+ resolution: "style-to-object@npm:1.0.5"
+ dependencies:
+ inline-style-parser: "npm:0.2.2"
+ checksum: 39bbc5e9f82a80d6a84c134bf49ba50402bf90304af4281fdd317c9792436c166b2f3a2a3d9a65e3f2a3360b35fe4e352932ec9a51513b9864bfd80b7f5a82e1
+ languageName: node
+ linkType: hard
+
"styled-jsx@npm:5.1.1":
version: 5.1.1
resolution: "styled-jsx@npm:5.1.1"
@@ -26655,29 +27318,9 @@ __metadata:
languageName: node
linkType: hard
-"svelte@npm:^5.0.0-next.16":
- version: 5.0.0-next.22
- resolution: "svelte@npm:5.0.0-next.22"
- dependencies:
- "@ampproject/remapping": "npm:^2.2.1"
- "@jridgewell/sourcemap-codec": "npm:^1.4.15"
- acorn: "npm:^8.10.0"
- acorn-typescript: "npm:^1.4.11"
- aria-query: "npm:^5.3.0"
- axobject-query: "npm:^4.0.0"
- esm-env: "npm:^1.0.0"
- esrap: "npm:^1.2.1"
- is-reference: "npm:^3.0.1"
- locate-character: "npm:^3.0.0"
- magic-string: "npm:^0.30.4"
- zimmerframe: "npm:^1.1.0"
- checksum: 121c0ffe925f3393581742a970d58588ac642f15d17062af16f46b4729064d48214ee158261fbcdff78b6ee143f4da361d3e696507c8c7c31580e2040e366539
- languageName: node
- linkType: hard
-
-"svelte@npm:^5.0.0-next.22":
- version: 5.0.0-next.26
- resolution: "svelte@npm:5.0.0-next.26"
+"svelte@npm:^5.0.0-next.28":
+ version: 5.0.0-next.28
+ resolution: "svelte@npm:5.0.0-next.28"
dependencies:
"@ampproject/remapping": "npm:^2.2.1"
"@jridgewell/sourcemap-codec": "npm:^1.4.15"
@@ -26691,7 +27334,7 @@ __metadata:
locate-character: "npm:^3.0.0"
magic-string: "npm:^0.30.4"
zimmerframe: "npm:^1.1.0"
- checksum: 76e5874b7afd8f9770b716ea3422c5d0e7e45a85c01bc1fa7daa43b3ae4d38ee073da7a958e3826d0370718fbdf9477769785754b8606a7403460e027f034b60
+ checksum: d309cd3d1a9fe16c67a626af867288b02f6e7c49311c851aeb0f36feb5ab9603ca5594338fb933dbbada41b26faea6dcef52ed6ab3e86f54626545e53059eb28
languageName: node
linkType: hard
@@ -27190,6 +27833,13 @@ __metadata:
languageName: node
linkType: hard
+"trim-lines@npm:^3.0.0":
+ version: 3.0.1
+ resolution: "trim-lines@npm:3.0.1"
+ checksum: 3a1611fa9e52aa56a94c69951a9ea15b8aaad760eaa26c56a65330dc8adf99cb282fc07cc9d94968b7d4d88003beba220a7278bbe2063328eb23fb56f9509e94
+ languageName: node
+ linkType: hard
+
"trough@npm:^1.0.0":
version: 1.0.5
resolution: "trough@npm:1.0.5"
@@ -27690,6 +28340,21 @@ __metadata:
languageName: node
linkType: hard
+"unified@npm:^11.0.0":
+ version: 11.0.4
+ resolution: "unified@npm:11.0.4"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ bail: "npm:^2.0.0"
+ devlop: "npm:^1.0.0"
+ extend: "npm:^3.0.0"
+ is-plain-obj: "npm:^4.0.0"
+ trough: "npm:^2.0.0"
+ vfile: "npm:^6.0.0"
+ checksum: b550cdc994d54c84e2e098eb02cfa53535cbc140c148aa3296f235cb43082b499d239110f342fa65eb37ad919472a93cc62f062a83541485a69498084cc87ba1
+ languageName: node
+ linkType: hard
+
"unified@npm:^9.1.0":
version: 9.2.2
resolution: "unified@npm:9.2.2"
@@ -27802,6 +28467,15 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-is@npm:^6.0.0":
+ version: 6.0.0
+ resolution: "unist-util-is@npm:6.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ checksum: 9419352181eaa1da35eca9490634a6df70d2217815bb5938a04af3a662c12c5607a2f1014197ec9c426fbef18834f6371bfdb6f033040fa8aa3e965300d70e7e
+ languageName: node
+ linkType: hard
+
"unist-util-position-from-estree@npm:^1.0.0, unist-util-position-from-estree@npm:^1.1.0":
version: 1.1.2
resolution: "unist-util-position-from-estree@npm:1.1.2"
@@ -27811,6 +28485,15 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-position-from-estree@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "unist-util-position-from-estree@npm:2.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ checksum: 39127bf5f0594e0a76d9241dec4f7aa26323517120ce1edd5ed91c8c1b9df7d6fb18af556e4b6250f1c7368825720ed892e2b6923be5cdc08a9bb16536dc37b3
+ languageName: node
+ linkType: hard
+
"unist-util-position@npm:^3.0.0, unist-util-position@npm:^3.1.0":
version: 3.1.0
resolution: "unist-util-position@npm:3.1.0"
@@ -27818,6 +28501,15 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-position@npm:^5.0.0":
+ version: 5.0.0
+ resolution: "unist-util-position@npm:5.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ checksum: dde3b31e314c98f12b4dc6402f9722b2bf35e96a4f2d463233dd90d7cde2d4928074a7a11eff0a5eb1f4e200f27fc1557e0a64a7e8e4da6558542f251b1b7400
+ languageName: node
+ linkType: hard
+
"unist-util-remove-position@npm:^4.0.0":
version: 4.0.2
resolution: "unist-util-remove-position@npm:4.0.2"
@@ -27828,6 +28520,16 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-remove-position@npm:^5.0.0":
+ version: 5.0.0
+ resolution: "unist-util-remove-position@npm:5.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ unist-util-visit: "npm:^5.0.0"
+ checksum: e8c76da4399446b3da2d1c84a97c607b37d03d1d92561e14838cbe4fdcb485bfc06c06cfadbb808ccb72105a80643976d0660d1fe222ca372203075be9d71105
+ languageName: node
+ linkType: hard
+
"unist-util-select@npm:^4.0.3":
version: 4.0.3
resolution: "unist-util-select@npm:4.0.3"
@@ -27858,6 +28560,15 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-stringify-position@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "unist-util-stringify-position@npm:4.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ checksum: dfe1dbe79ba31f589108cb35e523f14029b6675d741a79dea7e5f3d098785045d556d5650ec6a8338af11e9e78d2a30df12b1ee86529cded1098da3f17ee999e
+ languageName: node
+ linkType: hard
+
"unist-util-visit-parents@npm:^3.0.0":
version: 3.1.1
resolution: "unist-util-visit-parents@npm:3.1.1"
@@ -27878,6 +28589,16 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-visit-parents@npm:^6.0.0":
+ version: 6.0.1
+ resolution: "unist-util-visit-parents@npm:6.0.1"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ unist-util-is: "npm:^6.0.0"
+ checksum: 51b1a5b0aa23c97d3e03e7288f0cdf136974df2217d0999d3de573c05001ef04cccd246f51d2ebdfb9e8b0ed2704451ad90ba85ae3f3177cf9772cef67f56206
+ languageName: node
+ linkType: hard
+
"unist-util-visit@npm:^2.0.0":
version: 2.0.3
resolution: "unist-util-visit@npm:2.0.3"
@@ -27900,6 +28621,17 @@ __metadata:
languageName: node
linkType: hard
+"unist-util-visit@npm:^5.0.0":
+ version: 5.0.0
+ resolution: "unist-util-visit@npm:5.0.0"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ unist-util-is: "npm:^6.0.0"
+ unist-util-visit-parents: "npm:^6.0.0"
+ checksum: 51434a1d80252c1540cce6271a90fd1a106dbe624997c09ed8879279667fb0b2d3a685e02e92bf66598dcbe6cdffa7a5f5fb363af8fdf90dda6c855449ae39a5
+ languageName: node
+ linkType: hard
+
"universal-user-agent@npm:^5.0.0":
version: 5.0.0
resolution: "universal-user-agent@npm:5.0.0"
@@ -28272,6 +29004,16 @@ __metadata:
languageName: node
linkType: hard
+"vfile-message@npm:^4.0.0":
+ version: 4.0.2
+ resolution: "vfile-message@npm:4.0.2"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ unist-util-stringify-position: "npm:^4.0.0"
+ checksum: 07671d239a075f888b78f318bc1d54de02799db4e9dce322474e67c35d75ac4a5ac0aaf37b18801d91c9f8152974ea39678aa72d7198758b07f3ba04fb7d7514
+ languageName: node
+ linkType: hard
+
"vfile-reporter@npm:^6.0.0":
version: 6.0.2
resolution: "vfile-reporter@npm:6.0.2"
@@ -28324,6 +29066,17 @@ __metadata:
languageName: node
linkType: hard
+"vfile@npm:^6.0.0":
+ version: 6.0.1
+ resolution: "vfile@npm:6.0.1"
+ dependencies:
+ "@types/unist": "npm:^3.0.0"
+ unist-util-stringify-position: "npm:^4.0.0"
+ vfile-message: "npm:^4.0.0"
+ checksum: 443bda43e5ad3b73c5976e987dba2b2d761439867ba7d5d7c5f4b01d3c1cb1b976f5f0e6b2399a00dc9b4eaec611bd9984ce9ce8a75a72e60aed518b10a902d2
+ languageName: node
+ linkType: hard
+
"vite-node@npm:1.0.4":
version: 1.0.4
resolution: "vite-node@npm:1.0.4"
@@ -28466,18 +29219,6 @@ __metadata:
languageName: node
linkType: hard
-"vitefu@npm:^0.2.4":
- version: 0.2.4
- resolution: "vitefu@npm:0.2.4"
- peerDependencies:
- vite: ^3.0.0 || ^4.0.0
- peerDependenciesMeta:
- vite:
- optional: true
- checksum: 78d5e7071c0c4fdfc010f15a3e5bac2d31090ddd48789446fce5b7d0f01496fc6a041b65d3add904365bb0ac6576bb93635f700971c16ffd27cd7c0bee9eb1ae
- languageName: node
- linkType: hard
-
"vitefu@npm:^0.2.5":
version: 0.2.5
resolution: "vitefu@npm:0.2.5"
diff --git a/docs/addons/writing-addons.md b/docs/addons/writing-addons.md
index f160bcdb36a..ca963041014 100644
--- a/docs/addons/writing-addons.md
+++ b/docs/addons/writing-addons.md
@@ -94,6 +94,8 @@ By default, code for the UI-based addons is located in one of the following file
Going through the code blocks in sequence:
```ts
+// src/Tool.tsx
+
import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { Icons, IconButton } from '@storybook/components';
@@ -102,6 +104,8 @@ import { Icons, IconButton } from '@storybook/components';
The [`useGlobals`](./addons-api.md#useglobals) and [`useStorybookApi`](./addons-api.md#usestorybookapi) hooks from the `manager-api` package are used to access the Storybook's APIs, allowing users to interact with the addon, such as enabling or disabling it. The `Icons` and `IconButtons` components from the [`@storybook/components`](https://www.npmjs.com/package/@storybook/components) package render the icons and buttons in the toolbar.
```ts
+// src/Tool.tsx
+
export const Tool = memo(function MyAddonSelector() {
const [globals, updateGlobals] = useGlobals();
const api = useStorybookApi();
@@ -201,56 +205,47 @@ Storybook addons, similar to most packages in the JavaScript ecosystem, are dist
1. Have a `dist` folder with the transpiled code.
2. A `package.json` file declaring:
- - Peer dependencies
- Module-related information
- Integration catalog metadata
### Module Metadata
-The first category of metadata is related to the addon itself. This includes the entry for the module and which files to include when the addon is published. And all the peer-dependencies of the addon (e.g., `react`,`react-dom`, and Storybook's related APIs).
+The first category of metadata is related to the addon itself. This includes the entry for the module, which files to include when the addon is published. And the required configuration to integrate the addon with Storybook, allowing it to be used by its consumers.
```json
{
"exports": {
".": {
+ "types": "./dist/index.d.ts",
+ "node": "./dist/index.js",
"require": "./dist/index.js",
- "import": "./dist/index.mjs",
- "types": "./dist/index.d.ts"
- },
- "./manager": {
- "require": "./dist/manager.js",
- "import": "./dist/manager.mjs",
- "types": "./dist/manager.d.ts"
- },
- "./preview": {
- "require": "./dist/preview.js",
- "import": "./dist/preview.mjs",
- "types": "./dist/preview.d.ts"
+ "import": "./dist/index.mjs"
},
+ "./manager": "./dist/manager.mjs",
+ "./preview": "./dist/preview.mjs",
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": ["dist/**/*", "README.md", "*.js", "*.d.ts"],
- "peerDependencies": {
+ "devDependencies": {
"@storybook/blocks": "^7.0.0",
"@storybook/components": "^7.0.0",
"@storybook/core-events": "^7.0.0",
"@storybook/manager-api": "^7.0.0",
"@storybook/preview-api": "^7.0.0",
"@storybook/theming": "^7.0.0",
- "@storybook/types": "^7.0.0",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ "@storybook/types": "^7.0.0"
+ },
+ "bundler": {
+ "exportEntries": ["src/index.ts"],
+ "managerEntries": ["src/manager.ts"],
+ "previewEntries": ["src/preview.ts"]
}
}
```
-#### Why peer-dependencies?
-
-A standard practice in the JavaScript ecosystem ensuring compatibility between modules or packages that are meant to work together, often in a plugin or extension scenario. Peer-dependencies are dependencies that are not bundled with the addon but are expected to be installed by the consumer of the addon. When a module relies on a specific version of another module, it might assume certain features, APIs, or behavior provided by that dependency. By specifying a peer dependency, the module can indicate its compatibility requirements and avoid potential conflicts or unexpected behavior due to incompatible versions.
-
### Integration Catalog Metadata
The second metadata category is related to the [integration catalog](https://storybook.js.org/integrations). Most of this information is already pre-configured by the Addon Kit. However, items like the display name, icon, and frameworks must be configured via the `storybook` property to be displayed in the catalog.
diff --git a/docs/api/cli-options.md b/docs/api/cli-options.md
index 1ccbb4d1f12..ee164e45e49 100644
--- a/docs/api/cli-options.md
+++ b/docs/api/cli-options.md
@@ -30,7 +30,6 @@ Options include:
| `-V`, `--version` | Output the version number `storybook dev -V` |
| `-p`, `--port [number]` | Port to run Storybook `storybook dev -p 9009` |
| `-h`, `--host [string]` | Host to run Storybook `storybook dev -h my-host.com` |
-| `-s`, `--static-dir` | **Deprecated** [see note](#static-dir-deprecation). Directory where to load static files from, comma-separated list `storybook dev -s public` |
| `-c`, `--config-dir [dir-name]` | Directory where to load Storybook configurations from `storybook dev -c .storybook` |
| `--https` | Serve Storybook over HTTPS. Note: You must provide your own certificate information `storybook dev --https` |
| `--ssl-ca` | Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate) `storybook dev --ssl-ca my-certificate` |
@@ -47,7 +46,7 @@ Options include:
-Starting in 6.4 the `-s` flag is deprecated. Instead, use a configuration object in your `.storybook/main.js` file. See the [images and assets documentation](../configure/images-and-assets.md#serving-static-files-via-storybook) for more information.
+With the release of Storybook 8, the `-s` CLI flag was removed. We recommend using the [static directory](../configure/images-and-assets.md#serving-static-files-via-storybook) instead if you need to serve static files.
@@ -65,7 +64,6 @@ Options include:
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-h`, `--help` | Output usage information `storybook build --help` |
| `-V`, `--version` | Output the version number `storybook build -V` |
-| `-s`, `--static-dir` | **Deprecated** [see note](#static-dir-deprecation). Directory where to load static files from, comma-separated list `storybook build -s public` |
| `-o`, `--output-dir [dir-name]` | Directory where to store built files `storybook build -o /my-deployed-storybook` |
| `-c`, `--config-dir [dir-name]` | Directory where to load Storybook configurations from `storybook build -c .storybook` |
| `--loglevel [level]` | Controls level of logging during build. Available options: `silly`, `verbose`, `info` (default), `warn`, `error`, `silent` `storybook build --loglevel warn` |
diff --git a/docs/api/doc-block-controls.md b/docs/api/doc-block-controls.md
index d199c1f3ec9..fa753933cb3 100644
--- a/docs/api/doc-block-controls.md
+++ b/docs/api/doc-block-controls.md
@@ -31,7 +31,7 @@ import * as ButtonStories from './Button.stories'
-The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/index.md)).
+The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/index.md)) and haven't turned off inline stories with the [`inline`](./doc-block-story.md#inline) configuration option.
diff --git a/docs/api/doc-block-description.md b/docs/api/doc-block-description.md
index 1c188a23934..ce8254d7f57 100644
--- a/docs/api/doc-block-description.md
+++ b/docs/api/doc-block-description.md
@@ -37,30 +37,6 @@ Specifies where to pull the description from. It can either point to a story or
Descriptions are pulled from the JSDoc comments or parameters, and they are rendered as markdown. See [Writing descriptions](#writing-descriptions) for more details.
-### `children`
-
-(⛔️ **Deprecated**)
-
-Type: `string`
-
-See [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo).
-
-### `markdown`
-
-(⛔️ **Deprecated**)
-
-Type: `string`
-
-See [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo).
-
-### `type`
-
-(⛔️ **Deprecated**)
-
-Type: `'info' | 'notes' | 'docgen' | 'auto'`
-
-See [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo).
-
## Writing descriptions
There are multiple places to write the description of a component/story, depending on what you want to achieve. Descriptions can be written at the story level to describe each story of a component, or they can be written at the meta or component level to describe the component in general.
diff --git a/docs/api/doc-block-source.md b/docs/api/doc-block-source.md
index c4a46005043..1c4c68c5051 100644
--- a/docs/api/doc-block-source.md
+++ b/docs/api/doc-block-source.md
@@ -98,6 +98,18 @@ Light mode is only supported when the `Source` block is rendered independently.
+
+
+### `excludeDecorators`
+
+Type: `boolean`
+
+Default: `parameters.docs.source.excludeDecorators`
+
+Determines if [decorators](../writing-stories/decorators.md) are rendered in the source code snippet.
+
+
+
### `format`
Type: `boolean | 'dedent' | BuiltInParserName`
diff --git a/docs/api/doc-block-story.md b/docs/api/doc-block-story.md
index 0a3470429ac..179d683a2f4 100644
--- a/docs/api/doc-block-story.md
+++ b/docs/api/doc-block-story.md
@@ -96,6 +96,12 @@ Default: `parameters.docs.story.inline` or `true` (for [supported frameworks](..
Determines whether the story is rendered `inline` (in the same browser frame as the other docs content) or in an iframe.
+
+
+Setting the `inline` option to false will prevent the associated [controls](./doc-block-controls.md) from updating the story within the documentation page. This is a known limitation of the current implementation and will be addressed in a future release.
+
+
+
### `meta`
Type: CSF file exports
diff --git a/docs/api/main-config-build.md b/docs/api/main-config-build.md
index a206662bae4..e9c4c5adc00 100644
--- a/docs/api/main-config-build.md
+++ b/docs/api/main-config-build.md
@@ -25,11 +25,11 @@ Type: `TestBuildFlags`
}
```
-Configures Storybook's production builds for performance testing purposes by disabling certain features from the build. When running ' build-storybook ', this feature is enabled by setting the `--test` [flag](./cli-options.md#build).
+Configures Storybook's production builds for performance testing purposes by disabling certain features from the build. When running `build-storybook`, this feature is enabled by setting the `--test` [flag](./cli-options.md#build).
-Enabling these features can cause build or runtime errors with Storybook. We recommend enabling only the features you need for your project.
+The options documented on this page are automatically enabled when the `--test` flag is provided to the `build-storybook` command. We encourage you to override these options only if you need to disable a specific feature for your project or if you are debugging a build issue.
diff --git a/docs/api/main-config-features.md b/docs/api/main-config-features.md
index 81a80502a7b..f92ae24139a 100644
--- a/docs/api/main-config-features.md
+++ b/docs/api/main-config-features.md
@@ -54,23 +54,6 @@ Apply decorators from preview.js before decorators from addons or frameworks. [M
-## `legacyMdx1`
-
-Type: `boolean`
-
-Enables support for MDX version 1 as a fallback. Requires [@storybook/mdx1-csf](https://github.com/storybookjs/mdx1-csf) to be installed.
-
-
-
-
-
-
-
## `storyStoreV7`
Type: `boolean`
diff --git a/docs/configure/frameworks-feature-support.md b/docs/configure/frameworks-feature-support.md
index 306ee9e9416..498d984cabe 100644
--- a/docs/configure/frameworks-feature-support.md
+++ b/docs/configure/frameworks-feature-support.md
@@ -113,5 +113,5 @@ To align the Storybook ecosystem with the current state of frontend development,
| Feature | Status |
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Knobs](https://github.com/storybookjs/addon-knobs) | The Knobs addon was officially deprecated with the release of Storybook 6.3 and is no longer actively maintained. We recommend using the [controls](../essentials/controls.md) instead. |
-| [Storyshots](../writing-tests/snapshot-testing.md) | The Storyshots addon was officially deprecated with the release of Storybook 7.6 and is no longer actively maintained. See the [migration guide](../writing-tests/storyshots-migration-guide.md) for the available alternatives. |
+| [Storyshots](../writing-tests/snapshot-testing.md) | The Storyshots addon was officially deprecated with the release of Storybook 7.6, is no longer actively maintained and was removed in Storybook 8. See the [migration guide](../writing-tests/storyshots-migration-guide.md) for the available alternatives. |
| [`StoriesOf`](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md) | The `storiesOf` API was officially deprecated with the release of Storybook 7.5 and is no longer actively maintained. We recommend using the [CSF API](../api/csf.md) instead for writing stories. See the [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storystorev6-and-storiesof-is-deprecated) for more information. |
diff --git a/docs/configure/images-and-assets.md b/docs/configure/images-and-assets.md
index 7b4a0c071ad..3ff5ad2f899 100644
--- a/docs/configure/images-and-assets.md
+++ b/docs/configure/images-and-assets.md
@@ -101,10 +101,6 @@ Or even use a configuration object to define the directories:
-### **[⚠️ Deprecated]** Serving static files via Storybook CLI
-
-Using `--static-dir` or `-s` option with Storybook CLI is deprecated. It is recommended to use [Storybook static directory configuration option](#serving-static-files-via-storybook-configuration) instead.
-
### Reference assets from a CDN
Upload your files to an online CDN and reference them. In this example, we’re using a placeholder image service.
@@ -143,9 +139,7 @@ Suppose you are serving assets in a [static directory](#serving-static-files-via
### Referencing Fonts in Stories
-After configuring Storybook to serve assets from your static folder, you can reference those assets in Storybook. For example, you can reference and apply a custom font in your stories.
-
-Inside the `.storybook/` configuration folder, create `preview-head.html`, then use `` to reference your font.
+After configuring Storybook to serve assets from your static folder, you can reference those assets in Storybook. For example, you can reference and apply a custom font to your stories. To do this, create a [`preview-head.html`](./story-rendering.md) file inside the configuration directory (i.e., `.storybook`) and add a `` tag to reference your font.
diff --git a/docs/configure/index.md b/docs/configure/index.md
index ee38fd9a456..f8c904c925d 100644
--- a/docs/configure/index.md
+++ b/docs/configure/index.md
@@ -56,7 +56,6 @@ Additionally, you can also provide additional feature flags to your Storybook co
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `storyStoreV7` | Configures Storybook to load stories [on demand](#on-demand-story-loading), rather than during boot up (defaults to `true` as of `v7.0`) `features: { storyStoreV7: true }` |
| `buildStoriesJson` | Generates `index.json` and `stories.json` files to help story loading with the on-demand mode (defaults to `true` when `storyStoreV7` is `true`) `features: { buildStoriesJson: true }` |
-| `legacyMdx1` | Enables support for MDX version 1 as a fallback. Requires [`@storybook/mdx1-csf`](https://github.com/storybookjs/mdx1-csf) `features: { legacyMdx1: true }` |
## Configure story loading
diff --git a/docs/configure/styling-and-css.md b/docs/configure/styling-and-css.md
index f2e70a9b672..630e6e25ab7 100644
--- a/docs/configure/styling-and-css.md
+++ b/docs/configure/styling-and-css.md
@@ -2,15 +2,18 @@
title: 'Styling and CSS'
---
+
+
+
There are many ways to include CSS in a web application, and correspondingly there are many ways to include CSS in Storybook. Usually, it is best to try and replicate what your application does with styling in Storybook’s configuration.
-If you're using Vite to build your Storybook, you're covered! Storybook will use your vite config file which supports most popular styling tools out-of-the-box 🎉. However, if you're using Webpack, you may need some extra configuration. To make this easier, we recommend using [`@storybook/addon-styling-webpack`](https://storybook.js.org/addons/@storybook/addon-styling-webpack/).
+## CSS
-**Note**: If you're using Storybook with Angular or Next.js, you can skip this section. Storybook will automatically use the same styling configuration as your application.
+Storybook supports importing CSS files in a few different ways. Storybook will inject these tags into the preview iframe where your components render, not the Storybook Manager UI. The best way to import CSS depends on your project's configuration and your preferences.
-## Importing CSS files
+### Import bundled CSS (Recommended)
-Storybook is pre-configured to recognize imports for CSS files. To add global CSS for all your stories, import it in [`.storybook/preview.js`](./index.md#configure-story-rendering).
+All Storybooks are pre-configured to recognize imports for CSS files. To add global CSS for all your stories, import it in [`.storybook/preview.ts`](./overview.md#configure-story-rendering). These files will be subject to HMR, so you can see your changes without restarting your Storybook server.
@@ -23,13 +26,89 @@ Storybook is pre-configured to recognize imports for CSS files. To add global CS
-If your component files import their CSS files, this will work too. The noticeable exception to this is if you're using CSS processor tools like Sass or Postcss.
+If your component files import their CSS files, this will work too. However, if you're using CSS processor tools like Sass or Postcss, you may need some more configuration.
+
+### Include static CSS
+
+If you have a global CSS file that you want to include in all your stories, you can import it in [`.storybook/preview-head.html`](./story-rendering.md#adding-to-head).
+However, these files will not be subject to HMR, so you'll need to restart your Storybook server to see your changes.
+
+
+
+
+
+
-## CSS processors
+## CSS modules
-If you're using Vite as your builder, you're covered! Vite supports Sass and PostCSS out-of-the-box 🎉
+### Vite
-However, if you're using Webpack and want to use Sass and PostCss, you'll need some extra configuration. We recommend installing [`@storybook/addon-styling-webpack`](https://storybook.js.org/addons/@storybook/addon-styling-webpack/) to help you configure these tools. Or if you'd prefer, you can customize [Storybook's webpack configuration yourself](../builders/webpack.md#override-the-default-configuration) to include the appropriate loader(s).
+Vite comes with CSS modules support out-of-the-box. If you have customized the CSS modules configuration in your `vite.config.js` this will automatically be applied to your Storybook as well. Read more about [Vite's CSS modules support](https://vitejs.dev/guide/features.html#css-modules).
+
+### Webpack
+
+
+
+
+Storybook recreates your Next.js configuration, so you can use CSS modules in your stories without any extra configuration.
+
+
+
+
+If you're using Webpack and want to use CSS modules, you'll need some extra configuration. We recommend installing [`@storybook/addon-styling-webpack`](https://storybook.js.org/addons/@storybook/addon-styling-webpack/) to help you configure these tools.
+
+## PostCSS
+
+### Vite
+
+Vite comes with PostCSS support out-of-the-box. If you have customized the PostCSS configuration in your `vite.config.js` this will automatically be applied to your Storybook as well. Read more about [Vite's PostCSS support](https://vitejs.dev/guide/features.html#postcss).
+
+### Webpack
+
+
+
+
+Storybook recreates your Next.js configuration, so you can use PostCSS in your stories without any extra configuration.
+
+
+
+
+If you're using Webpack and want to use PostCSS, you'll need some extra configuration. We recommend installing [`@storybook/addon-styling-webpack`](https://storybook.js.org/addons/@storybook/addon-styling-webpack/) to help you configure these tools.
+
+## CSS pre-processors
+
+### Vite
+
+Vite comes with Sass, Less, and Stylus support out-of-the-box. Read more about [Vite's CSS Pre-processor support](https://vitejs.dev/guide/features.html#css-pre-processors).
+
+### Webpack
+
+
+
+
+Storybook recreates your Next.js configuration, so you can use Sass in your stories without any extra configuration.
+
+
+
+
+If you're using Webpack and want to use Sass or less, you'll need some extra configuration. We recommend installing [`@storybook/addon-styling-webpack`](https://storybook.js.org/addons/@storybook/addon-styling-webpack/) to help you configure these tools. Or if you'd prefer, you can customize [Storybook's webpack configuration yourself](../builders/webpack.md#override-the-default-configuration) to include the appropriate loader(s).
## CSS-in-JS
@@ -37,51 +116,77 @@ CSS-in-JS libraries are designed to use basic JavaScript, and they often work in
## Adding webfonts
+### `.storybook/preview-head.html`
+
If you need webfonts to be available, you may need to add some code to the [`.storybook/preview-head.html`](./story-rendering.md#adding-to-head) file. We recommend including any assets with your Storybook if possible, in which case you likely want to configure the [static file location](./images-and-assets.md#serving-static-files-via-storybook-configuration).
-
+### `.storybook/preview.ts`
-## Troubleshooting
+If you're using something like [`fontsource`](https://fontsource.org/) for your fonts, you can import the needed css files in your [`.storybook/preview.ts`](./overview.md#configure-story-rendering) file.
-### Styles aren't being applied with Angular
+
-The latest Angular releases introduced significant changes in configuring and styling projects. If you're working with an Angular version greater than 13 and your styles aren't being applied, you may need to check your `angular.json` and adjust the `builder` configuration to import your CSS:
+
+
-```json
-{
- "my-project": {
- "architect": {
- "build": {
- "builder": "@angular-devkit/build-angular:browser",
- "options": {
- "styles": ["src/styles.css", "src/styles.scss"]
- }
- }
- }
- }
-}
-```
+Storybook for Angular relies on the Angular CLI to build your stories. This means that you can use any CSS preprocessor that the Angular CLI supports. You can read more about this in the [Angular CLI documentation](https://angular.io/guide/workspace-config#style-script-config).
-Additionally, if you need Storybook-specific styles that are separate from your application, you can configure the styles with [Storybook's custom builder](../get-started/install.md#troubleshooting), which will override the application's styles:
+## Global styles
+
+To add global styles to your Storybook, you can add them to the `styles` array in your `angular.json` file. This will add the styles to the preview iframe where your components render, not the Storybook Manager UI.
+
+Don't forget to also add your global styles to your `build-storybook` target in your `angular.json` file. This will ensure that your global styles are included in the static build of your Storybook as well.
```json
-{
+ {
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
- "browserTarget": "my-default-project:build",
- "styles": [".storybook/custom-styles.scss"]
+ "configDir": ".storybook",
+ "browserTarget": "angular-latest:build",
+ "compodoc": true,
+ "compodocArgs": ["-e", "json", "-d", "."],
+ "port": 6006,
+ "styles": [
+ // Add your global styles here
+ "@angular/material/prebuilt-themes/indigo-pink.css",
+ "@fontsource/roboto/300.css",
+ "@fontsource/roboto/400.css",
+ "@fontsource/roboto/500.css",
+ "@fontsource/roboto/700.css",
+ "@fontsource/material-icons",
+ "src/styles.scss"
+ ]
+ }
+ },
+ "build-storybook": {
+ "builder": "@storybook/angular:build-storybook",
+ "options": {
+ "configDir": ".storybook",
+ "browserTarget": "angular-latest:build",
+ "compodoc": true,
+ "compodocArgs": ["-e", "json", "-d", "."],
+ "styles": [
+ // Add your global styles here
+ "@angular/material/prebuilt-themes/indigo-pink.css",
+ "@fontsource/roboto/300.css",
+ "@fontsource/roboto/400.css",
+ "@fontsource/roboto/500.css",
+ "@fontsource/roboto/700.css",
+ "@fontsource/material-icons",
+ "src/styles.scss"
+ ],
+ "outputDir": "storybook-static"
}
}
}
```
-### NX component libraries not loading styles
+## Troubleshooting
-If you're working with Storybook and [Nx libraries](https://nx.dev/structure/library-types),
-you can extend your project's configuration (i.e., `project.json`) and provide the application's styles.
+If you're working with Storybook and [Nx libraries](https://nx.dev/structure/library-types), you can extend your project's configuration (i.e., project.json) and provide the application's styles.
-For earlier Nx versions (before `14.1.8`), your configuration would look like this:
+For earlier Nx versions (before 14.1.8), your configuration would look like this:
```json
"build-storybook": {
@@ -99,7 +204,7 @@ For earlier Nx versions (before `14.1.8`), your configuration would look like th
}
```
-Starting with version `14.1.8`, Nx uses the Storybook builder directly, which means any configuration supplied to the builder also applies to the NX setup. If you're working with a library, you'll need to configure the styling options ( e.g., preprocessors) inside the `build-storybook` `options` configuration object. For example:
+Starting with version 14.1.8, Nx uses the Storybook builder directly, which means any configuration supplied to the builder also applies to the NX setup. If you're working with a library, you'll need to configure the styling options ( e.g., preprocessors) inside the `build-storybook` options configuration object. For example:
```json
"storybook": {
@@ -126,6 +231,7 @@ Starting with version `14.1.8`, Nx uses the Storybook builder directly, which me
}
```
-When Nx runs, it will load Storybook's configuration and styling based on [`storybook`'s `browserTarget`](https://nx.dev/storybook/extra-topics-for-angular-projects#setting-up-browsertarget).
+When Nx runs, it will load Storybook's configuration and styling based on [`storybook.browserTarget`](https://nx.dev/storybook/extra-topics-for-angular-projects#setting-up-browsertarget).
+
diff --git a/docs/essentials/index.md b/docs/essentials/index.md
index 4cddae864fe..2ef9254bfab 100644
--- a/docs/essentials/index.md
+++ b/docs/essentials/index.md
@@ -92,7 +92,6 @@ Below is an abridged configuration and table with all the available options for
| `@storybook/addon-actions` | N/A | N/A |
| `@storybook/addon-viewport` | N/A | N/A |
| `@storybook/addon-docs` | `csfPluginOptions` | Provides additional configuration for Storybook's CSF plugin. Can be disabled with `null`. |
-| | `jsxOptions` | Extends the default Babel configuration options for processing Markdown and MDX files. |
| | `mdxPluginOptions` | Provides additional configuration options and plugin configuration for [MDX documentation](../writing-docs/mdx.md#lack-of-github-flavored-markdown-gfm). |
| `@storybook/addon-controls` | N/A | N/A |
| `@storybook/addon-backgrounds` | N/A | N/A |
diff --git a/docs/get-started/setup.md b/docs/get-started/setup.md
index 5bc7d986e82..ee0d0c6f4dd 100644
--- a/docs/get-started/setup.md
+++ b/docs/get-started/setup.md
@@ -116,6 +116,4 @@ Use [decorators](../writing-stories/decorators.md) to “wrap” every story in
## Load assets and resources
-If you want to [link to static files](../configure/images-and-assets.md) in your project or stories (e.g., `/fonts/XYZ.woff`), use the `-s path/to/folder` flag to specify a static folder to serve from when you start up Storybook. To do so, edit the `storybook` and `build-storybook` scripts in `package.json`.
-
-We recommend serving external resources and assets requested in your components statically with Storybook. It ensures that assets are always available to your stories.
+We recommend serving external resources and assets requested in your components statically with Storybook. It ensures that assets are always available to your stories. Read our [documentation](../configure/images-and-assets.md) to learn how to hosting static files with Storybook.
diff --git a/docs/migration-guide.md b/docs/migration-guide.md
index e0cf30691b0..c2a40c5968f 100644
--- a/docs/migration-guide.md
+++ b/docs/migration-guide.md
@@ -94,26 +94,6 @@ This shows the errors visually in your editor, which speeds things up a lot. Her
![MDX errors showing in VS Code](./assets/mdx-vs-code-extension-errors.gif)
-#### MDX1 as fallback
-
-If, for some reason, you are unable to get MDX2 working, we’ve implemented legacy MDX1 support as a last resort. MDX1 is deprecated and opt-in, and we recommend against it unless you really need it.
-
-To use MDX1:
-
-1. Install `@storybook/mdx1-csf` as a dev dependency
-2. Add the `legacyMdx1` feature flag to your `.storybook/main.js`:
-
-
-
-
-
-
-
### storiesOf support discontinued by default
If you use Storybook’s legacy `storiesOf` API, it is no longer supported by default in Storybook 7.
diff --git a/docs/sharing/storybook-composition.md b/docs/sharing/storybook-composition.md
index 987d453e51d..50a78daadf6 100644
--- a/docs/sharing/storybook-composition.md
+++ b/docs/sharing/storybook-composition.md
@@ -17,7 +17,7 @@ You’ll see the composed Storybook’s stories in the sidebar alongside your ow
## Compose published Storybooks
-In your [`.storybook/main.js`](../configure/index.md#configure-story-rendering) file add a `refs` field with information about the reference Storybook. Pass in a URL to a statically built Storybook.
+In your [`.storybook/main.js|ts`](../configure/index.md#configure-story-rendering) file add a `refs` field with information about the reference Storybook. Pass in a URL to a statically built Storybook.
@@ -30,15 +30,15 @@ In your [`.storybook/main.js`](../configure/index.md#configure-story-rendering)
-
+
-Limitation: Addons in composed Storybooks will not work as they normally do in a non-composed Storybook.
+Addons in composed Storybooks will not work as they normally do in a non-composed Storybook.
## Compose local Storybooks
-You can also compose multiple Storybooks that are running locally. For instance, if you have a React Storybook and an Angular Storybook running on different ports, you can update your configuration file (i.e., `.storybook/main.js`) and reference them;
+You can also compose multiple Storybooks that are running locally. For instance, if you have a React Storybook and an Angular Storybook running on different ports, you can update your configuration file (i.e., `.storybook/main.js|ts`) and reference them as follows:
@@ -70,17 +70,13 @@ You can also compose Storybooks based on the current development environment (e.
-Similar to the other fields available in Storybook’s configuration file, the `refs` field can also be a function that accepts a config parameter containing Storybook’s configuration object. Check the [Webpack documentation](../builders/webpack.md#override-the-default-configuration) to learn more about it.
+Similar to other fields available in Storybook’s configuration file, the `refs` field can also be a function that accepts a `config` parameter containing Storybook’s configuration object. See the [API reference](../api/main-config-refs.md) for more information.
## Improve your Storybook composition
-So far, we've seen how we can use composition with local or published Storybooks. As your Storybook will grow in time with your stories or through composition with other Storybooks, you can optimize the deployment process using various methods.
-
-### With feature flags
-
-If you're using Storybook 6.4, or higher, you can optimize your composition via the `buildStoriesJson` feature flag, allowing you to generate `index.json` and `stories.json` files with the required information, providing you with a seamless integration without the need for additional dependencies. For example:
+Out of the box, Storybook allows you to compose Storybooks both locally and remotely with a minor change to your configuration. However, as your Storybook grows, you might want to optimize the composition process to improve the overall performance and user experience of your Storybook by enabling the `buildStoriesJson` feature flag that will generate the `index.json` and `stories.json` files with the required information to populate the UI with your composed Storybook stories automatically. For example:
@@ -93,62 +89,32 @@ If you're using Storybook 6.4, or higher, you can optimize your composition via
-
+
-If you already enabled automatic code splitting via the [`storyStoreV7`](https://storybook.js.org/docs/builders/webpack#code-splitting), you won't need this flag as it will automatically generate the `index.json` file.
+If you're working with a Storybook version 7.0 or higher, this flag is enabled by default. However, if you're working with an older version and you configured your Storybook to use the [`storyStoreV7`](../api/main-config-features.md#storystorev7) feature flag, you won't need this flag as it will automatically generate the required `index.json` file for you to use.
-When you compose a Storybook featuring this flag, it will use the information retrieved from the file to populate the UI with your composed Storybook stories automatically. Here's an example of the output generated by the `index.json` file:
-
-
-
-
-
-
+## Troubleshooting
-### With the CLI
+### Storybook composition is not working with my project
-If you're working with an outdated Storybook version or have a project-specific requirement that prevents you from enabling the `buildStoriesJson` feature flag. In that case, you can use Storybook's CLI to automatically generate the `index.json` file when you deploy your Storybook. For example:
-
-```shell
-npx storybook extract
-```
-
-
-
-`storybook extract` uses [Puppeteer](https://www.npmjs.com/package/puppeteer), which downloads and installs Chromium. Set the environment `SB_CHROMIUM_PATH` to configure your local Chromium installation.
-
-
-
-Although a good approach to improve composition, it comes with a cost, as it will require an additional dependency being added and increased build times. Once it finishes executing, it will generate an `index.json` file in the default build directory (`storybook-static`) with the information related to your Storybook. Here’s an example of the file contents:
+If you're working with an outdated Storybook version or have a project-specific requirement that prevents you from updating your Storybook to the latest version, you can rely on the Storybook CLI to generate the `index.json` file when you deploy your Storybook. For example:
-Linking to a Storybook deployed using this approach will yield all the stories and other relevant information displayed in the UI.
-
-If you need, you can also add additional arguments to this command. For instance, if you want to generate the `index.json` file into a custom directory, you can use the following:
-
-```shell
-npx storybook extract my-built-storybook-directory my-other-directory/index.json
-```
-
-When executed, it will look up a built Storybook in the `my-built-storybook-directory` and create the `index.json` file in the `my-other-directory` with all the necessary information.
-
-
+
-If you need to use the arguments, you’ll need to include both of them, or the command will fail.
+The usage of a specific version of the CLI is intended as the `extract` command is not available in Storybook 8.0 or higher. It also requires you to provide additional configuration to generate the `index.json` file accurately. See the [previous documentation](../../../release-7-5/docs/sharing/storybook-composition.md) for more information.
diff --git a/docs/snippets/common/main-config-test-disable-autodocs.js.mdx b/docs/snippets/common/main-config-test-disable-autodocs.js.mdx
index 86b7de8fb7b..006903bad2e 100644
--- a/docs/snippets/common/main-config-test-disable-autodocs.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-autodocs.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableAutoDocs: true,
+ disableAutoDocs: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx b/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx
index 1eb9e721819..4a1bd49e9bd 100644
--- a/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableAutoDocs: true,
+ disableAutoDocs: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-blocks.js.mdx b/docs/snippets/common/main-config-test-disable-blocks.js.mdx
index 9b4aa8c9a47..2ebd0640731 100644
--- a/docs/snippets/common/main-config-test-disable-blocks.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-blocks.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableBlocks: true,
+ disableBlocks: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-blocks.ts.mdx b/docs/snippets/common/main-config-test-disable-blocks.ts.mdx
index 0cb4b4235bb..1a647bf092e 100644
--- a/docs/snippets/common/main-config-test-disable-blocks.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-blocks.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableBlocks: true,
+ disableBlocks: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-docgen.js.mdx b/docs/snippets/common/main-config-test-disable-docgen.js.mdx
index ffe4bdc2f86..38d822c83be 100644
--- a/docs/snippets/common/main-config-test-disable-docgen.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-docgen.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableDocgen: true,
+ disableDocgen: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-docgen.ts.mdx b/docs/snippets/common/main-config-test-disable-docgen.ts.mdx
index 1d0eb3c10d9..ed1df8facc7 100644
--- a/docs/snippets/common/main-config-test-disable-docgen.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-docgen.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableDocgen: true,
+ disableDocgen: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-mdx.js.mdx b/docs/snippets/common/main-config-test-disable-mdx.js.mdx
index f6204594c1e..133f34d570b 100644
--- a/docs/snippets/common/main-config-test-disable-mdx.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-mdx.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableMDXEntries: true,
+ disableMDXEntries: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-mdx.ts.mdx b/docs/snippets/common/main-config-test-disable-mdx.ts.mdx
index e5327602aed..5c364f46665 100644
--- a/docs/snippets/common/main-config-test-disable-mdx.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-mdx.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableMDXEntries: true,
+ disableMDXEntries: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx b/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx
index 9207b931709..8e2772ca1f1 100644
--- a/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableSourcemaps: true,
+ disableSourcemaps: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx b/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx
index 79b0abab693..2fa419b9497 100644
--- a/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableSourcemaps: true,
+ disableSourcemaps: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx b/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx
index f0957f7e553..cbf3c7a29ea 100644
--- a/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx
+++ b/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx
@@ -7,7 +7,7 @@ export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableTreeShaking: true,
+ disableTreeShaking: false,
},
},
};
diff --git a/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx b/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx
index b053cfa0343..eccb38910d1 100644
--- a/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx
+++ b/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx
@@ -9,7 +9,7 @@ const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
build: {
test: {
- disableTreeShaking: true,
+ disableTreeShaking: false,
},
},
};
diff --git a/docs/snippets/common/storybook-extract-result.json.mdx b/docs/snippets/common/storybook-extract-result.json.mdx
deleted file mode 100644
index 0bf8a886f78..00000000000
--- a/docs/snippets/common/storybook-extract-result.json.mdx
+++ /dev/null
@@ -1,38 +0,0 @@
-```json
-{
- "v": 2,
- "globalParameters": {},
- "kindParameters": {
- "components/myComponent": {
- "fileName": 445,
- "framework": "react"
- },
- "components/myOtherComponent": {
- "fileName": 447,
- "framework": "react"
- }
- },
- "stories": {
- "components-mycomponent--simple": {
- "id": "components-mycomponent--simple",
- "name": "Simple",
- "kind": "components/myComponent",
- "story": "Simple",
- "parameters": {
- "__id": "components-mycomponent--simple",
- "__isArgsStory": true
- }
- },
- "components-myothercomponent--simple": {
- "id": "components-myothercomponent--simple",
- "name": "Simple",
- "kind": "components/myothercomponent",
- "story": "Simple",
- "parameters": {
- "__id": "components-myothercomponent--simple",
- "__isArgsStory": true
- }
- }
- }
-}
-```
diff --git a/docs/snippets/common/storybook-extract-specific-version.npx.js.mdx b/docs/snippets/common/storybook-extract-specific-version.npx.js.mdx
new file mode 100644
index 00000000000..828643a532c
--- /dev/null
+++ b/docs/snippets/common/storybook-extract-specific-version.npx.js.mdx
@@ -0,0 +1,3 @@
+```shell
+npx storybook@7.5.3 extract
+```
diff --git a/docs/snippets/common/storybook-extract-specific-version.pnpm.js.mdx b/docs/snippets/common/storybook-extract-specific-version.pnpm.js.mdx
new file mode 100644
index 00000000000..55b88244114
--- /dev/null
+++ b/docs/snippets/common/storybook-extract-specific-version.pnpm.js.mdx
@@ -0,0 +1,3 @@
+```shell
+pnpm dlx storybook@7.5.3 extract
+```
diff --git a/docs/snippets/common/storybook-extract-specific-version.yarn.js.mdx b/docs/snippets/common/storybook-extract-specific-version.yarn.js.mdx
new file mode 100644
index 00000000000..b821fcd2357
--- /dev/null
+++ b/docs/snippets/common/storybook-extract-specific-version.yarn.js.mdx
@@ -0,0 +1,3 @@
+```shell
+yarn dlx storybook@7.5.3 extract
+```
diff --git a/docs/snippets/common/storybook-fallback-mdx-install.npm.js.mdx b/docs/snippets/common/storybook-fallback-mdx-install.npm.js.mdx
deleted file mode 100644
index bb7ce17277e..00000000000
--- a/docs/snippets/common/storybook-fallback-mdx-install.npm.js.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-```shell
-npm install @storybook/mdx1-csf --save-dev
-```
diff --git a/docs/snippets/common/storybook-fallback-mdx-install.pnpm.js.mdx b/docs/snippets/common/storybook-fallback-mdx-install.pnpm.js.mdx
deleted file mode 100644
index 624f84077d4..00000000000
--- a/docs/snippets/common/storybook-fallback-mdx-install.pnpm.js.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-```shell
-pnpm add --save-dev @storybook/mdx1-csf
-```
diff --git a/docs/snippets/common/storybook-fallback-mdx-install.yarn.js.mdx b/docs/snippets/common/storybook-fallback-mdx-install.yarn.js.mdx
deleted file mode 100644
index 02fadab4735..00000000000
--- a/docs/snippets/common/storybook-fallback-mdx-install.yarn.js.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-```shell
-yarn add --dev @storybook/mdx1-csf
-```
diff --git a/docs/snippets/common/storybook-main-full-individual-essentials-config.js.mdx b/docs/snippets/common/storybook-main-full-individual-essentials-config.js.mdx
index 07391e43ad0..0c11bf383b6 100644
--- a/docs/snippets/common/storybook-main-full-individual-essentials-config.js.mdx
+++ b/docs/snippets/common/storybook-main-full-individual-essentials-config.js.mdx
@@ -13,7 +13,6 @@ export default {
name: '@storybook/addon-docs',
options: {
csfPluginOptions: null,
- jsxOptions: {},
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [],
diff --git a/docs/snippets/common/storybook-main-full-individual-essentials-config.ts.mdx b/docs/snippets/common/storybook-main-full-individual-essentials-config.ts.mdx
index b2407522632..5ddd5f067d6 100644
--- a/docs/snippets/common/storybook-main-full-individual-essentials-config.ts.mdx
+++ b/docs/snippets/common/storybook-main-full-individual-essentials-config.ts.mdx
@@ -15,7 +15,6 @@ const config: StorybookConfig = {
name: '@storybook/addon-docs',
options: {
csfPluginOptions: null,
- jsxOptions: {},
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [],
diff --git a/docs/snippets/common/storybook-mdx2-install.npm.js.mdx b/docs/snippets/common/storybook-mdx2-install.npm.js.mdx
deleted file mode 100644
index 61117f8c4b0..00000000000
--- a/docs/snippets/common/storybook-mdx2-install.npm.js.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-```shell
-npm install @storybook/mdx2-csf --save-dev
-```
diff --git a/docs/snippets/common/storybook-mdx2-install.yarn.js.mdx b/docs/snippets/common/storybook-mdx2-install.yarn.js.mdx
deleted file mode 100644
index 7d7c4a172b0..00000000000
--- a/docs/snippets/common/storybook-mdx2-install.yarn.js.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-```shell
-yarn add --dev @storybook/mdx2-csf
-```
diff --git a/docs/snippets/common/storybook-storiesjsonflag-result.json.mdx b/docs/snippets/common/storybook-storiesjsonflag-result.json.mdx
deleted file mode 100644
index bc8c9814631..00000000000
--- a/docs/snippets/common/storybook-storiesjsonflag-result.json.mdx
+++ /dev/null
@@ -1,33 +0,0 @@
-```json
-{
- "v": 3,
- "stories": {
- "components-mycomponent--simple": {
- "id": "components-mycomponent--simple",
- "title": "Components/MyComponent",
- "name": "Simple",
- "importPath": "./src/components/MyComponent.stories.jsx",
- "kind": "Components/MyComponent",
- "story": "Simple",
- "parameters": {
- "__id": "components-mycomponent--simple",
- "docsOnly": false,
- "fileName": "./src/components/MyComponent.stories.jsx"
- }
- },
- "components-myothercomponent--simple": {
- "id": "components-myothercomponent--simple",
- "title": "Components/MyOtherComponent",
- "name": "Simple",
- "importPath": "./src/components/MyOtherComponent.stories.jsx",
- "kind": "Example/Button",
- "story": "Simple",
- "parameters": {
- "__id": "components-myothercomponent--simple",
- "docsOnly": false,
- "fileName": "./src/components/MyOtherComponent.stories.jsx"
- }
- }
- }
-}
-```
diff --git a/docs/snippets/web-components/button-story-default-export-with-component.ts.mdx b/docs/snippets/web-components/button-story-default-export-with-component.ts.mdx
index 805431b359c..8ddd34a485c 100644
--- a/docs/snippets/web-components/button-story-default-export-with-component.ts.mdx
+++ b/docs/snippets/web-components/button-story-default-export-with-component.ts.mdx
@@ -3,7 +3,8 @@
import type { Meta } from '@storybook/web-components';
-export default {
+const meta: Meta = {
+ title: 'Button',
component: 'demo-button',
};
diff --git a/docs/versions/next.json b/docs/versions/next.json
index 060cd5ca7ef..7de16aa408a 100644
--- a/docs/versions/next.json
+++ b/docs/versions/next.json
@@ -1 +1 @@
-{"version":"8.0.0-alpha.4","info":{"plain":"- API: Remove stories.json support - [#25236](https://github.com/storybookjs/storybook/pull/25236), thanks [@shilman](https://github.com/shilman)!\n- Addon Docs: Remove `react` peer dependency - [#24881](https://github.com/storybookjs/storybook/pull/24881), thanks [@JReinhold](https://github.com/JReinhold)!\n- Addon-docs: Support `` and `` in source viewer - [#19785](https://github.com/storybookjs/storybook/pull/19785), thanks [@zhyd1997](https://github.com/zhyd1997)!\n- Angular: Add random attribute to bootstrapped selector - [#24972](https://github.com/storybookjs/storybook/pull/24972), thanks [@Marklb](https://github.com/Marklb)!\n- Angular: Reduce the warnings from `ts-loader` via stricter list of `includes` - [#24531](https://github.com/storybookjs/storybook/pull/24531), thanks [@ndelangen](https://github.com/ndelangen)!\n- Blocks: Render colors in the same order as provided - [#25001](https://github.com/storybookjs/storybook/pull/25001), thanks [@kaelig](https://github.com/kaelig)!\n- CLI: Add prompt-only automigrate asking for react-removal - [#25215](https://github.com/storybookjs/storybook/pull/25215), thanks [@ndelangen](https://github.com/ndelangen)!\n- CLI: No longer add react in init - [#25196](https://github.com/storybookjs/storybook/pull/25196), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Set bundle target to `node18` - [#25239](https://github.com/storybookjs/storybook/pull/25239), thanks [@shilman](https://github.com/shilman)!\n- SvelteKit: Fix missing `$app` modules - [#25132](https://github.com/storybookjs/storybook/pull/25132), thanks [@paoloricciuti](https://github.com/paoloricciuti)!\n- SvelteKit: Support 2.0 modules with mocks - [#25244](https://github.com/storybookjs/storybook/pull/25244), thanks [@paoloricciuti](https://github.com/paoloricciuti)!\n- UI: Embed `react-textarea-autosize` types - [#25235](https://github.com/storybookjs/storybook/pull/25235), thanks [@ndelangen](https://github.com/ndelangen)!"}}
+{"version":"8.0.0-alpha.8","info":{"plain":"- Addon Links: Remove LinkTo from direct import - [#25418](https://github.com/storybookjs/storybook/pull/25418), thanks [@yannbf](https://github.com/yannbf)!\n- Addon docs: Remove deprecated parameters - [#25469](https://github.com/storybookjs/storybook/pull/25469), thanks [@yannbf](https://github.com/yannbf)!\n- Builder Vite: Remove StorybookViteConfig type in favor of StorybookConfig - [#25441](https://github.com/storybookjs/storybook/pull/25441), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Error on explicit actions while rendering or playing - [#25238](https://github.com/storybookjs/storybook/pull/25238), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Core: Remove collapseAll and expandAll methods - [#25486](https://github.com/storybookjs/storybook/pull/25486), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Remove storyIndexers in favor of experimental_indexers - [#25468](https://github.com/storybookjs/storybook/pull/25468), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Remove unused staticDir type - [#25415](https://github.com/storybookjs/storybook/pull/25415), thanks [@yannbf](https://github.com/yannbf)!\n- Doc blocks: Remove deprecated props from Description block - [#25457](https://github.com/storybookjs/storybook/pull/25457), thanks [@yannbf](https://github.com/yannbf)!\n- Manager API: Remove deprecated navigateToSettingsPage method - [#25467](https://github.com/storybookjs/storybook/pull/25467), thanks [@yannbf](https://github.com/yannbf)!\n- React: Remove deprecated setGlobalConfig portable stories api - [#25442](https://github.com/storybookjs/storybook/pull/25442), thanks [@yannbf](https://github.com/yannbf)!\n- TypeScript: Remove deprecated addons module types - [#25485](https://github.com/storybookjs/storybook/pull/25485), thanks [@yannbf](https://github.com/yannbf)!\n- Types: Remove DecoratorFn, Story, ComponentStory, ComponentStoryObj, ComponentStoryFn and ComponentMeta types - [#25477](https://github.com/storybookjs/storybook/pull/25477), thanks [@yannbf](https://github.com/yannbf)!\n- Types: Remove Framework in favor of Renderer types - [#25476](https://github.com/storybookjs/storybook/pull/25476), thanks [@yannbf](https://github.com/yannbf)!\n- UI: Remove deprecated WithTooltip props - [#25440](https://github.com/storybookjs/storybook/pull/25440), thanks [@yannbf](https://github.com/yannbf)!"}}
diff --git a/docs/writing-docs/autodocs.md b/docs/writing-docs/autodocs.md
index 96c42c8ba83..4e066de59f6 100644
--- a/docs/writing-docs/autodocs.md
+++ b/docs/writing-docs/autodocs.md
@@ -286,6 +286,10 @@ Additionally, if you're developing using TypeScript, you may need to update Stor
If you're still encountering issues, we recommend reaching out to the community using the default communication channels (e.g., [GitHub discussions](https://github.com/storybookjs/storybook/discussions/new?category=help)).
+### The controls are not updating the story within the auto-generated documentation
+
+If you turned off inline rendering for your stories via the [`inline`](../api/doc-block-story.md#inline) configuration option, you would run into a situation where the associated controls are not updating the story within the documentation page. This is a known limitation of the current implementation and will be addressed in a future release.
+
#### Learn more about Storybook documentation
- Autodocs for creating documentation for your stories
diff --git a/docs/writing-docs/mdx.md b/docs/writing-docs/mdx.md
index bd31e66374a..cfe98b9bc4a 100644
--- a/docs/writing-docs/mdx.md
+++ b/docs/writing-docs/mdx.md
@@ -455,6 +455,10 @@ Additionally, if you're working with VSCode, you can add the [MDX extension](htt
If you're still encountering issues, we recommend reaching out to the community using the default communication channels (e.g., [GitHub discussions](https://github.com/storybookjs/storybook/discussions/new?category=help)).
+### The controls are not updating the story within the MDX documentation page
+
+If you turned off inline rendering for your stories via the [`inline`](../api/doc-block-story.md#inline) configuration option, you would run into a situation where the associated controls are not updating the story within the documentation page. This is a known limitation of the current implementation and will be addressed in a future release.
+
#### Learn more about Storybook documentation
- [Autodocs](./autodocs.md) for creating documentation for your stories
diff --git a/docs/writing-tests/snapshot-testing.md b/docs/writing-tests/snapshot-testing.md
index a37751b5871..438258b36ad 100644
--- a/docs/writing-tests/snapshot-testing.md
+++ b/docs/writing-tests/snapshot-testing.md
@@ -10,13 +10,13 @@ Storybook is a helpful tool for snapshot testing because every story is essentia
## Migrating Tests
-The Storyshots addon was the original testing solution for Storybook, offering a highly extensible API and a wide range of configuration options for testing. However, it was difficult to set up and maintain, and it needed to be compatible with the latest version of Storybook, which introduced some significant architectural changes, including a high-performance [on-demand story loading](../configure/index.md#on-demand-story-loading) feature. As a result, Storyhots is now officially deprecated, is no longer being maintained, and will be removed in the next major release of Storybook. We recommend following the [migration guide](./storyshots-migration-guide.md) we've prepared to help you during this transition period.
+The Storyshots addon was the original testing solution for Storybook, offering a highly extensible API and a wide range of configuration options for testing. However, it was difficult to set up and maintain, and it needed to be compatible with the latest version of Storybook, which introduced some significant architectural changes, including a high-performance [on-demand story loading](../configure/index.md#on-demand-story-loading) feature. As a result, Storyshots is now officially deprecated, is no longer being maintained, and will be removed in the next major release of Storybook. We recommend following the [migration guide](./storyshots-migration-guide.md) we've prepared to help you during this transition period.
## Set up Storyshots
-The Storyshots addon has been deprecated and will be removed in a future release of Storybook. See the [migration guide](./storyshots-migration-guide.md) for more information.
+The Storyshots addon was deprecated and has been removed in Storybook 8. See the [migration guide](./storyshots-migration-guide.md) for more information.
diff --git a/scripts/release/__tests__/ensure-next-ahead.test.ts b/scripts/release/__tests__/ensure-next-ahead.test.ts
index 7e7aa3e1866..d7a3f99c03b 100644
--- a/scripts/release/__tests__/ensure-next-ahead.test.ts
+++ b/scripts/release/__tests__/ensure-next-ahead.test.ts
@@ -1,4 +1,3 @@
-/* eslint-disable global-require */
/* eslint-disable no-underscore-dangle */
import path from 'path';
import { vi, describe, it, expect, beforeEach } from 'vitest';
diff --git a/scripts/release/__tests__/label-patches.test.ts b/scripts/release/__tests__/label-patches.test.ts
index 8f221f88b96..29da21758c6 100644
--- a/scripts/release/__tests__/label-patches.test.ts
+++ b/scripts/release/__tests__/label-patches.test.ts
@@ -138,7 +138,7 @@ it('should label the PR associated with cherry picks in the current branch', asy
.trim()
: text
)
- .filter((it) => it !== '');
+ .filter((text) => text !== '');
expect(stderrCalls).toMatchInlineSnapshot(`
[
diff --git a/scripts/release/__tests__/version.test.ts b/scripts/release/__tests__/version.test.ts
index cfe382b15ae..2f5ffb8ea9b 100644
--- a/scripts/release/__tests__/version.test.ts
+++ b/scripts/release/__tests__/version.test.ts
@@ -1,4 +1,3 @@
-/* eslint-disable global-require */
/* eslint-disable no-underscore-dangle */
import { describe, it, expect, vi } from 'vitest';
import path from 'path';
diff --git a/scripts/release/__tests__/write-changelog.test.ts b/scripts/release/__tests__/write-changelog.test.ts
index 80c7f036508..5aa4c831905 100644
--- a/scripts/release/__tests__/write-changelog.test.ts
+++ b/scripts/release/__tests__/write-changelog.test.ts
@@ -1,5 +1,5 @@
/* eslint-disable jest/no-mocks-import */
-/* eslint-disable global-require */
+
/* eslint-disable no-underscore-dangle */
import path from 'path';
import dedent from 'ts-dedent';
diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts
index 4d84258f503..9a6354d05c6 100644
--- a/scripts/tasks/sandbox-parts.ts
+++ b/scripts/tasks/sandbox-parts.ts
@@ -191,11 +191,6 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) {
// NOTE: the test regexp here will apply whether the path is symlink-preserved or otherwise
const require = createRequire(import.meta.url);
const esbuildLoaderPath = require.resolve('../../code/node_modules/esbuild-loader');
- const storiesMdxLoaderPath = require.resolve(
- '../../code/node_modules/@storybook/mdx2-csf/loader'
- );
- const babelLoaderPath = require.resolve('babel-loader');
- const jsxPluginPath = require.resolve('@babel/plugin-transform-react-jsx');
const webpackFinalCode = `
(config) => ({
...config,
@@ -213,45 +208,13 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) {
},
},
// Handle MDX files per the addon-docs presets (ish)
- {
- test: [/\\/template-stories\\//],
- include: [/\\.stories\\.mdx$/],
- use: [
- {
- loader: '${babelLoaderPath}',
- options: {
- babelrc: false,
- configFile: false,
- plugins: ['${jsxPluginPath}'],
- }
- },
- {
- loader: '${storiesMdxLoaderPath}',
- options: {
- skipCsf: false,
- }
- }
- ],
- },
- {
- test: [/\\/template-stories\\//],
- include: [/\\.mdx$/],
- exclude: [/\\.stories\\.mdx$/],
+ {
+ test: /template-stories\\/.*\\.mdx$/,
+ exclude: /\\.stories\\.mdx$/,
use: [
{
- loader: '${babelLoaderPath}',
- options: {
- babelrc: false,
- configFile: false,
- plugins: ['${jsxPluginPath}'],
- }
+ loader: require.resolve('@storybook/addon-docs/mdx-loader'),
},
- {
- loader: '${storiesMdxLoaderPath}',
- options: {
- skipCsf: true,
- }
- }
],
},
// Ensure no other loaders from the framework apply
diff --git a/scripts/utils/options.ts b/scripts/utils/options.ts
index f5340c037a8..b6e7c930b9f 100644
--- a/scripts/utils/options.ts
+++ b/scripts/utils/options.ts
@@ -140,11 +140,12 @@ export function getOptions(
const checkStringValue = (raw: string) => {
if (option.values && !option.values.includes(raw)) {
- const possibleOptions = chalk.cyan(option.values.join(', '));
+ const possibleOptions = chalk.cyan(option.values.join('\n'));
throw new Error(
dedent`Unexpected value '${chalk.yellow(raw)}' for option '${chalk.magenta(key)}'.
- These are the possible options: ${possibleOptions}\n\n`
+ These are the possible options:
+ ${possibleOptions}\n\n`
);
}
return raw;
diff --git a/scripts/utils/yarn.ts b/scripts/utils/yarn.ts
index 2f1fdc8b838..006aac905f8 100644
--- a/scripts/utils/yarn.ts
+++ b/scripts/utils/yarn.ts
@@ -97,8 +97,8 @@ export const configureYarn2ForVerdaccio = async ({
`yarn config set enableImmutableInstalls false`,
];
- if (key === 'svelte-kit/prerelease-ts') {
- // Don't error with INCOMPATIBLE_PEER_DEPENDENCY for SvelteKit prerelease, it is expected
+ if (key.includes('svelte-kit')) {
+ // Don't error with INCOMPATIBLE_PEER_DEPENDENCY for SvelteKit sandboxes, it is expected to happen with @sveltejs/vite-plugin-svelte
command.push(
`yarn config set logFilters --json '[ { "code": "YN0013", "level": "discard" } ]'`
);
diff --git a/scripts/verdaccio.yaml b/scripts/verdaccio.yaml
index e0139f305f0..6ab5ce64918 100644
--- a/scripts/verdaccio.yaml
+++ b/scripts/verdaccio.yaml
@@ -87,14 +87,6 @@ packages:
access: $all
publish: $all
proxy: npmjs
- '@storybook/mdx1-csf':
- access: $all
- publish: $all
- proxy: npmjs
- '@storybook/mdx2-csf':
- access: $all
- publish: $all
- proxy: npmjs
'@storybook/expect':
access: $all
publish: $all
diff --git a/test-storybooks/external-docs/components/AccountForm.stories.tsx b/test-storybooks/external-docs/components/AccountForm.stories.tsx
index c4579abaf5e..10280adb253 100644
--- a/test-storybooks/external-docs/components/AccountForm.stories.tsx
+++ b/test-storybooks/external-docs/components/AccountForm.stories.tsx
@@ -1,6 +1,6 @@
/* eslint-disable storybook/use-storybook-testing-library */
// @TODO: use addon-interactions and remove the rule disable above
-import type { ComponentStoryObj, ComponentMeta } from '@storybook/react';
+import type { StoryObj, Meta } from '@storybook/react';
import { screen } from '@testing-library/dom';
import userEvent from '@testing-library/user-event';
import { AccountForm } from './AccountForm';
@@ -12,9 +12,9 @@ export default {
parameters: {
layout: 'centered',
},
-} as ComponentMeta;
+} as Meta;
-type Story = ComponentStoryObj;
+type Story = StoryObj;
export const Standard: Story = {
args: { passwordVerification: false },
@@ -54,7 +54,7 @@ export const StandardFailHover: Story = {
},
};
-export const Verification: ComponentStoryObj = {
+export const Verification: StoryObj = {
args: { passwordVerification: true },
};