Merge remote-tracking branch 'origin/next' into valentin/remove-babel-from-webpack5-builder

This commit is contained in:
Valentin Palkovic 2024-01-08 10:24:21 +01:00
commit 93aea846be
136 changed files with 530 additions and 1036 deletions

View File

@ -1,3 +1,20 @@
## 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)!

View File

@ -13,6 +13,7 @@
- [Removed `@babel/core` and `babel-loader` from `@storybook/builder-webpack5`](#removed-babelcore-and-babel-loader-from-storybookbuilder-webpack5)
- [`framework.options.fastRefresh` for Webpack5-based projects removed](#frameworkoptionsfastrefresh-for-webpack5-based-projects-removed)
- [`typescript.skipBabel` removed](#typescriptskipbabel-removed)
- [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)
@ -44,6 +45,13 @@
- [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)
@ -549,6 +557,10 @@ You don't have to add fast refresh to `@storybook/nextjs` since it is already co
We have removed the `typescript.skipBabel` option in Storybook 8.0. Please use `typescript.skipCompiler` instead.
#### 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.
@ -792,6 +804,70 @@ import LinkTo from '@storybook/addon-links';
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
```
More info [here](#autodocs-changes) and [here](#source-block).
#### Description Doc block properties
`children`, `markdown` and `type` are now removed in favor of the `of` property. [More info](#doc-blocks).
#### 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
#### CommonJS with Vite is deprecated
@ -2387,6 +2463,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
@ -2395,24 +2473,43 @@ import type { Story } from '@storybook/react';
export const MyStory: Story = () => <div />;
```
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 = () => <div />;
export const MyCsf2Story: StoryFn = () => <div />;
export const MyCsf3Story: StoryObj = {
render: () => <div />
};
```
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.
@ -2432,6 +2529,12 @@ export const CSF2Story: StoryFn<ButtonProps> = (args) => <Button {...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.

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",

View File

@ -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 `<Story>` 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 `<Story>` 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

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",

View File

@ -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<typeof Interaction>;
type Story = StoryObj<typeof Interaction>;
export default {
title: 'Addons/Interactions/Interaction',
@ -17,7 +17,7 @@ export default {
controls: SubnavStories.args.controls,
controlStates: SubnavStories.args.controlStates,
},
} as ComponentMeta<typeof Interaction>;
} as Meta<typeof Interaction>;
export const Active: Story = {
args: {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "View a storys source code to see how it works and paste into your app",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Switch between multiple themes for you components in Storybook",
"keywords": [
"css",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Build responsive components by adjusting Storybooks viewport size and orientation",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-manager",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook manager builder",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
"version": "8.0.0-alpha.7",
"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": {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
"keywords": [
"storybook",

View File

@ -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;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "8.0.0-alpha.7",
"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": {

View File

@ -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;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/nextjs",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Next.js",
"keywords": [
"storybook",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/server-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/sveltekit",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for SvelteKit",
"keywords": [
"storybook",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-vite",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-webpack5",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "sb",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook CLI",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "storybook",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook CLI",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/cli",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook's CLI - install, dev, build, upgrade, and more",
"keywords": [
"cli",

View File

@ -1,82 +1,82 @@
// auto generated file, do not edit
export default {
'@storybook/addon-a11y': '8.0.0-alpha.7',
'@storybook/addon-actions': '8.0.0-alpha.7',
'@storybook/addon-backgrounds': '8.0.0-alpha.7',
'@storybook/addon-controls': '8.0.0-alpha.7',
'@storybook/addon-docs': '8.0.0-alpha.7',
'@storybook/addon-essentials': '8.0.0-alpha.7',
'@storybook/addon-highlight': '8.0.0-alpha.7',
'@storybook/addon-interactions': '8.0.0-alpha.7',
'@storybook/addon-jest': '8.0.0-alpha.7',
'@storybook/addon-links': '8.0.0-alpha.7',
'@storybook/addon-mdx-gfm': '8.0.0-alpha.7',
'@storybook/addon-measure': '8.0.0-alpha.7',
'@storybook/addon-outline': '8.0.0-alpha.7',
'@storybook/addon-storysource': '8.0.0-alpha.7',
'@storybook/addon-themes': '8.0.0-alpha.7',
'@storybook/addon-toolbars': '8.0.0-alpha.7',
'@storybook/addon-viewport': '8.0.0-alpha.7',
'@storybook/angular': '8.0.0-alpha.7',
'@storybook/blocks': '8.0.0-alpha.7',
'@storybook/builder-manager': '8.0.0-alpha.7',
'@storybook/builder-vite': '8.0.0-alpha.7',
'@storybook/builder-webpack5': '8.0.0-alpha.7',
'@storybook/channels': '8.0.0-alpha.7',
'@storybook/cli': '8.0.0-alpha.7',
'@storybook/client-logger': '8.0.0-alpha.7',
'@storybook/codemod': '8.0.0-alpha.7',
'@storybook/components': '8.0.0-alpha.7',
'@storybook/core-common': '8.0.0-alpha.7',
'@storybook/core-events': '8.0.0-alpha.7',
'@storybook/core-server': '8.0.0-alpha.7',
'@storybook/core-webpack': '8.0.0-alpha.7',
'@storybook/csf-plugin': '8.0.0-alpha.7',
'@storybook/csf-tools': '8.0.0-alpha.7',
'@storybook/docs-tools': '8.0.0-alpha.7',
'@storybook/ember': '8.0.0-alpha.7',
'@storybook/html': '8.0.0-alpha.7',
'@storybook/html-vite': '8.0.0-alpha.7',
'@storybook/html-webpack5': '8.0.0-alpha.7',
'@storybook/instrumenter': '8.0.0-alpha.7',
'@storybook/manager': '8.0.0-alpha.7',
'@storybook/manager-api': '8.0.0-alpha.7',
'@storybook/nextjs': '8.0.0-alpha.7',
'@storybook/node-logger': '8.0.0-alpha.7',
'@storybook/preact': '8.0.0-alpha.7',
'@storybook/preact-vite': '8.0.0-alpha.7',
'@storybook/preact-webpack5': '8.0.0-alpha.7',
'@storybook/preset-create-react-app': '8.0.0-alpha.7',
'@storybook/preset-html-webpack': '8.0.0-alpha.7',
'@storybook/preset-preact-webpack': '8.0.0-alpha.7',
'@storybook/preset-react-webpack': '8.0.0-alpha.7',
'@storybook/preset-server-webpack': '8.0.0-alpha.7',
'@storybook/preset-svelte-webpack': '8.0.0-alpha.7',
'@storybook/preset-vue3-webpack': '8.0.0-alpha.7',
'@storybook/preview': '8.0.0-alpha.7',
'@storybook/preview-api': '8.0.0-alpha.7',
'@storybook/react': '8.0.0-alpha.7',
'@storybook/react-dom-shim': '8.0.0-alpha.7',
'@storybook/react-vite': '8.0.0-alpha.7',
'@storybook/react-webpack5': '8.0.0-alpha.7',
'@storybook/router': '8.0.0-alpha.7',
'@storybook/server': '8.0.0-alpha.7',
'@storybook/server-webpack5': '8.0.0-alpha.7',
'@storybook/source-loader': '8.0.0-alpha.7',
'@storybook/svelte': '8.0.0-alpha.7',
'@storybook/svelte-vite': '8.0.0-alpha.7',
'@storybook/svelte-webpack5': '8.0.0-alpha.7',
'@storybook/sveltekit': '8.0.0-alpha.7',
'@storybook/telemetry': '8.0.0-alpha.7',
'@storybook/test': '8.0.0-alpha.7',
'@storybook/theming': '8.0.0-alpha.7',
'@storybook/types': '8.0.0-alpha.7',
'@storybook/vue3': '8.0.0-alpha.7',
'@storybook/vue3-vite': '8.0.0-alpha.7',
'@storybook/vue3-webpack5': '8.0.0-alpha.7',
'@storybook/web-components': '8.0.0-alpha.7',
'@storybook/web-components-vite': '8.0.0-alpha.7',
'@storybook/web-components-webpack5': '8.0.0-alpha.7',
sb: '8.0.0-alpha.7',
storybook: '8.0.0-alpha.7',
'@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/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',
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/client-logger",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/codemod",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "A collection of codemod scripts written with JSCodeshift",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-common",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-events",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Event names used in storybook core",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-server",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"

View File

@ -93,16 +93,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(
@ -149,7 +147,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,

View File

@ -42,7 +42,6 @@ const getStorySortParameterMock = vi.mocked(getStorySortParameter);
const options: StoryIndexGeneratorOptions = {
configDir: path.join(__dirname, '__mockdata__'),
workingDir: path.join(__dirname, '__mockdata__'),
storyIndexers: [],
indexers: [csfIndexer],
storyStoreV7: true,
docs: { defaultName: 'docs', autodocs: false },

View File

@ -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 {

View File

@ -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 },

View File

@ -23,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<DocsOptions>('docs', {});
const normalizedStories = normalizeStories(await stories, directories);
const generator = new StoryIndexGenerator(normalizedStories, {
...directories,
storyIndexers: await deprecatedStoryIndexers,
indexers: await indexers,
docs: await docsOptions,
workingDir,

View File

@ -42,7 +42,6 @@ const getInitializedStoryIndexGenerator = async (
inputNormalizedStories = normalizedStories
) => {
const options: StoryIndexGeneratorOptions = {
storyIndexers: [],
indexers: [csfIndexer],
configDir: workingDir,
workingDir,

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/csf-plugin",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Enrich CSF files via static analysis",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/csf-tools",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Parse and manipulate CSF and Storybook config files",
"keywords": [
"storybook"

View File

@ -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 = () => <Button />
@ -665,7 +665,9 @@ describe('enrichCsf', () => {
parameters: {
foo: 'bar',
docs: {
inlineStories: true,
story: {
inline: true
},
description: {
component: "The most basic button"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/docs-tools",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Shared utility functions for frameworks to implement docs",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/instrumenter",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/manager-api",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Core Storybook Manager API & Context",
"keywords": [
"storybook"

View File

@ -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<string, never>;
@ -75,12 +64,6 @@ export const init: ModuleFn<SubAPI, SubState> = ({ provider }) => {
}
provider.channel?.emit(type, data, ...args);
},
collapseAll: () => {
api.emit(STORIES_COLLAPSE_ALL, {});
},
expandAll: () => {
api.emit(STORIES_EXPAND_ALL);
},
};
return { api, state: {} };
};

View File

@ -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<void>;
}
export interface SubState {
@ -53,17 +46,6 @@ export const init: ModuleFn<SubAPI, SubState> = ({ 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();

View File

@ -1 +1 @@
export const version = '8.0.0-alpha.7';
export const version = '8.0.0-alpha.8';

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/node-logger",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preview-api",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preview",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react-dom-shim",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/router",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Core Storybook Router",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/source-loader",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Source loader",
"keywords": [
"lib",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/telemetry",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Telemetry logging for crash reports and usage statistics",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/test",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/theming",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Core Storybook Components",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/types",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Core Storybook TS Types",
"keywords": [
"storybook"

View File

@ -305,11 +305,6 @@ export type BaseStory<TArgs, StoryFnReturnType> =
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',
}

View File

@ -5,7 +5,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!
@ -409,8 +409,6 @@ export interface StorybookConfigRaw {
previewAnnotations?: Entry[];
storyIndexers?: StoryIndexer[];
experimental_indexers?: Indexer[];
docs?: DocsOptions;
@ -502,12 +500,6 @@ export interface StorybookConfig {
*/
previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
/**
* Process CSF files for the story index.
* @deprecated use {@link experimental_indexers} instead
*/
storyIndexers?: PresetValue<StorybookConfigRaw['storyIndexers']>;
/**
* Process CSF files for the story index.
*/

View File

@ -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<IndexInput[]>;
/**
* @deprecated Use {@link index} instead
*/
indexer?: never;
};
export type DeprecatedIndexer = BaseIndexer & {
indexer: (fileName: string, options: IndexerOptions) => Promise<IndexedCSFFile>;
createIndex?: never;
};
/**
* @deprecated Use {@link Indexer} instead
*/
export type StoryIndexer = Indexer | DeprecatedIndexer;
export interface BaseIndexEntry {
id: StoryId;
name: StoryName;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/root",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"private": true,
"description": "Storybook root",
"homepage": "https://storybook.js.org/",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-create-react-app",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Create React App preset",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-html-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-preact-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-react-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-server-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-svelte-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preset-vue3-webpack",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook HTML renderer",
"keywords": [
"storybook"

View File

@ -35,17 +35,6 @@ export type StoryFn<TArgs = Args> = AnnotatedStoryFn<HtmlRenderer, TArgs>;
*/
export type StoryObj<TArgs = Args> = StoryAnnotations<HtmlRenderer, TArgs>;
/**
* @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<TArgs = Args> = StoryFn<TArgs>;
export type Decorator<TArgs = StrictArgs> = DecoratorFunction<HtmlRenderer, TArgs>;
export type Loader<TArgs = StrictArgs> = LoaderFunction<HtmlRenderer, TArgs>;
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<HtmlRenderer, TArgs>;

View File

@ -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<HtmlRenderer>;
storyResult: StoryFnHtmlReturnType;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook Preact renderer",
"keywords": [
"storybook"

View File

@ -35,17 +35,6 @@ export type StoryFn<TArgs = Args> = AnnotatedStoryFn<PreactRenderer, TArgs>;
*/
export type StoryObj<TArgs = Args> = StoryAnnotations<PreactRenderer, TArgs>;
/**
* @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<TArgs = Args> = StoryFn<TArgs>;
export type Decorator<TArgs = StrictArgs> = DecoratorFunction<PreactRenderer, TArgs>;
export type Loader<TArgs = StrictArgs> = LoaderFunction<PreactRenderer, TArgs>;
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<PreactRenderer, TArgs>;

View File

@ -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<any, any>;
storyResult: StoryFnPreactReturnType;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook React renderer",
"keywords": [
"storybook"

View File

@ -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<any>;
/**
* Metadata to configure the stories for a component.
*
@ -74,73 +72,6 @@ type AddMocks<TArgs, DefaultArgs> = Simplify<{
: TArgs[T];
}>;
/**
* @deprecated Use `Meta` instead, e.g. ComponentMeta<typeof Button> -> Meta<typeof Button>.
*
* For the common case where a component's stories are simple components that receives args as props:
*
* ```tsx
* export default { ... } as ComponentMeta<typeof Button>;
* ```
*/
export type ComponentMeta<T extends JSXElement> = Meta<ComponentProps<T>>;
/**
* @deprecated Use `StoryFn` instead, e.g. ComponentStoryFn<typeof Button> -> StoryFn<typeof Button>.
* 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<typeof Button> = (args) => <Button {...args} />
* ```
*/
export type ComponentStoryFn<T extends JSXElement> = StoryFn<ComponentProps<T>>;
/**
* @deprecated Use `StoryObj` instead, e.g. ComponentStoryObj<typeof Button> -> StoryObj<typeof Button>.
*
* For the common case where a (CSFv3) story is a simple component that receives args as props:
*
* ```tsx
* const MyStory: ComponentStoryObj<typeof Button> = {
* args: { buttonArg1: 'val' },
* }
* ```
*/
export type ComponentStoryObj<T extends JSXElement> = StoryObj<ComponentProps<T>>;
/**
* @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<TArgs = Args> = StoryFn<TArgs>;
/**
* @deprecated Use `StoryFn` instead, e.g. ComponentStory<typeof Button> -> StoryFn<typeof Button>.
* 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<typeof Button> = {
* args: { buttonArg1: 'val' },
* }
* ```
*/
export type ComponentStory<T extends JSXElement> = ComponentStoryFn<T>;
/**
* @deprecated Use Decorator instead.
*/
export type DecoratorFn = DecoratorFunction<ReactRenderer>;
export type Decorator<TArgs = StrictArgs> = DecoratorFunction<ReactRenderer, TArgs>;
export type Loader<TArgs = StrictArgs> = LoaderFunction<ReactRenderer, TArgs>;
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<ReactRenderer, TArgs>;

View File

@ -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<this['T']>;
storyResult: StoryFnReactReturnType;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/server",
"version": "8.0.0-alpha.7",
"version": "8.0.0-alpha.8",
"description": "Storybook Server renderer",
"keywords": [
"storybook"

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