From 982a6948048301f192b38e52ea77dd44ab19014c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 10 Jun 2022 10:28:06 +0200 Subject: [PATCH] undo deprecations removal (will do this in a separate branch so it can be reviewed --- addons/a11y/package.json | 1 + addons/a11y/src/index.ts | 19 ++ addons/actions/package.json | 1 + addons/actions/src/preset/addDecorator.ts | 3 + addons/actions/src/preset/preview.tsx | 1 + addons/actions/src/preview/decorateAction.ts | 37 +++ addons/actions/src/preview/index.ts | 2 + addons/actions/src/preview/withActions.ts | 88 +++++++ addons/backgrounds/package.json | 1 + addons/backgrounds/src/decorators/withGrid.ts | 20 +- addons/docs/blocks.d.ts | 2 + addons/docs/blocks.js | 14 ++ addons/docs/package.json | 1 + addons/docs/src/blocks/DocsContainer.tsx | 20 +- addons/docs/src/blocks/DocsStory.tsx | 15 ++ addons/docs/src/blocks/Preview.tsx | 13 + addons/docs/src/blocks/Props.tsx | 19 ++ addons/docs/src/blocks/index.ts | 2 + addons/essentials/package.json | 1 + addons/jest/package.json | 1 + addons/links/package.json | 1 + addons/outline/package.json | 1 + .../storyshots/storyshots-core/package.json | 1 + .../storyshots-puppeteer/package.json | 3 +- addons/storysource/package.json | 3 +- addons/toolbars/package.json | 3 +- addons/viewport/package.json | 3 +- examples/external-docs/src/.storybook/main.ts | 1 + examples/official-storybook/main.ts | 1 + examples/react-ts/.storybook/main.ts | 1 + frameworks/angular/package.json | 1 + .../preview/angular-beta/StorybookModule.ts | 24 +- frameworks/ember/package.json | 1 + frameworks/html-webpack5/package.json | 3 +- frameworks/preact-webpack5/package.json | 3 +- frameworks/react-webpack5/package.json | 3 +- frameworks/server-webpack5/package.json | 3 +- frameworks/svelte-webpack5/package.json | 3 +- frameworks/vue-webpack5/package.json | 3 +- frameworks/vue3-webpack5/package.json | 3 +- .../web-components-webpack5/package.json | 3 +- lib/addons/package.json | 3 +- lib/api/package.json | 1 + lib/api/src/lib/stories.ts | 32 ++- lib/api/src/modules/addons.ts | 21 +- lib/api/src/modules/stories.ts | 27 ++ .../src/presets/custom-webpack-preset.ts | 16 +- lib/channels/src/index.ts | 9 + lib/client-api/package.json | 1 + lib/codemod/package.json | 3 +- lib/components/html.d.ts | 1 + lib/components/html.js | 1 + lib/components/package.json | 8 +- lib/components/src/html.tsx | 15 ++ lib/core-client/package.json | 2 + lib/core-client/src/globals/polyfills.ts | 3 + .../src/manager/conditional-polyfills.ts | 19 ++ lib/core-client/src/manager/index.ts | 7 +- lib/core-common/src/types.ts | 6 + .../src/utils/normalize-stories.ts | 13 +- .../src/utils/validate-configuration-files.ts | 13 + lib/core-server/package.json | 1 + lib/core-server/src/presets/common-preset.ts | 1 + lib/csf-tools/package.json | 1 + lib/docs-tools/package.json | 3 +- lib/manager-webpack5/package.json | 1 + lib/manager-webpack5/src/manager-config.ts | 19 +- lib/preview-web/package.json | 1 + lib/preview-web/src/PreviewWeb.tsx | 12 + lib/preview-web/src/UrlStore.ts | 15 ++ lib/router/package.json | 3 +- lib/source-loader/package.json | 3 +- lib/store/package.json | 1 + lib/store/src/GlobalsStore.ts | 13 +- lib/store/src/csf/normalizeStory.ts | 35 ++- lib/store/src/csf/prepareStory.ts | 21 +- lib/telemetry/package.json | 3 +- lib/theming/package.json | 3 +- lib/ui/package.json | 1 + .../notifications/NotificationList.stories.js | 10 +- presets/preact-webpack/package.json | 3 +- presets/react-webpack/package.json | 3 +- presets/server-webpack/package.json | 1 + presets/svelte-webpack/package.json | 1 + presets/vue-webpack/package.json | 1 + presets/vue3-webpack/package.json | 1 + presets/web-components-webpack/package.json | 3 +- renderers/html/package.json | 1 + renderers/preact/package.json | 1 + renderers/react/package.json | 1 + renderers/react/src/docs/jsxDecorator.tsx | 22 +- renderers/server/package.json | 1 + renderers/svelte/package.json | 1 + renderers/vue/package.json | 1 + renderers/vue3/package.json | 1 + renderers/web-components/package.json | 1 + yarn.lock | 236 +++++++++++++++++- 97 files changed, 890 insertions(+), 66 deletions(-) create mode 100644 addons/actions/src/preset/addDecorator.ts create mode 100644 addons/actions/src/preview/decorateAction.ts create mode 100644 addons/actions/src/preview/withActions.ts create mode 100644 addons/docs/blocks.d.ts create mode 100644 addons/docs/blocks.js create mode 100644 addons/docs/src/blocks/Preview.tsx create mode 100644 addons/docs/src/blocks/Props.tsx create mode 100644 lib/components/html.d.ts create mode 100644 lib/components/html.js create mode 100644 lib/components/src/html.tsx create mode 100644 lib/core-client/src/globals/polyfills.ts create mode 100644 lib/core-client/src/manager/conditional-polyfills.ts diff --git a/addons/a11y/package.json b/addons/a11y/package.json index a6a5bd3ddc70..40dee51f66f5 100644 --- a/addons/a11y/package.json +++ b/addons/a11y/package.json @@ -51,6 +51,7 @@ "global": "^4.4.0", "lodash": "^4.17.21", "react-sizeme": "^3.0.1", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, diff --git a/addons/a11y/src/index.ts b/addons/a11y/src/index.ts index cf8e35067af2..76e1182f2b4e 100644 --- a/addons/a11y/src/index.ts +++ b/addons/a11y/src/index.ts @@ -1,3 +1,7 @@ +import type { AnyFramework, DecoratorFunction } from '@storybook/csf'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; + export { PARAM_KEY } from './constants'; export * from './highlight'; export * from './params'; @@ -5,3 +9,18 @@ export * from './params'; if (module && module.hot && module.hot.decline) { module.hot.decline(); } + +export const withA11y: DecoratorFunction = deprecate( + (storyFn, storyContext) => { + return storyFn(storyContext); + }, + dedent` + withA11y(options) is deprecated, please configure addon-a11y using the addParameter api: + + addParameters({ + a11y: options, + }); + + More at: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#removed-witha11y-decorator + ` +); diff --git a/addons/actions/package.json b/addons/actions/package.json index 7abbf89d5000..fcc00a9a22bd 100644 --- a/addons/actions/package.json +++ b/addons/actions/package.json @@ -48,6 +48,7 @@ "polished": "^4.2.2", "prop-types": "^15.7.2", "react-inspector": "^5.1.0", + "regenerator-runtime": "^0.13.7", "telejson": "^6.0.8", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2", diff --git a/addons/actions/src/preset/addDecorator.ts b/addons/actions/src/preset/addDecorator.ts new file mode 100644 index 000000000000..f0044588cc2f --- /dev/null +++ b/addons/actions/src/preset/addDecorator.ts @@ -0,0 +1,3 @@ +import { withActions } from '../index'; + +export const decorators = [withActions]; diff --git a/addons/actions/src/preset/preview.tsx b/addons/actions/src/preset/preview.tsx index 7a06751b46dd..117c34f7196b 100644 --- a/addons/actions/src/preset/preview.tsx +++ b/addons/actions/src/preset/preview.tsx @@ -1 +1,2 @@ +export * from './addDecorator'; export * from './addArgs'; diff --git a/addons/actions/src/preview/decorateAction.ts b/addons/actions/src/preview/decorateAction.ts new file mode 100644 index 000000000000..b84f49bdb20a --- /dev/null +++ b/addons/actions/src/preview/decorateAction.ts @@ -0,0 +1,37 @@ +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; + +import { DecoratorFunction } from '../models'; + +export const decorateAction = (_decorators: DecoratorFunction[]) => { + return deprecate( + () => {}, + dedent` + decorateAction is no longer supported as of Storybook 6.0. + ` + ); +}; + +const deprecatedCallback = deprecate(() => {}, +'decorate.* is no longer supported as of Storybook 6.0.'); + +export const decorate = (_decorators: DecoratorFunction[]) => { + return deprecate( + () => { + return { + action: deprecatedCallback, + actions: deprecatedCallback, + withActions: deprecatedCallback, + }; + }, + dedent` + decorate is deprecated, please configure addon-actions using the addParameter api: + + addParameters({ + actions: { + handles: options + }, + }); + ` + ); +}; diff --git a/addons/actions/src/preview/index.ts b/addons/actions/src/preview/index.ts index 2edbd87475e9..b5358d2c4441 100644 --- a/addons/actions/src/preview/index.ts +++ b/addons/actions/src/preview/index.ts @@ -1,3 +1,5 @@ export * from './action'; export * from './actions'; export * from './configureActions'; +export * from './decorateAction'; +export * from './withActions'; diff --git a/addons/actions/src/preview/withActions.ts b/addons/actions/src/preview/withActions.ts new file mode 100644 index 000000000000..1a1c121f9309 --- /dev/null +++ b/addons/actions/src/preview/withActions.ts @@ -0,0 +1,88 @@ +// Based on http://backbonejs.org/docs/backbone.html#section-164 +import global from 'global'; +import { useEffect, makeDecorator } from '@storybook/addons'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; + +import { actions } from './actions'; + +import { PARAM_KEY } from '../constants'; + +const { document, Element } = global; + +const delegateEventSplitter = /^(\S+)\s*(.*)$/; + +const isIE = Element != null && !Element.prototype.matches; +const matchesMethod = isIE ? 'msMatchesSelector' : 'matches'; + +const root = document && document.getElementById('root'); + +const hasMatchInAncestry = (element: any, selector: any): boolean => { + if (element[matchesMethod](selector)) { + return true; + } + const parent = element.parentElement; + if (!parent) { + return false; + } + return hasMatchInAncestry(parent, selector); +}; + +const createHandlers = (actionsFn: (...arg: any[]) => object, ...handles: any[]) => { + const actionsObject = actionsFn(...handles); + return Object.entries(actionsObject).map(([key, action]) => { + const [_, eventName, selector] = key.match(delegateEventSplitter); + return { + eventName, + handler: (e: { target: any }) => { + if (!selector || hasMatchInAncestry(e.target, selector)) { + action(e); + } + }, + }; + }); +}; + +const applyEventHandlers = deprecate( + (actionsFn: any, ...handles: any[]) => { + useEffect(() => { + if (root != null) { + const handlers = createHandlers(actionsFn, ...handles); + handlers.forEach(({ eventName, handler }) => root.addEventListener(eventName, handler)); + return () => + handlers.forEach(({ eventName, handler }) => + root.removeEventListener(eventName, handler) + ); + } + return undefined; + }, [root, actionsFn, handles]); + }, + dedent` + withActions(options) is deprecated, please configure addon-actions using the addParameter api: + + addParameters({ + actions: { + handles: options + }, + }); + ` +); + +const applyDeprecatedOptions = (actionsFn: any, options: any[]) => { + if (options) { + applyEventHandlers(actionsFn, options); + } +}; + +export const withActions = makeDecorator({ + name: 'withActions', + parameterName: PARAM_KEY, + skipIfNoParametersOrOptions: true, + wrapper: (getStory, context, { parameters, options }) => { + applyDeprecatedOptions(actions, options as any[]); + + if (parameters && parameters.handles) applyEventHandlers(actions, ...parameters.handles); + + return getStory(context); + }, +}); diff --git a/addons/backgrounds/package.json b/addons/backgrounds/package.json index 190fba19c181..715ebc20fce9 100644 --- a/addons/backgrounds/package.json +++ b/addons/backgrounds/package.json @@ -48,6 +48,7 @@ "core-js": "^3.8.2", "global": "^4.4.0", "memoizerific": "^1.11.3", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, diff --git a/addons/backgrounds/src/decorators/withGrid.ts b/addons/backgrounds/src/decorators/withGrid.ts index a00d34246538..35ba05383ffc 100644 --- a/addons/backgrounds/src/decorators/withGrid.ts +++ b/addons/backgrounds/src/decorators/withGrid.ts @@ -1,9 +1,21 @@ +import dedent from 'ts-dedent'; +import deprecate from 'util-deprecate'; import { useMemo, useEffect } from '@storybook/addons'; import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf'; import { clearStyles, addGridStyle } from '../helpers'; import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants'; +const deprecatedCellSizeWarning = deprecate( + () => {}, + dedent` + Backgrounds Addon: The cell size parameter has been changed. + + - parameters.grid.cellSize should now be parameters.backgrounds.grid.cellSize + See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-grid-parameter + ` +); + export const withGrid = ( StoryFn: StoryFunction, context: StoryContext @@ -14,7 +26,13 @@ export const withGrid = ( const { cellAmount, cellSize, opacity } = gridParameters; const isInDocs = context.viewMode === 'docs'; - const gridSize: number = cellSize; + let gridSize: number; + if (parameters.grid?.cellSize) { + gridSize = parameters.grid.cellSize; + deprecatedCellSizeWarning(); + } else { + gridSize = cellSize; + } const isLayoutPadded = parameters.layout === undefined || parameters.layout === 'padded'; // 16px offset in the grid to account for padded layout diff --git a/addons/docs/blocks.d.ts b/addons/docs/blocks.d.ts new file mode 100644 index 000000000000..b35f3588902f --- /dev/null +++ b/addons/docs/blocks.d.ts @@ -0,0 +1,2 @@ +export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components'; +export * from './dist/types/blocks/index.d'; diff --git a/addons/docs/blocks.js b/addons/docs/blocks.js new file mode 100644 index 000000000000..e29483b319c4 --- /dev/null +++ b/addons/docs/blocks.js @@ -0,0 +1,14 @@ +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; + +const warnBlocksImport = deprecate( + () => {}, + dedent` + Importing from '@storybook/addon-docs/blocks' is deprecated, import directly from '@storybook/addon-docs' instead: + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-scoped-blocks-imports +` +); +warnBlocksImport(); + +export * from './dist/esm/blocks'; diff --git a/addons/docs/package.json b/addons/docs/package.json index 73c91022cea7..cfca61ba9ff8 100644 --- a/addons/docs/package.json +++ b/addons/docs/package.json @@ -71,6 +71,7 @@ "fast-deep-equal": "^3.1.3", "global": "^4.4.0", "lodash": "^4.17.21", + "regenerator-runtime": "^0.13.7", "remark-external-links": "^8.0.0", "remark-slug": "^6.0.0", "ts-dedent": "^2.0.0", diff --git a/addons/docs/src/blocks/DocsContainer.tsx b/addons/docs/src/blocks/DocsContainer.tsx index 891f1182530e..66d904b1f5df 100644 --- a/addons/docs/src/blocks/DocsContainer.tsx +++ b/addons/docs/src/blocks/DocsContainer.tsx @@ -1,5 +1,7 @@ import React, { FunctionComponent, useEffect } from 'react'; import global from 'global'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import { MDXProvider } from '@mdx-js/react'; import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming'; import { DocsWrapper, DocsContent, components as htmlComponents } from '@storybook/components'; @@ -24,13 +26,25 @@ const defaultComponents = { ...HeadersMdx, }; +const warnOptionsTheme = deprecate( + () => {}, + dedent` + Deprecated parameter: options.theme => docs.theme + + https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/theming.md#storybook-theming +` +); + export const DocsContainer: FunctionComponent = ({ context, children }) => { const { id: storyId, storyById } = context; const { - parameters: { docs = {} }, + parameters: { options = {}, docs = {} }, } = storyById(storyId); - const themeVars = docs.theme; - + let themeVars = docs.theme; + if (!themeVars && options.theme) { + warnOptionsTheme(); + themeVars = options.theme; + } const theme = ensureTheme(themeVars); const allComponents = { ...defaultComponents, ...docs.components }; diff --git a/addons/docs/src/blocks/DocsStory.tsx b/addons/docs/src/blocks/DocsStory.tsx index a97b3043c134..7b45c7e91889 100644 --- a/addons/docs/src/blocks/DocsStory.tsx +++ b/addons/docs/src/blocks/DocsStory.tsx @@ -1,4 +1,6 @@ import React, { FunctionComponent } from 'react'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import { Subheading } from './Subheading'; import { DocsStoryProps } from './types'; import { Anchor } from './Anchor'; @@ -6,6 +8,15 @@ import { Description } from './Description'; import { Story } from './Story'; import { Canvas } from './Canvas'; +const warnStoryDescription = deprecate( + () => {}, + dedent` + Deprecated parameter: docs.storyDescription => docs.description.story + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#docs-description-parameter + ` +); + export const DocsStory: FunctionComponent = ({ id, name, @@ -17,6 +28,10 @@ export const DocsStory: FunctionComponent = ({ const { docs } = parameters; if (expanded && docs) { description = docs.description?.story; + if (!description) { + description = docs.storyDescription; + if (description) warnStoryDescription(); + } } const subheading = expanded && name; diff --git a/addons/docs/src/blocks/Preview.tsx b/addons/docs/src/blocks/Preview.tsx new file mode 100644 index 000000000000..94bb226fa0fd --- /dev/null +++ b/addons/docs/src/blocks/Preview.tsx @@ -0,0 +1,13 @@ +import React, { ComponentProps } from 'react'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; +import { Canvas } from './Canvas'; + +export const Preview = deprecate( + (props: ComponentProps) => , + dedent` + Preview doc block has been renamed to Canvas. + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#previewprops-renamed + ` +); diff --git a/addons/docs/src/blocks/Props.tsx b/addons/docs/src/blocks/Props.tsx new file mode 100644 index 000000000000..f251ed3575b3 --- /dev/null +++ b/addons/docs/src/blocks/Props.tsx @@ -0,0 +1,19 @@ +import React, { ComponentProps } from 'react'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; +import { ArgsTable } from './ArgsTable'; +import { CURRENT_SELECTION } from './types'; + +export const Props = deprecate( + (props: ComponentProps) => , + dedent` + Props doc block has been renamed to ArgsTable. + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#previewprops-renamed + ` +); + +// @ts-ignore +Props.defaultProps = { + of: CURRENT_SELECTION, +}; diff --git a/addons/docs/src/blocks/index.ts b/addons/docs/src/blocks/index.ts index e644a8748ca8..7096967b0db3 100644 --- a/addons/docs/src/blocks/index.ts +++ b/addons/docs/src/blocks/index.ts @@ -10,7 +10,9 @@ export * from './DocsContainer'; export * from './DocsStory'; export * from './Heading'; export * from './Meta'; +export * from './Preview'; export * from './Primary'; +export * from './Props'; export * from './Source'; export * from './SourceContainer'; export * from './Stories'; diff --git a/addons/essentials/package.json b/addons/essentials/package.json index 95e38ce85acf..c5db8de2fbc8 100644 --- a/addons/essentials/package.json +++ b/addons/essentials/package.json @@ -45,6 +45,7 @@ "@storybook/core-common": "7.0.0-alpha.1", "@storybook/node-logger": "7.0.0-alpha.1", "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/addons/jest/package.json b/addons/jest/package.json index d05efb7d4646..bad839b2ab75 100644 --- a/addons/jest/package.json +++ b/addons/jest/package.json @@ -49,6 +49,7 @@ "core-js": "^3.8.2", "global": "^4.4.0", "react-sizeme": "^3.0.1", + "regenerator-runtime": "^0.13.7", "upath": "^1.2.0" }, "peerDependencies": { diff --git a/addons/links/package.json b/addons/links/package.json index a08f3fcd5467..72f571aef1fc 100644 --- a/addons/links/package.json +++ b/addons/links/package.json @@ -42,6 +42,7 @@ "core-js": "^3.8.2", "global": "^4.4.0", "prop-types": "^15.7.2", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "peerDependencies": { diff --git a/addons/outline/package.json b/addons/outline/package.json index d466bb664f1f..49818a206ea7 100644 --- a/addons/outline/package.json +++ b/addons/outline/package.json @@ -48,6 +48,7 @@ "@storybook/csf": "0.0.2--canary.4566f4d.1", "core-js": "^3.8.2", "global": "^4.4.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "peerDependencies": { diff --git a/addons/storyshots/storyshots-core/package.json b/addons/storyshots/storyshots-core/package.json index 85511097af9e..cbf9b95e6eae 100644 --- a/addons/storyshots/storyshots-core/package.json +++ b/addons/storyshots/storyshots-core/package.json @@ -55,6 +55,7 @@ "pretty-format": "^26.6.2", "react-test-renderer": "^16.8.0 || ^17.0.0", "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/addons/storyshots/storyshots-puppeteer/package.json b/addons/storyshots/storyshots-puppeteer/package.json index fe993a95c467..ec9f01fcd570 100644 --- a/addons/storyshots/storyshots-puppeteer/package.json +++ b/addons/storyshots/storyshots-puppeteer/package.json @@ -38,7 +38,8 @@ "@storybook/node-logger": "7.0.0-alpha.1", "@types/jest-image-snapshot": "^4.1.3", "core-js": "^3.8.2", - "jest-image-snapshot": "^4.3.0" + "jest-image-snapshot": "^4.3.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "@storybook/csf": "0.0.2--canary.4566f4d.1", diff --git a/addons/storysource/package.json b/addons/storysource/package.json index 40bffa0c7638..3a35313e5019 100644 --- a/addons/storysource/package.json +++ b/addons/storysource/package.json @@ -44,7 +44,8 @@ "core-js": "^3.8.2", "estraverse": "^5.2.0", "prop-types": "^15.7.2", - "react-syntax-highlighter": "^15.4.5" + "react-syntax-highlighter": "^15.4.5", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "@types/react": "^16.14.23", diff --git a/addons/toolbars/package.json b/addons/toolbars/package.json index f2de280a414d..152ffd4ce3c2 100644 --- a/addons/toolbars/package.json +++ b/addons/toolbars/package.json @@ -43,7 +43,8 @@ "@storybook/client-logger": "7.0.0-alpha.1", "@storybook/components": "7.0.0-alpha.1", "@storybook/theming": "7.0.0-alpha.1", - "core-js": "^3.8.2" + "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/addons/viewport/package.json b/addons/viewport/package.json index 14b540235361..f30ac5031530 100644 --- a/addons/viewport/package.json +++ b/addons/viewport/package.json @@ -44,7 +44,8 @@ "core-js": "^3.8.2", "global": "^4.4.0", "memoizerific": "^1.11.3", - "prop-types": "^15.7.2" + "prop-types": "^15.7.2", + "regenerator-runtime": "^0.13.7" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/examples/external-docs/src/.storybook/main.ts b/examples/external-docs/src/.storybook/main.ts index 3a851ac365a8..68037f6e019a 100644 --- a/examples/external-docs/src/.storybook/main.ts +++ b/examples/external-docs/src/.storybook/main.ts @@ -24,6 +24,7 @@ const config: StorybookConfig = { storyStoreV7: !global.navigator?.userAgent?.match?.('jsdom'), buildStoriesJson: true, babelModeV7: true, + warnOnLegacyHierarchySeparator: false, previewMdx2: true, }, framework: '@storybook/react-webpack5', diff --git a/examples/official-storybook/main.ts b/examples/official-storybook/main.ts index 8111437dfb2d..d931060beb05 100644 --- a/examples/official-storybook/main.ts +++ b/examples/official-storybook/main.ts @@ -38,6 +38,7 @@ const config: StorybookConfig = { logLevel: 'debug', features: { interactionsDebugger: true, + breakingChangesV7: false, storyStoreV7: false, }, staticDirs: [ diff --git a/examples/react-ts/.storybook/main.ts b/examples/react-ts/.storybook/main.ts index ea972ccd9f7a..3f489885636c 100644 --- a/examples/react-ts/.storybook/main.ts +++ b/examples/react-ts/.storybook/main.ts @@ -39,6 +39,7 @@ const config: StorybookConfig = { storyStoreV7: !global.navigator?.userAgent?.match?.('jsdom'), buildStoriesJson: true, babelModeV7: true, + warnOnLegacyHierarchySeparator: false, previewMdx2: true, breakingChangesV7: true, }, diff --git a/frameworks/angular/package.json b/frameworks/angular/package.json index 712e526f2830..e37745a8d5f5 100644 --- a/frameworks/angular/package.json +++ b/frameworks/angular/package.json @@ -62,6 +62,7 @@ "react": "^16.14.0", "react-dom": "^16.14.0", "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7", "sass-loader": "^12.6.0", "telejson": "^6.0.8", "ts-dedent": "^2.0.0", diff --git a/frameworks/angular/src/client/preview/angular-beta/StorybookModule.ts b/frameworks/angular/src/client/preview/angular-beta/StorybookModule.ts index a5cdf678d81d..275b490c18bc 100644 --- a/frameworks/angular/src/client/preview/angular-beta/StorybookModule.ts +++ b/frameworks/angular/src/client/preview/angular-beta/StorybookModule.ts @@ -1,7 +1,9 @@ import { NgModule, Type } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; +import dedent from 'ts-dedent'; import { Subject } from 'rxjs'; +import deprecate from 'util-deprecate'; import { ICollection, StoryFnAngularReturnType } from '../types'; import { storyPropsProvider } from './StorybookProvider'; import { isComponentAlreadyDeclaredInModules } from './utils/NgModulesAnalyzer'; @@ -9,6 +11,21 @@ import { isDeclarable, isStandaloneComponent } from './utils/NgComponentAnalyzer import { createStorybookWrapperComponent } from './StorybookWrapperComponent'; import { computesTemplateFromComponent } from './ComputesTemplateFromComponent'; +const deprecatedStoryComponentWarning = deprecate( + () => {}, + dedent`\`component\` story return value is deprecated, and will be removed in Storybook 7.0. + Instead, use \`export const default = () => ({ component: AppComponent });\` + or + \`\`\` + export const Primary: Story = () => ({}); + Primary.parameters = { component: AppComponent }; + \`\`\` + Read more at + - https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-angular-story-component). + - https://storybook.js.org/docs/angular/writing-stories/parameters + ` +); + export const getStorybookModuleMetadata = ( { storyFnAngular, @@ -21,10 +38,13 @@ export const getStorybookModuleMetadata = ( }, storyProps$: Subject ): NgModule => { - const { props, styles, moduleMetadata = {} } = storyFnAngular; + const { component: storyComponent, props, styles, moduleMetadata = {} } = storyFnAngular; let { template } = storyFnAngular; - const component = annotatedComponent; + if (storyComponent) { + deprecatedStoryComponentWarning(); + } + const component = storyComponent ?? annotatedComponent; if (hasNoTemplate(template) && component) { template = computesTemplateFromComponent(component, props, ''); diff --git a/frameworks/ember/package.json b/frameworks/ember/package.json index f19e23fea4a8..c210a01ba55a 100644 --- a/frameworks/ember/package.json +++ b/frameworks/ember/package.json @@ -40,6 +40,7 @@ "react": "16.14.0", "react-dom": "16.14.0", "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "peerDependencies": { diff --git a/frameworks/html-webpack5/package.json b/frameworks/html-webpack5/package.json index 8a105d4bc417..f03607c5fb36 100644 --- a/frameworks/html-webpack5/package.json +++ b/frameworks/html-webpack5/package.json @@ -41,7 +41,8 @@ "core-js": "^3.8.2", "global": "^4.4.0", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "peerDependencies": { "@babel/core": "*" diff --git a/frameworks/preact-webpack5/package.json b/frameworks/preact-webpack5/package.json index 24f8e25a464f..72d0c9f68180 100644 --- a/frameworks/preact-webpack5/package.json +++ b/frameworks/preact-webpack5/package.json @@ -40,7 +40,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "preact": "^10.5.13" diff --git a/frameworks/react-webpack5/package.json b/frameworks/react-webpack5/package.json index eb2aae735c9b..8c2812f06485 100644 --- a/frameworks/react-webpack5/package.json +++ b/frameworks/react-webpack5/package.json @@ -38,7 +38,8 @@ "@storybook/preset-react-webpack": "7.0.0-alpha.1", "@storybook/react": "7.0.0-alpha.1", "@types/node": "^14.14.20 || ^16.0.0", - "core-js": "^3.8.2" + "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "jest-specific-snapshot": "^4.0.0" diff --git a/frameworks/server-webpack5/package.json b/frameworks/server-webpack5/package.json index ea5813f25ade..146d8c856e90 100644 --- a/frameworks/server-webpack5/package.json +++ b/frameworks/server-webpack5/package.json @@ -40,7 +40,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "engines": { "node": ">=10.13.0" diff --git a/frameworks/svelte-webpack5/package.json b/frameworks/svelte-webpack5/package.json index b9f116cc3793..cefc0f47d9be 100644 --- a/frameworks/svelte-webpack5/package.json +++ b/frameworks/svelte-webpack5/package.json @@ -40,7 +40,8 @@ "@storybook/svelte": "7.0.0-alpha.1", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "svelte": "^3.48.0", diff --git a/frameworks/vue-webpack5/package.json b/frameworks/vue-webpack5/package.json index e2f47011c5bb..72f893326815 100644 --- a/frameworks/vue-webpack5/package.json +++ b/frameworks/vue-webpack5/package.json @@ -40,7 +40,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "vue": "^2.6.12", diff --git a/frameworks/vue3-webpack5/package.json b/frameworks/vue3-webpack5/package.json index ffe75ea28250..e06b81942ca1 100644 --- a/frameworks/vue3-webpack5/package.json +++ b/frameworks/vue3-webpack5/package.json @@ -40,7 +40,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "@vue/compiler-sfc": "3.0.0", diff --git a/frameworks/web-components-webpack5/package.json b/frameworks/web-components-webpack5/package.json index 617e33c22a14..d5903f61f55e 100644 --- a/frameworks/web-components-webpack5/package.json +++ b/frameworks/web-components-webpack5/package.json @@ -43,7 +43,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "lit-html": "2.0.2" diff --git a/lib/addons/package.json b/lib/addons/package.json index 9c84a1b1aff6..f5575c367480 100644 --- a/lib/addons/package.json +++ b/lib/addons/package.json @@ -42,7 +42,8 @@ "@storybook/theming": "7.0.0-alpha.1", "@types/webpack-env": "^1.16.4", "core-js": "^3.8.2", - "global": "^4.4.0" + "global": "^4.4.0", + "regenerator-runtime": "^0.13.7" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/lib/api/package.json b/lib/api/package.json index 95ff0236859a..e196ce309a36 100644 --- a/lib/api/package.json +++ b/lib/api/package.json @@ -43,6 +43,7 @@ "global": "^4.4.0", "lodash": "^4.17.21", "memoizerific": "^1.11.3", + "regenerator-runtime": "^0.13.7", "store2": "^2.12.0", "telejson": "^6.0.8", "ts-dedent": "^2.0.0", diff --git a/lib/api/src/lib/stories.ts b/lib/api/src/lib/stories.ts index af10c623d1f1..38023cdd8fd3 100644 --- a/lib/api/src/lib/stories.ts +++ b/lib/api/src/lib/stories.ts @@ -1,5 +1,6 @@ import memoize from 'memoizerific'; import React from 'react'; +import deprecate from 'util-deprecate'; import dedent from 'ts-dedent'; import mapValues from 'lodash/mapValues'; import countBy from 'lodash/countBy'; @@ -20,6 +21,8 @@ import merge from './merge'; import type { Provider } from '../modules/provider'; import type { ViewMode } from '../modules/addons'; +const { FEATURES } = global; + export type { StoryId }; export interface Root { @@ -144,6 +147,23 @@ export type SetStoriesPayload = stories: StoriesRaw; } & Record); +const warnLegacyShowRoots = deprecate( + () => {}, + dedent` + The 'showRoots' config option is deprecated and will be removed in Storybook 7.0. Use 'sidebar.showRoots' instead. + Read more about it in the migration guide: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md + ` +); + +const warnChangedDefaultHierarchySeparators = deprecate( + () => {}, + dedent` + The default hierarchy separators changed in Storybook 6.0. + '|' and '.' will no longer create a hierarchy, but codemods are available. + Read more about it in the migration guide: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md + ` +); + export const denormalizeStoryParameters = ({ globalParameters, kindParameters, @@ -188,13 +208,21 @@ export const transformStoriesRawToStoriesHash = ( { provider, prepared = true }: { provider: Provider; prepared?: Story['prepared'] } ): StoriesHash => { const values = Object.values(input).filter(Boolean); + const usesOldHierarchySeparator = values.some(({ kind }) => kind.match(/\.|\|/)); // dot or pipe const storiesHashOutOfOrder = values.reduce((acc, item) => { const { kind, parameters } = item; - const { sidebar = {} } = provider.getConfig(); - const { showRoots, collapsedRoots = [], renderLabel } = sidebar; + const { sidebar = {}, showRoots: deprecatedShowRoots } = provider.getConfig(); + const { showRoots = deprecatedShowRoots, collapsedRoots = [], renderLabel } = sidebar; + + if (typeof deprecatedShowRoots !== 'undefined') { + warnLegacyShowRoots(); + } const setShowRoots = typeof showRoots !== 'undefined'; + if (usesOldHierarchySeparator && !setShowRoots && FEATURES?.warnOnLegacyHierarchySeparator) { + warnChangedDefaultHierarchySeparators(); + } const groups = kind.trim().split(STORY_KIND_PATH_SEPARATOR); const root = (!setShowRoots || showRoots) && groups.length > 1 ? [groups.shift()] : []; diff --git a/lib/api/src/modules/addons.ts b/lib/api/src/modules/addons.ts index 888af9d2af46..8a336b9ea741 100644 --- a/lib/api/src/modules/addons.ts +++ b/lib/api/src/modules/addons.ts @@ -1,10 +1,21 @@ import type { ReactElement } from 'react'; import type { RenderData } from '@storybook/router'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import type { ModuleFn } from '../index'; import type { Options } from '../store'; import { isStory } from '../lib/stories'; +const warnDisabledDeprecated = deprecate( + () => {}, + dedent` + Use 'parameters.key.disable' instead of 'parameters.key.disabled'. + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-disabled-parameter + ` +); + export type ViewMode = 'story' | 'info' | 'settings' | 'page' | undefined | string; export enum types { @@ -104,7 +115,15 @@ export const init: ModuleFn = ({ provider, store, fullAPI }) => { const filteredPanels: Collection = {}; Object.entries(allPanels).forEach(([id, panel]) => { const { paramKey } = panel; - if (paramKey && parameters && parameters[paramKey] && parameters[paramKey].disable) { + if ( + paramKey && + parameters && + parameters[paramKey] && + (parameters[paramKey].disabled || parameters[paramKey].disable) + ) { + if (parameters[paramKey].disabled) { + warnDisabledDeprecated(); + } return; } filteredPanels[id] = panel; diff --git a/lib/api/src/modules/stories.ts b/lib/api/src/modules/stories.ts index 8ef97a886241..5563c3216e28 100644 --- a/lib/api/src/modules/stories.ts +++ b/lib/api/src/modules/stories.ts @@ -102,6 +102,30 @@ interface Meta { type: string; } +const deprecatedOptionsParameterWarnings: Record void> = [ + 'enableShortcuts', + 'theme', + 'showRoots', +].reduce((acc, option: string) => { + acc[option] = deprecate( + () => {}, + `parameters.options.${option} is deprecated and will be removed in Storybook 7.0. +To change this setting, use \`addons.setConfig\`. See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-immutable-options-parameters + ` + ); + return acc; +}, {} as Record void>); +function checkDeprecatedOptionParameters(options?: Record) { + if (!options) { + return; + } + Object.keys(options).forEach((option: string) => { + if (deprecatedOptionsParameterWarnings[option]) { + deprecatedOptionsParameterWarnings[option](); + } + }); +} + export const init: ModuleFn = ({ fullAPI, store, @@ -428,6 +452,7 @@ export const init: ModuleFn = ({ const options = fullAPI.getCurrentParameter('options'); if (options) { + checkDeprecatedOptionParameters(options); fullAPI.setOptions(options); } } @@ -440,6 +465,7 @@ export const init: ModuleFn = ({ if (!ref) { if (!store.getState().hasCalledSetOptions) { const { options } = update.parameters; + checkDeprecatedOptionParameters(options); fullAPI.setOptions(options); store.setState({ hasCalledSetOptions: true }); } @@ -473,6 +499,7 @@ export const init: ModuleFn = ({ fullAPI.setStories(stories); const options = fullAPI.getCurrentParameter('options'); + checkDeprecatedOptionParameters(options); fullAPI.setOptions(options); } else { fullAPI.setRef(ref.id, { ...ref, ...data, stories }, true); diff --git a/lib/builder-webpack5/src/presets/custom-webpack-preset.ts b/lib/builder-webpack5/src/presets/custom-webpack-preset.ts index 2a085f7a8e16..4e90f7bcea03 100644 --- a/lib/builder-webpack5/src/presets/custom-webpack-preset.ts +++ b/lib/builder-webpack5/src/presets/custom-webpack-preset.ts @@ -2,11 +2,14 @@ import * as webpackReal from 'webpack'; import { logger } from '@storybook/node-logger'; import type { Options, CoreConfig } from '@storybook/core-common'; import type { Configuration } from 'webpack'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import { loadCustomWebpackConfig } from '@storybook/core-webpack'; import { createDefaultWebpackConfig } from '../preview/base-webpack.config'; export async function webpack(config: Configuration, options: Options) { - const { configDir, configType, presets } = options; + // @ts-ignore + const { configDir, configType, presets, webpackConfig } = options; const coreOptions = await presets.apply('core'); @@ -17,7 +20,16 @@ export async function webpack(config: Configuration, options: Options) { const finalDefaultConfig = await presets.apply('webpackFinal', defaultConfig, options); - // TODO: I feel like we want to delete this feature entirely + // through standalone webpackConfig option + if (webpackConfig) { + return deprecate( + webpackConfig, + dedent` + You've provided a webpack config directly in CallOptions, this is not recommended. Please use presets instead. This feature will be removed in 7.0 + ` + )(finalDefaultConfig); + } + // Check whether user has a custom webpack config file and // return the (extended) base configuration if it's not available. const customConfig = loadCustomWebpackConfig(configDir); diff --git a/lib/channels/src/index.ts b/lib/channels/src/index.ts index 23e7b2bab42f..a28ba2ece04e 100644 --- a/lib/channels/src/index.ts +++ b/lib/channels/src/index.ts @@ -62,6 +62,15 @@ export class Channel { this.events[eventName].push(listener); } + addPeerListener = deprecate( + (eventName: string, listener: Listener) => { + this.addListener(eventName, listener); + }, + dedent` + channel.addPeerListener is deprecated + ` + ); + emit(eventName: string, ...args: any) { const event: ChannelEvent = { type: eventName, args, from: this.sender }; let options = {}; diff --git a/lib/client-api/package.json b/lib/client-api/package.json index 0e5ace42ca16..6815c3eade8c 100644 --- a/lib/client-api/package.json +++ b/lib/client-api/package.json @@ -48,6 +48,7 @@ "lodash": "^4.17.21", "memoizerific": "^1.11.3", "qs": "^6.10.0", + "regenerator-runtime": "^0.13.7", "store2": "^2.12.0", "synchronous-promise": "^2.0.15", "ts-dedent": "^2.0.0", diff --git a/lib/codemod/package.json b/lib/codemod/package.json index 55ffce90c8ab..d272317d2f09 100644 --- a/lib/codemod/package.json +++ b/lib/codemod/package.json @@ -52,7 +52,8 @@ "jscodeshift": "^0.13.1", "lodash": "^4.17.21", "prettier": ">=2.2.1 <=2.3.0", - "recast": "^0.19.0" + "recast": "^0.19.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "jest": "^26.6.3", diff --git a/lib/components/html.d.ts b/lib/components/html.d.ts new file mode 100644 index 000000000000..9cb039290c2f --- /dev/null +++ b/lib/components/html.d.ts @@ -0,0 +1 @@ +export * from './dist/html'; diff --git a/lib/components/html.js b/lib/components/html.js new file mode 100644 index 000000000000..9cb039290c2f --- /dev/null +++ b/lib/components/html.js @@ -0,0 +1 @@ +export * from './dist/html'; diff --git a/lib/components/package.json b/lib/components/package.json index 02652595bae1..f11b6bece059 100644 --- a/lib/components/package.json +++ b/lib/components/package.json @@ -26,6 +26,11 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, + "./html": { + "require": "./dist/html.js", + "import": "./dist/html.mjs", + "types": "./dist/html.d.ts" + }, "./package.json": { "require": "./package.json", "import": "./package.json", @@ -82,7 +87,8 @@ "access": "public" }, "bundlerEntrypoint": [ - "./src/index.ts" + "./src/index.ts", + "./src/html.tsx" ], "gitHead": "b90b85210f66da59656c2ef58b0910b156256bea" } diff --git a/lib/components/src/html.tsx b/lib/components/src/html.tsx new file mode 100644 index 000000000000..47480e067a46 --- /dev/null +++ b/lib/components/src/html.tsx @@ -0,0 +1,15 @@ +import dedent from 'ts-dedent'; +import deprecate from 'util-deprecate'; + +const deprecatedHtmlEndpoint = deprecate( + () => {}, + dedent` + The entry point '@storybook/components/html' is deprecated. Please use '@storybook/components' directly instead. + + See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-storybook-components-html-entry-point + ` +); +deprecatedHtmlEndpoint(); + +export * from './typography/DocumentFormatting'; +export { components, resetComponents } from './index'; diff --git a/lib/core-client/package.json b/lib/core-client/package.json index bda31a0ca6c5..29175c322ad8 100644 --- a/lib/core-client/package.json +++ b/lib/core-client/package.json @@ -43,11 +43,13 @@ "@storybook/preview-web": "7.0.0-alpha.1", "@storybook/store": "7.0.0-alpha.1", "@storybook/ui": "7.0.0-alpha.1", + "airbnb-js-shims": "^2.2.1", "ansi-to-html": "^0.6.11", "core-js": "^3.8.2", "global": "^4.4.0", "lodash": "^4.17.21", "qs": "^6.10.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0", "unfetch": "^4.2.0", "util-deprecate": "^1.0.2" diff --git a/lib/core-client/src/globals/polyfills.ts b/lib/core-client/src/globals/polyfills.ts new file mode 100644 index 000000000000..23015707ef0b --- /dev/null +++ b/lib/core-client/src/globals/polyfills.ts @@ -0,0 +1,3 @@ +import 'regenerator-runtime/runtime'; +import 'airbnb-js-shims'; +import 'core-js/features/symbol'; diff --git a/lib/core-client/src/manager/conditional-polyfills.ts b/lib/core-client/src/manager/conditional-polyfills.ts new file mode 100644 index 000000000000..146dd4155f55 --- /dev/null +++ b/lib/core-client/src/manager/conditional-polyfills.ts @@ -0,0 +1,19 @@ +import global from 'global'; + +const { window: globalWindow } = global; + +export const importPolyfills = () => { + const polyfills = []; + + if (!globalWindow.fetch) { + // manually patch window.fetch; + // see issue: + const patch = ({ default: fetch }: any) => { + globalWindow.fetch = fetch; + }; + + polyfills.push(import('unfetch/dist/unfetch').then(patch)); + } + + return Promise.all(polyfills); +}; diff --git a/lib/core-client/src/manager/index.ts b/lib/core-client/src/manager/index.ts index 45f7a9f8098b..03226e41961e 100644 --- a/lib/core-client/src/manager/index.ts +++ b/lib/core-client/src/manager/index.ts @@ -2,8 +2,11 @@ import global from 'global'; import { renderStorybookUI } from '@storybook/ui'; import Provider from './provider'; +import { importPolyfills } from './conditional-polyfills'; const { document } = global; -const rootEl = document.getElementById('root'); -renderStorybookUI(rootEl, new Provider()); +importPolyfills().then(() => { + const rootEl = document.getElementById('root'); + renderStorybookUI(rootEl, new Provider()); +}); diff --git a/lib/core-common/src/types.ts b/lib/core-common/src/types.ts index d1df724bd549..1fa59cfcbc98 100644 --- a/lib/core-common/src/types.ts +++ b/lib/core-common/src/types.ts @@ -366,6 +366,12 @@ export interface StorybookConfig { */ argTypeTargetsV7?: boolean; + /** + * Warn when there is a pre-6.0 hierarchy separator ('.' / '|') in the story title. + * Will be removed in 7.0. + */ + warnOnLegacyHierarchySeparator?: boolean; + /** * Preview MDX2 support, will become default in 7.0 */ diff --git a/lib/core-common/src/utils/normalize-stories.ts b/lib/core-common/src/utils/normalize-stories.ts index 6a237b03c4aa..3f1e66b76862 100644 --- a/lib/core-common/src/utils/normalize-stories.ts +++ b/lib/core-common/src/utils/normalize-stories.ts @@ -1,5 +1,7 @@ import fs from 'fs'; import path from 'path'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import { scan } from 'picomatch'; import slash from 'slash'; @@ -10,11 +12,20 @@ import { globToRegexp } from './glob-to-regexp'; const DEFAULT_TITLE_PREFIX = ''; const DEFAULT_FILES = '**/*.stories.@(mdx|tsx|ts|jsx|js)'; +// LEGACY support for bad glob patterns we had in SB 5 - remove in SB7 +const fixBadGlob = deprecate( + (match: RegExpMatchArray) => { + return match.input.replace(match[1], `@${match[1]}`); + }, + dedent` + You have specified an invalid glob, we've attempted to fix it, please ensure that the glob you specify is valid. See: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#correct-globs-in-mainjs + ` +); const detectBadGlob = (val: string) => { const match = val.match(/\.(\([^)]+\))/); if (match) { - throw new Error(`experienced an invalid glob pattern: ${val}`); + return fixBadGlob(match); } return val; diff --git a/lib/core-common/src/utils/validate-configuration-files.ts b/lib/core-common/src/utils/validate-configuration-files.ts index 4d77c301103a..b6c30a2414bd 100644 --- a/lib/core-common/src/utils/validate-configuration-files.ts +++ b/lib/core-common/src/utils/validate-configuration-files.ts @@ -1,9 +1,18 @@ import dedent from 'ts-dedent'; +import deprecate from 'util-deprecate'; import glob from 'glob'; import path from 'path'; import { boost } from './interpret-files'; +const warnLegacyConfigurationFiles = deprecate( + () => {}, + dedent` + Configuration files such as "config", "presets" and "addons" are deprecated and will be removed in Storybook 7.0. + Read more about it in the migration guide: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md#to-mainjs-configuration + ` +); + const errorMixingConfigFiles = (first: string, second: string, configDir: string) => { const firstPath = path.resolve(configDir, first); const secondPath = path.resolve(configDir, second); @@ -54,4 +63,8 @@ export function validateConfigurationFiles(configDir: string) { if (manager && addons) { errorMixingConfigFiles('manager', 'addons', configDir); } + + if (presets || config || addons) { + warnLegacyConfigurationFiles(); + } } diff --git a/lib/core-server/package.json b/lib/core-server/package.json index df280806fd90..afc67066c1c4 100644 --- a/lib/core-server/package.json +++ b/lib/core-server/package.json @@ -66,6 +66,7 @@ "pretty-hrtime": "^1.0.3", "prompts": "^2.4.0", "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7", "serve-favicon": "^2.5.0", "slash": "^3.0.0", "telejson": "^6.0.8", diff --git a/lib/core-server/src/presets/common-preset.ts b/lib/core-server/src/presets/common-preset.ts index 3cf407867e1b..46e79226dcb3 100644 --- a/lib/core-server/src/presets/common-preset.ts +++ b/lib/core-server/src/presets/common-preset.ts @@ -97,6 +97,7 @@ export const features = async ( ): Promise => ({ ...existing, postcss: true, + warnOnLegacyHierarchySeparator: true, buildStoriesJson: false, storyStoreV7: true, breakingChangesV7: true, diff --git a/lib/csf-tools/package.json b/lib/csf-tools/package.json index ebecd23a85d2..151788f62d7d 100644 --- a/lib/csf-tools/package.json +++ b/lib/csf-tools/package.json @@ -44,6 +44,7 @@ "core-js": "^3.8.2", "fs-extra": "^9.0.1", "global": "^4.4.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/lib/docs-tools/package.json b/lib/docs-tools/package.json index 61002eb90daa..950e6375aa95 100644 --- a/lib/docs-tools/package.json +++ b/lib/docs-tools/package.json @@ -38,7 +38,8 @@ "@storybook/store": "7.0.0-alpha.1", "core-js": "^3.8.2", "doctrine": "^3.0.0", - "lodash": "^4.17.21" + "lodash": "^4.17.21", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "jest-specific-snapshot": "^4.0.0", diff --git a/lib/manager-webpack5/package.json b/lib/manager-webpack5/package.json index 452faee1ce31..6bfaecb7e127 100644 --- a/lib/manager-webpack5/package.json +++ b/lib/manager-webpack5/package.json @@ -59,6 +59,7 @@ "node-fetch": "^2.6.7", "process": "^0.11.10", "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7", "resolve-from": "^5.0.0", "style-loader": "^3.3.1", "telejson": "^6.0.8", diff --git a/lib/manager-webpack5/src/manager-config.ts b/lib/manager-webpack5/src/manager-config.ts index b6c57ae0c0d4..53655c3caf4b 100644 --- a/lib/manager-webpack5/src/manager-config.ts +++ b/lib/manager-webpack5/src/manager-config.ts @@ -3,6 +3,8 @@ import fs from 'fs-extra'; import findUp from 'find-up'; import resolveFrom from 'resolve-from'; import fetch from 'node-fetch'; +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import type { Configuration } from 'webpack'; import type { Ref, Options } from '@storybook/core-common'; @@ -57,6 +59,15 @@ const toTitle = (input: string) => { return `${result.substring(0, 1).toUpperCase()}${result.substring(1)}`.trim(); }; +const deprecatedDefinedRefDisabled = deprecate( + () => {}, + dedent` + Deprecated parameter: disabled => disable + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-package-composition-disabled-parameter + ` +); + export async function getManagerWebpackConfig(options: Options): Promise { const { presets } = options; @@ -70,9 +81,13 @@ export async function getManagerWebpackConfig(options: Options): Promise { - const { disable } = value; + const { disable, disabled } = value; + + if (disable || disabled) { + if (disabled) { + deprecatedDefinedRefDisabled(); + } - if (disable) { delete definedRefs[key]; // Also delete the ref that is disabled in definedRefs return true; diff --git a/lib/preview-web/package.json b/lib/preview-web/package.json index 8d0d6a132795..414f5295ddfd 100644 --- a/lib/preview-web/package.json +++ b/lib/preview-web/package.json @@ -51,6 +51,7 @@ "global": "^4.4.0", "lodash": "^4.17.21", "qs": "^6.10.0", + "regenerator-runtime": "^0.13.7", "synchronous-promise": "^2.0.15", "ts-dedent": "^2.0.0", "unfetch": "^4.2.0", diff --git a/lib/preview-web/src/PreviewWeb.tsx b/lib/preview-web/src/PreviewWeb.tsx index cbb392946f79..fbf380e2d4f4 100644 --- a/lib/preview-web/src/PreviewWeb.tsx +++ b/lib/preview-web/src/PreviewWeb.tsx @@ -1,3 +1,4 @@ +import deprecate from 'util-deprecate'; import dedent from 'ts-dedent'; import global from 'global'; import { @@ -62,6 +63,17 @@ export class PreviewWeb extends Preview this.urlStore.selection, + dedent` + \`__STORYBOOK_STORY_STORE__.getSelection()\` is deprecated and will be removed in 7.0. + + To get the current selection, use the \`useStoryContext()\` hook from \`@storybook/addons\`. + ` + ); } setupListeners() { diff --git a/lib/preview-web/src/UrlStore.ts b/lib/preview-web/src/UrlStore.ts index a216a6d299d1..f688b6f1a657 100644 --- a/lib/preview-web/src/UrlStore.ts +++ b/lib/preview-web/src/UrlStore.ts @@ -64,6 +64,13 @@ const getFirstString = (v: ValueOf): string | void => { return undefined; }; +const deprecatedLegacyQuery = deprecate( + () => 0, + `URL formats with \`selectedKind\` and \`selectedName\` query parameters are deprecated. +Use \`id=$storyId\` instead. +See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-url-structure` +); + export const getSelectionSpecifierFromPath: () => SelectionSpecifier = () => { const query = qs.parse(document.location.search, { ignoreQueryPrefix: true }); const args = typeof query.args === 'string' ? parseArgsParam(query.args) : undefined; @@ -81,6 +88,14 @@ export const getSelectionSpecifierFromPath: () => SelectionSpecifier = () => { return { storySpecifier: storyId, args, globals, viewMode }; } + // Legacy URL format + const title = getFirstString(query.selectedKind); + const name = getFirstString(query.selectedStory); + + if (title && name) { + deprecatedLegacyQuery(); + return { storySpecifier: { title, name }, args, globals, viewMode }; + } return null; }; diff --git a/lib/router/package.json b/lib/router/package.json index f8a0b335282a..948e137ed57b 100644 --- a/lib/router/package.json +++ b/lib/router/package.json @@ -34,7 +34,8 @@ }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.1", - "core-js": "^3.8.2" + "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "fast-deep-equal": "^3.1.3", diff --git a/lib/source-loader/package.json b/lib/source-loader/package.json index 5a2c75be0552..65b777803c2a 100644 --- a/lib/source-loader/package.json +++ b/lib/source-loader/package.json @@ -41,7 +41,8 @@ "estraverse": "^5.2.0", "global": "^4.4.0", "lodash": "^4.17.21", - "prettier": ">=2.2.1 <=2.3.0" + "prettier": ">=2.2.1 <=2.3.0", + "regenerator-runtime": "^0.13.7" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/lib/store/package.json b/lib/store/package.json index d786e96a6966..1ace66d6044e 100644 --- a/lib/store/package.json +++ b/lib/store/package.json @@ -49,6 +49,7 @@ "global": "^4.4.0", "lodash": "^4.17.21", "memoizerific": "^1.11.3", + "regenerator-runtime": "^0.13.7", "slash": "^3.0.0", "stable": "^0.1.8", "synchronous-promise": "^2.0.15", diff --git a/lib/store/src/GlobalsStore.ts b/lib/store/src/GlobalsStore.ts index 25de54d97eb7..f61aa1758754 100644 --- a/lib/store/src/GlobalsStore.ts +++ b/lib/store/src/GlobalsStore.ts @@ -1,8 +1,18 @@ +import deprecate from 'util-deprecate'; +import dedent from 'ts-dedent'; import type { Globals, GlobalTypes } from '@storybook/csf'; import { deepDiff, DEEPLY_EQUAL } from './args'; import { getValuesFromArgTypes } from './csf/getValuesFromArgTypes'; +const setUndeclaredWarning = deprecate( + () => {}, + dedent` + Setting a global value that is undeclared (i.e. not in the user's initial set of globals + or globalTypes) is deprecated and will have no effect in 7.0. + ` +); + export class GlobalsStore { allowedGlobalNames: Set; @@ -45,8 +55,7 @@ export class GlobalsStore { update(newGlobals: Globals) { Object.keys(newGlobals).forEach((key) => { if (!this.allowedGlobalNames.has(key)) { - // eslint-disable-next-line no-param-reassign - delete newGlobals[key]; + setUndeclaredWarning(); } }); diff --git a/lib/store/src/csf/normalizeStory.ts b/lib/store/src/csf/normalizeStory.ts index cbf50d88cfc8..37773d9094f9 100644 --- a/lib/store/src/csf/normalizeStory.ts +++ b/lib/store/src/csf/normalizeStory.ts @@ -7,9 +7,21 @@ import type { StoryFn, } from '@storybook/csf'; import { storyNameFromExport, toId } from '@storybook/csf'; +import dedent from 'ts-dedent'; +import { logger } from '@storybook/client-logger'; +import deprecate from 'util-deprecate'; import type { NormalizedStoryAnnotations } from '../types'; import { normalizeInputTypes } from './normalizeInputTypes'; +const deprecatedStoryAnnotation = dedent` +CSF .story annotations deprecated; annotate story functions directly: +- StoryFn.story.name => StoryFn.storyName +- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators) +See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod. +`; + +const deprecatedStoryAnnotationWarning = deprecate(() => {}, deprecatedStoryAnnotation); + export function normalizeStory( key: StoryId, storyAnnotations: LegacyStoryAnnotationsOrFn, @@ -24,18 +36,27 @@ export function normalizeStory( storyObject = storyAnnotations; } + const { story } = storyObject; + if (story) { + logger.debug('deprecated story', story); + deprecatedStoryAnnotationWarning(); + } + const exportName = storyNameFromExport(key); const name = - (typeof storyObject !== 'function' && storyObject.name) || storyObject.storyName || exportName; - const decorators = storyObject.decorators || []; - const { parameters } = storyObject; - const { args } = storyObject; - const { argTypes } = storyObject; - const loaders = storyObject.loaders || []; + (typeof storyObject !== 'function' && storyObject.name) || + storyObject.storyName || + story?.name || + exportName; + const decorators = [...(storyObject.decorators || []), ...(story?.decorators || [])]; + const parameters = { ...story?.parameters, ...storyObject.parameters }; + const args = { ...story?.args, ...storyObject.args }; + const argTypes = { ...story?.argTypes, ...storyObject.argTypes }; + const loaders = [...(storyObject.loaders || []), ...(story?.loaders || [])]; const { render, play } = storyObject; // eslint-disable-next-line no-underscore-dangle - const id = parameters?.__id || toId(meta.id || meta.title, exportName); + const id = parameters.__id || toId(meta.id || meta.title, exportName); return { id, name, diff --git a/lib/store/src/csf/prepareStory.ts b/lib/store/src/csf/prepareStory.ts index 1a9101e68298..b797320add0c 100644 --- a/lib/store/src/csf/prepareStory.ts +++ b/lib/store/src/csf/prepareStory.ts @@ -1,3 +1,5 @@ +import dedent from 'ts-dedent'; +import deprecate from 'util-deprecate'; import global from 'global'; import type { @@ -22,6 +24,15 @@ import { combineParameters } from '../parameters'; import { applyHooks } from '../hooks'; import { defaultDecorateStory } from '../decorators'; import { groupArgsByTarget, NO_TARGET_NAME } from '../args'; +import { getValuesFromArgTypes } from './getValuesFromArgTypes'; + +const argTypeDefaultValueWarning = deprecate( + () => {}, + dedent` + \`argType.defaultValue\` is deprecated and will be removed in Storybook 7.0. + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#no-longer-inferring-default-values-of-args` +); // Combine all the metadata about a story (both direct and inherited from the component/global scope) // into a "renderable" story function, with all decorators applied, parameters passed as context etc @@ -110,7 +121,15 @@ export function prepareStory( contextForEnhancers.argTypes ); - const initialArgsBeforeEnhancers = passedArgs; + // Add argTypes[X].defaultValue to initial args (note this deprecated) + // We need to do this *after* the argTypesEnhancers as they may add defaultValues + const defaultArgs = getValuesFromArgTypes(contextForEnhancers.argTypes); + + if (Object.keys(defaultArgs).length > 0) { + argTypeDefaultValueWarning(); + } + + const initialArgsBeforeEnhancers = { ...defaultArgs, ...passedArgs }; contextForEnhancers.initialArgs = argsEnhancers.reduce( (accumulatedArgs: Args, enhancer) => ({ diff --git a/lib/telemetry/package.json b/lib/telemetry/package.json index b33bce589a20..05668743021e 100644 --- a/lib/telemetry/package.json +++ b/lib/telemetry/package.json @@ -43,7 +43,8 @@ "global": "^4.4.0", "isomorphic-unfetch": "^3.1.0", "nanoid": "^3.3.1", - "read-pkg-up": "^7.0.1" + "read-pkg-up": "^7.0.1", + "regenerator-runtime": "^0.13.7" }, "publishConfig": { "access": "public" diff --git a/lib/theming/package.json b/lib/theming/package.json index 0a8ecd04e375..cde087148aa5 100644 --- a/lib/theming/package.json +++ b/lib/theming/package.json @@ -34,7 +34,8 @@ }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.1", - "core-js": "^3.8.2" + "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "@emotion/cache": "^11.7.1", diff --git a/lib/ui/package.json b/lib/ui/package.json index 5b7f7dfaceef..76d6cad55b58 100644 --- a/lib/ui/package.json +++ b/lib/ui/package.json @@ -43,6 +43,7 @@ "@storybook/semver": "^7.3.2", "@storybook/theming": "7.0.0-alpha.1", "core-js": "^3.8.2", + "regenerator-runtime": "^0.13.7", "resolve-from": "^5.0.0", "util": "^0.12.4" }, diff --git a/lib/ui/src/components/notifications/NotificationList.stories.js b/lib/ui/src/components/notifications/NotificationList.stories.js index cb792b88d083..ce44968882bd 100644 --- a/lib/ui/src/components/notifications/NotificationList.stories.js +++ b/lib/ui/src/components/notifications/NotificationList.stories.js @@ -23,13 +23,9 @@ export default { excludeStories: /.*Data$/, }; -// eslint-disable-next-line no-underscore-dangle, import/namespace -const ordering = itemStories.__namedExportsOrder; - -const items = (Array.isArray(ordering) ? ordering : Array.from(Object.keys(itemStories))) - .filter((key) => itemMeta.excludeStories.exec(key)) - // eslint-disable-next-line import/namespace - .map((key) => itemStories[key]); +const items = Array.from(Object.entries(itemStories)) + .filter((entry) => itemMeta.excludeStories.exec(entry[0])) + .map((entry) => entry[1]); export const singleData = [items[0]]; export const allData = items; diff --git a/presets/preact-webpack/package.json b/presets/preact-webpack/package.json index ed7029873525..0b6f5186285d 100644 --- a/presets/preact-webpack/package.json +++ b/presets/preact-webpack/package.json @@ -37,7 +37,8 @@ "@types/node": "^14.14.20 || ^16.0.0", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "preact": "^10.5.13" diff --git a/presets/react-webpack/package.json b/presets/react-webpack/package.json index 2931001f46d6..14cadf73dd61 100644 --- a/presets/react-webpack/package.json +++ b/presets/react-webpack/package.json @@ -47,7 +47,8 @@ "babel-plugin-react-docgen": "^4.2.1", "core-js": "^3.8.2", "fs-extra": "^9.0.1", - "react-refresh": "^0.11.0" + "react-refresh": "^0.11.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "@types/util-deprecate": "^1.0.0" diff --git a/presets/server-webpack/package.json b/presets/server-webpack/package.json index f1b45afcdb29..e98b2acf4b97 100644 --- a/presets/server-webpack/package.json +++ b/presets/server-webpack/package.json @@ -40,6 +40,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "safe-identifier": "^0.4.1", "ts-dedent": "^2.0.0", "yaml-loader": "^0.8.0" diff --git a/presets/svelte-webpack/package.json b/presets/svelte-webpack/package.json index a2361d229cd8..c4af355e4c78 100644 --- a/presets/svelte-webpack/package.json +++ b/presets/svelte-webpack/package.json @@ -38,6 +38,7 @@ "core-js": "^3.8.2", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "sveltedoc-parser": "4.1.0", "ts-dedent": "^2.0.0" }, diff --git a/presets/vue-webpack/package.json b/presets/vue-webpack/package.json index 11760446ac21..ec58156abbe7 100644 --- a/presets/vue-webpack/package.json +++ b/presets/vue-webpack/package.json @@ -38,6 +38,7 @@ "core-js": "^3.8.2", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.44.23", "vue-docgen-loader": "^1.5.1", diff --git a/presets/vue3-webpack/package.json b/presets/vue3-webpack/package.json index 5cc7198d40f0..ffa58fe81158 100644 --- a/presets/vue3-webpack/package.json +++ b/presets/vue3-webpack/package.json @@ -39,6 +39,7 @@ "core-js": "^3.8.2", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.46.0", "vue-docgen-loader": "^1.5.1", diff --git a/presets/web-components-webpack/package.json b/presets/web-components-webpack/package.json index 03f2c1715080..52089cb133e6 100644 --- a/presets/web-components-webpack/package.json +++ b/presets/web-components-webpack/package.json @@ -42,7 +42,8 @@ "babel-plugin-bundled-import-meta": "^0.3.1", "core-js": "^3.8.2", "react": "16.14.0", - "react-dom": "16.14.0" + "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7" }, "devDependencies": { "lit-html": "2.0.2" diff --git a/renderers/html/package.json b/renderers/html/package.json index 62cfcc766386..fd28dfd0d5a3 100644 --- a/renderers/html/package.json +++ b/renderers/html/package.json @@ -42,6 +42,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "peerDependencies": { diff --git a/renderers/preact/package.json b/renderers/preact/package.json index 12c4b2863725..a1fc6c99c76b 100644 --- a/renderers/preact/package.json +++ b/renderers/preact/package.json @@ -40,6 +40,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/renderers/react/package.json b/renderers/react/package.json index 782df307f658..d7bd632c5be9 100644 --- a/renderers/react/package.json +++ b/renderers/react/package.json @@ -51,6 +51,7 @@ "lodash": "^4.17.21", "prop-types": "^15.7.2", "react-element-to-jsx-string": "^14.3.4", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, diff --git a/renderers/react/src/docs/jsxDecorator.tsx b/renderers/react/src/docs/jsxDecorator.tsx index 131cc73e752f..0e42878e2af5 100644 --- a/renderers/react/src/docs/jsxDecorator.tsx +++ b/renderers/react/src/docs/jsxDecorator.tsx @@ -1,6 +1,8 @@ /* eslint-disable no-underscore-dangle */ import React, { createElement, ReactElement } from 'react'; import reactElementToJSXString, { Options } from 'react-element-to-jsx-string'; +import dedent from 'ts-dedent'; +import deprecate from 'util-deprecate'; import { addons, useEffect } from '@storybook/addons'; import { StoryContext, ArgsStoryFn, PartialStoryFn } from '@storybook/csf'; @@ -26,6 +28,24 @@ type JSXOptions = Options & { transformSource?(dom: string, context?: StoryContext): string; }; +/** Run the user supplied onBeforeRender function if it exists */ +const applyBeforeRender = (domString: string, options: JSXOptions) => { + if (typeof options.onBeforeRender !== 'function') { + return domString; + } + + const deprecatedOnBeforeRender = deprecate( + options.onBeforeRender, + dedent` + StoryFn.parameters.jsx.onBeforeRender was deprecated. + Prefer StoryFn.parameters.jsx.transformSource instead. + See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-onbeforerender for details. + ` + ); + + return deprecatedOnBeforeRender(domString); +}; + /** Run the user supplied transformSource function if it exists */ const applyTransformSource = ( domString: string, @@ -101,7 +121,7 @@ export const renderJsx = (code: React.ReactElement, options: JSXOptions) => { const result = React.Children.map(code, (c) => { // @ts-ignore FIXME: workaround react-element-to-jsx-string const child = typeof c === 'number' ? c.toString() : c; - let string = reactElementToJSXString(child, opts as Options); + let string = applyBeforeRender(reactElementToJSXString(child, opts as Options), options); if (string.indexOf('"') > -1) { const matches = string.match(/\S+=\\"([^"]*)\\"/g); diff --git a/renderers/server/package.json b/renderers/server/package.json index 5b26461443c8..7a12f6c8ba85 100644 --- a/renderers/server/package.json +++ b/renderers/server/package.json @@ -41,6 +41,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "engines": { diff --git a/renderers/svelte/package.json b/renderers/svelte/package.json index f734376fb6c7..70c433ae912c 100644 --- a/renderers/svelte/package.json +++ b/renderers/svelte/package.json @@ -43,6 +43,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "sveltedoc-parser": "4.1.0" }, "devDependencies": { diff --git a/renderers/vue/package.json b/renderers/vue/package.json index a6f99332178a..4c9b895207f6 100644 --- a/renderers/vue/package.json +++ b/renderers/vue/package.json @@ -42,6 +42,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/renderers/vue3/package.json b/renderers/vue3/package.json index 0234f7648202..94c16e2f7124 100644 --- a/renderers/vue3/package.json +++ b/renderers/vue3/package.json @@ -42,6 +42,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/renderers/web-components/package.json b/renderers/web-components/package.json index 2fac1fadcd6a..0195d3f3b219 100644 --- a/renderers/web-components/package.json +++ b/renderers/web-components/package.json @@ -46,6 +46,7 @@ "global": "^4.4.0", "react": "16.14.0", "react-dom": "16.14.0", + "regenerator-runtime": "^0.13.7", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 97ca782dc815..989c5b02fde7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6597,6 +6597,7 @@ __metadata: global: ^4.4.0 lodash: ^4.17.21 react-sizeme: ^3.0.1 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 peerDependencies: @@ -6629,6 +6630,7 @@ __metadata: polished: ^4.2.2 prop-types: ^15.7.2 react-inspector: ^5.1.0 + regenerator-runtime: ^0.13.7 telejson: ^6.0.8 ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 @@ -6658,6 +6660,7 @@ __metadata: core-js: ^3.8.2 global: ^4.4.0 memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 peerDependencies: @@ -6728,6 +6731,7 @@ __metadata: fast-deep-equal: ^3.1.3 global: ^4.4.0 lodash: ^4.17.21 + regenerator-runtime: ^0.13.7 remark-external-links: ^8.0.0 remark-slug: ^6.0.0 ts-dedent: ^2.0.0 @@ -6766,6 +6770,7 @@ __metadata: "@storybook/vue": 7.0.0-alpha.1 "@types/jest": ^26.0.16 core-js: ^3.8.2 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: "@babel/core": ^7.9.6 @@ -6843,6 +6848,7 @@ __metadata: core-js: ^3.8.2 global: ^4.4.0 react-sizeme: ^3.0.1 + regenerator-runtime: ^0.13.7 upath: ^1.2.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6867,6 +6873,7 @@ __metadata: core-js: ^3.8.2 global: ^4.4.0 prop-types: ^15.7.2 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6914,6 +6921,7 @@ __metadata: "@storybook/csf": 0.0.2--canary.4566f4d.1 core-js: ^3.8.2 global: ^4.4.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6950,6 +6958,7 @@ __metadata: "@types/puppeteer": ^5.4.0 core-js: ^3.8.2 jest-image-snapshot: ^4.3.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@storybook/addon-storyshots": 7.0.0-alpha.1 puppeteer: ^2.0.0 || ^3.0.0 @@ -6994,6 +7003,7 @@ __metadata: pretty-format: ^26.6.2 react-test-renderer: ^16.8.0 || ^17.0.0 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 rxjs: ^6.6.3 ts-dedent: ^2.0.0 vue-jest: ^5.0.0-alpha.8 @@ -7065,6 +7075,7 @@ __metadata: estraverse: ^5.2.0 prop-types: ^15.7.2 react-syntax-highlighter: ^15.4.5 + regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7086,6 +7097,7 @@ __metadata: "@storybook/components": 7.0.0-alpha.1 "@storybook/theming": 7.0.0-alpha.1 core-js: ^3.8.2 + regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7111,6 +7123,7 @@ __metadata: global: ^4.4.0 memoizerific: ^1.11.3 prop-types: ^15.7.2 + regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7136,6 +7149,7 @@ __metadata: "@types/webpack-env": ^1.16.4 core-js: ^3.8.2 global: ^4.4.0 + regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7238,6 +7252,7 @@ __metadata: react: ^16.14.0 react-dom: ^16.14.0 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 sass-loader: ^12.6.0 telejson: ^6.0.8 tmp: ^0.2.1 @@ -7294,6 +7309,7 @@ __metadata: memoizerific: ^1.11.3 preval.macro: ^5.0.0 qs: ^6.10.1 + regenerator-runtime: ^0.13.7 store2: ^2.12.0 telejson: ^6.0.8 ts-dedent: ^2.0.0 @@ -7549,6 +7565,7 @@ __metadata: lodash: ^4.17.21 memoizerific: ^1.11.3 qs: ^6.10.0 + regenerator-runtime: ^0.13.7 store2: ^2.12.0 synchronous-promise: ^2.0.15 ts-dedent: ^2.0.0 @@ -7606,6 +7623,7 @@ __metadata: lodash: ^4.17.21 prettier: ">=2.2.1 <=2.3.0" recast: ^0.19.0 + regenerator-runtime: ^0.13.7 languageName: unknown linkType: soft @@ -7659,11 +7677,13 @@ __metadata: "@storybook/preview-web": 7.0.0-alpha.1 "@storybook/store": 7.0.0-alpha.1 "@storybook/ui": 7.0.0-alpha.1 + airbnb-js-shims: ^2.2.1 ansi-to-html: ^0.6.11 core-js: ^3.8.2 global: ^4.4.0 lodash: ^4.17.21 qs: ^6.10.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 unfetch: ^4.2.0 util-deprecate: ^1.0.2 @@ -7814,6 +7834,7 @@ __metadata: pretty-hrtime: ^1.0.3 prompts: ^2.4.0 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 serve-favicon: ^2.5.0 slash: ^3.0.0 telejson: ^6.0.8 @@ -7866,6 +7887,7 @@ __metadata: fs-extra: ^9.0.1 global: ^4.4.0 js-yaml: ^3.14.1 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 languageName: unknown linkType: soft @@ -7931,6 +7953,7 @@ __metadata: doctrine: ^3.0.0 jest-specific-snapshot: ^4.0.0 lodash: ^4.17.21 + regenerator-runtime: ^0.13.7 require-from-string: ^2.0.2 languageName: unknown linkType: soft @@ -7962,6 +7985,7 @@ __metadata: react: 16.14.0 react-dom: 16.14.0 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: "@babel/core": "*" @@ -8069,6 +8093,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@babel/core": "*" languageName: unknown @@ -8088,6 +8113,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: "@babel/core": "*" @@ -8201,6 +8227,7 @@ __metadata: node-fetch: ^2.6.7 process: ^0.11.10 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 resolve-from: ^5.0.0 style-loader: ^3.3.1 telejson: ^6.0.8 @@ -8305,6 +8332,7 @@ __metadata: preact: ^10.5.13 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@babel/core": "*" preact: ^8.0.0||^10.0.0 @@ -8324,6 +8352,7 @@ __metadata: preact: ^10.5.13 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: preact: ^8.0.0||^10.0.0 @@ -8376,6 +8405,7 @@ __metadata: preact: ^10.5.13 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@babel/core": "*" preact: ^8.0.0||^10.0.0 @@ -8402,6 +8432,7 @@ __metadata: core-js: ^3.8.2 fs-extra: ^9.0.1 react-refresh: ^0.11.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@babel/core": ^7.11.5 jest-specific-snapshot: ^4.0.0 @@ -8442,6 +8473,7 @@ __metadata: jest-specific-snapshot: ^4.0.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 safe-identifier: ^0.4.1 ts-dedent: ^2.0.0 yaml: ^1.10.0 @@ -8458,6 +8490,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 svelte: ^3.31.2 svelte-loader: ^3.1.2 sveltedoc-parser: 4.1.0 @@ -8479,6 +8512,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-loader: ^9.2.8 vue: ^2.6.12 vue-docgen-api: ^4.44.23 @@ -8507,6 +8541,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-loader: ^9.2.8 vue: ^3.2.33 vue-docgen-api: ^4.46.0 @@ -8535,6 +8570,7 @@ __metadata: lit-html: 2.0.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 peerDependencies: lit-html: ^1.4.1 || ^2.0.0 languageName: unknown @@ -8555,6 +8591,7 @@ __metadata: global: ^4.4.0 lodash: ^4.17.21 qs: ^6.10.0 + regenerator-runtime: ^0.13.7 synchronous-promise: ^2.0.15 ts-dedent: ^2.0.0 unfetch: ^4.2.0 @@ -8594,6 +8631,7 @@ __metadata: "@types/node": ^14.14.20 || ^16.0.0 core-js: ^3.8.2 jest-specific-snapshot: ^4.0.0 + regenerator-runtime: ^0.13.7 peerDependencies: "@babel/core": ^7.11.5 react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -8630,6 +8668,7 @@ __metadata: lodash: ^4.17.21 prop-types: ^15.7.2 react-element-to-jsx-string: ^14.3.4 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 peerDependencies: @@ -8923,6 +8962,7 @@ __metadata: qs: ^6.10.0 react-router: 6.0.2 react-router-dom: 6.0.2 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 ts-node: ^10.4.0 peerDependencies: @@ -8992,6 +9032,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 languageName: unknown linkType: soft @@ -9008,6 +9049,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 languageName: unknown linkType: soft @@ -9024,6 +9066,7 @@ __metadata: global: ^4.4.0 lodash: ^4.17.21 prettier: ">=2.2.1 <=2.3.0" + regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -9043,6 +9086,7 @@ __metadata: global: ^4.4.0 lodash: ^4.17.21 memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 slash: ^3.0.0 stable: ^0.1.8 synchronous-promise: ^2.0.15 @@ -9066,6 +9110,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 svelte: ^3.48.0 svelte-loader: ^3.1.2 peerDependencies: @@ -9089,6 +9134,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 svelte: ^3.31.2 sveltedoc-parser: 4.1.0 peerDependencies: @@ -9112,6 +9158,7 @@ __metadata: isomorphic-unfetch: ^3.1.0 nanoid: ^3.3.1 read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 languageName: unknown linkType: soft @@ -9156,6 +9203,7 @@ __metadata: global: ^4.4.0 memoizerific: ^1.11.3 polished: ^4.2.2 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 ts-node: ^10.4.0 peerDependencies: @@ -9232,6 +9280,7 @@ __metadata: react-draggable: ^4.4.3 react-helmet-async: ^1.0.7 react-sizeme: ^3.0.1 + regenerator-runtime: ^0.13.7 resolve-from: ^5.0.0 store2: ^2.12.0 ts-node: ^10.4.0 @@ -9255,6 +9304,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 vue: ^2.6.12 vue-loader: ^15.7.0 vue-template-compiler: ^2.6.14 @@ -9282,6 +9332,7 @@ __metadata: core-js: ^3.8.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 vue: 3.0.0 peerDependencies: "@babel/core": "*" @@ -9304,6 +9355,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 vue: 3.0.0 peerDependencies: @@ -9327,6 +9379,7 @@ __metadata: global: ^4.4.0 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 vue: ^2.6.12 peerDependencies: @@ -9352,6 +9405,7 @@ __metadata: lit-html: 2.0.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 peerDependencies: lit-html: ^1.4.1 || ^2.0.0 languageName: unknown @@ -9374,6 +9428,7 @@ __metadata: lit-html: 2.0.2 react: 16.14.0 react-dom: 16.14.0 + regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 peerDependencies: lit-html: ^1.4.1 || ^2.0.0 @@ -12491,6 +12546,31 @@ __metadata: languageName: node linkType: hard +"airbnb-js-shims@npm:^2.2.1": + version: 2.2.1 + resolution: "airbnb-js-shims@npm:2.2.1" + dependencies: + array-includes: ^3.0.3 + array.prototype.flat: ^1.2.1 + array.prototype.flatmap: ^1.2.1 + es5-shim: ^4.5.13 + es6-shim: ^0.35.5 + function.prototype.name: ^1.1.0 + globalthis: ^1.0.0 + object.entries: ^1.1.0 + object.fromentries: ^2.0.0 || ^1.0.0 + object.getownpropertydescriptors: ^2.0.3 + object.values: ^1.1.0 + promise.allsettled: ^1.0.0 + promise.prototype.finally: ^3.1.0 + string.prototype.matchall: ^4.0.0 || ^3.0.1 + string.prototype.padend: ^3.0.0 + string.prototype.padstart: ^3.0.0 + symbol.prototype.description: ^1.0.0 + checksum: 55fdeb2673da440772d278816664b8e8da946b57adfd95b6635bc980ad235e388266c1488fdff3a055e95dc1c789e389821598b2711b59ce76ab4500f528216c + languageName: node + linkType: hard + "airbnb-prop-types@npm:^2.16.0": version: 2.16.0 resolution: "airbnb-prop-types@npm:2.16.0" @@ -13044,7 +13124,7 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.1.4, array-includes@npm:^3.1.5": +"array-includes@npm:^3.0.3, array-includes@npm:^3.1.4, array-includes@npm:^3.1.5": version: 3.1.5 resolution: "array-includes@npm:3.1.5" dependencies: @@ -13135,7 +13215,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.flat@npm:^1.2.3, array.prototype.flat@npm:^1.2.5": +"array.prototype.flat@npm:^1.2.1, array.prototype.flat@npm:^1.2.3, array.prototype.flat@npm:^1.2.5": version: 1.3.0 resolution: "array.prototype.flat@npm:1.3.0" dependencies: @@ -13147,7 +13227,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.flatmap@npm:^1.3.0": +"array.prototype.flatmap@npm:^1.2.1, array.prototype.flatmap@npm:^1.3.0": version: 1.3.0 resolution: "array.prototype.flatmap@npm:1.3.0" dependencies: @@ -13159,6 +13239,19 @@ __metadata: languageName: node linkType: hard +"array.prototype.map@npm:^1.0.4": + version: 1.0.4 + resolution: "array.prototype.map@npm:1.0.4" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.3 + es-abstract: ^1.19.0 + es-array-method-boxes-properly: ^1.0.0 + is-string: ^1.0.7 + checksum: b42d7d91b89b3b0b2cbb0211917af5be1f100843faeed71bed0cef38d040c980d0fc6433a5df4c13eaded2cccd7b209bbbad250c27f724900cb57c0c0e289dc0 + languageName: node + linkType: hard + "array.prototype.reduce@npm:^1.0.4": version: 1.0.4 resolution: "array.prototype.reduce@npm:1.0.4" @@ -20059,6 +20152,22 @@ __metadata: languageName: node linkType: hard +"es-get-iterator@npm:^1.0.2": + version: 1.1.2 + resolution: "es-get-iterator@npm:1.1.2" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.1.0 + has-symbols: ^1.0.1 + is-arguments: ^1.1.0 + is-map: ^2.0.2 + is-set: ^2.0.2 + is-string: ^1.0.5 + isarray: ^2.0.5 + checksum: 76a832b3bfd85941c556287cd50a3ad612f5193264b761e2011503f311dfa20aa52b9ebd701d3f16022d4cb56a7130a4cfb50186427d3aecd0d4e547a471f68e + languageName: node + linkType: hard + "es-module-lexer@npm:^0.9.0": version: 0.9.3 resolution: "es-module-lexer@npm:0.9.3" @@ -20097,6 +20206,13 @@ __metadata: languageName: node linkType: hard +"es5-shim@npm:^4.5.13": + version: 4.6.7 + resolution: "es5-shim@npm:4.6.7" + checksum: f285a58ed1901d46872828776164c0837272d28374a3c74b31a893dc6b16c67d417509c4f587a87c7cdfa9faf9c97c70d774c81d8bf9dcca6d3d6bfdf4a7a28e + languageName: node + linkType: hard + "es6-iterator@npm:^2.0.3, es6-iterator@npm:~2.0.1": version: 2.0.3 resolution: "es6-iterator@npm:2.0.3" @@ -20158,6 +20274,13 @@ __metadata: languageName: node linkType: hard +"es6-shim@npm:^0.35.5": + version: 0.35.6 + resolution: "es6-shim@npm:0.35.6" + checksum: 4ed9ceb017826032ea403eef82c4af97275f4e62590f8e31f8af823056a573ce096007c179718f72ce9d5a35c658ce887668a79e341fd1b64f09c2d905d0f1d5 + languageName: node + linkType: hard + "es6-symbol@npm:3.1.1": version: 3.1.1 resolution: "es6-symbol@npm:3.1.1" @@ -22926,7 +23049,7 @@ __metadata: languageName: node linkType: hard -"function.prototype.name@npm:^1.1.2, function.prototype.name@npm:^1.1.3, function.prototype.name@npm:^1.1.5": +"function.prototype.name@npm:^1.1.0, function.prototype.name@npm:^1.1.2, function.prototype.name@npm:^1.1.3, function.prototype.name@npm:^1.1.5": version: 1.1.5 resolution: "function.prototype.name@npm:1.1.5" dependencies: @@ -23538,6 +23661,15 @@ __metadata: languageName: node linkType: hard +"globalthis@npm:^1.0.0": + version: 1.0.3 + resolution: "globalthis@npm:1.0.3" + dependencies: + define-properties: ^1.1.3 + checksum: 0db6e9af102a5254630351557ac15e6909bc7459d3e3f6b001e59fe784c96d31108818f032d9095739355a88467459e6488ff16584ee6250cd8c27dec05af4b0 + languageName: node + linkType: hard + "globby@npm:10.0.0": version: 10.0.0 resolution: "globby@npm:10.0.0" @@ -25428,7 +25560,7 @@ __metadata: languageName: node linkType: hard -"is-arguments@npm:^1.0.4": +"is-arguments@npm:^1.0.4, is-arguments@npm:^1.1.0": version: 1.1.1 resolution: "is-arguments@npm:1.1.1" dependencies: @@ -25822,6 +25954,13 @@ __metadata: languageName: node linkType: hard +"is-map@npm:^2.0.2": + version: 2.0.2 + resolution: "is-map@npm:2.0.2" + checksum: 119ff9137a37fd131a72fab3f4ab8c9d6a24b0a1ee26b4eff14dc625900d8675a97785eea5f4174265e2006ed076cc24e89f6e57ebd080a48338d914ec9168a5 + languageName: node + linkType: hard + "is-module@npm:^1.0.0": version: 1.0.0 resolution: "is-module@npm:1.0.0" @@ -26028,6 +26167,13 @@ __metadata: languageName: node linkType: hard +"is-set@npm:^2.0.2": + version: 2.0.2 + resolution: "is-set@npm:2.0.2" + checksum: 5f8bd1880df8c0004ce694e315e6e1e47a3452014be792880bb274a3b2cdb952fdb60789636ca6e084c7947ca8b7ae03ccaf54c93a7fcfed228af810559e5432 + languageName: node + linkType: hard + "is-shared-array-buffer@npm:^1.0.2": version: 1.0.2 resolution: "is-shared-array-buffer@npm:1.0.2" @@ -26220,6 +26366,13 @@ __metadata: languageName: node linkType: hard +"isarray@npm:^2.0.5": + version: 2.0.5 + resolution: "isarray@npm:2.0.5" + checksum: 4199f14a7a13da2177c66c31080008b7124331956f47bca57dd0b6ea9f11687aa25e565a2c7a2b519bc86988d10398e3049a1f5df13c9f6b7664154690ae79fd + languageName: node + linkType: hard + "isbinaryfile@npm:^4.0.6": version: 4.0.10 resolution: "isbinaryfile@npm:4.0.10" @@ -26380,6 +26533,23 @@ __metadata: languageName: node linkType: hard +"iterate-iterator@npm:^1.0.1": + version: 1.0.2 + resolution: "iterate-iterator@npm:1.0.2" + checksum: 74609b01a3ebc025601aa68ef40731b05d5e45c9fd4ecf233a14a34f2b3481e6974e1dcff390e87155a0648f056c186336bb4c70df2fdefeab08a9878b2eb1c2 + languageName: node + linkType: hard + +"iterate-value@npm:^1.0.2": + version: 1.0.2 + resolution: "iterate-value@npm:1.0.2" + dependencies: + es-get-iterator: ^1.0.2 + iterate-iterator: ^1.0.1 + checksum: 77d32a5ac84877da2133689ff5e3983aa8214bace7faee3c746bf79d4524cc3fb8c0344a20d3699be20a15f0959ecd582d53a05b97f5d04c306bcd426800a650 + languageName: node + linkType: hard + "jake@npm:^10.8.5": version: 10.8.5 resolution: "jake@npm:10.8.5" @@ -32541,7 +32711,7 @@ __metadata: languageName: node linkType: hard -"object.entries@npm:^1.1.1, object.entries@npm:^1.1.2, object.entries@npm:^1.1.5": +"object.entries@npm:^1.1.0, object.entries@npm:^1.1.1, object.entries@npm:^1.1.2, object.entries@npm:^1.1.5": version: 1.1.5 resolution: "object.entries@npm:1.1.5" dependencies: @@ -32552,7 +32722,7 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.3, object.fromentries@npm:^2.0.5": +"object.fromentries@npm:^2.0.0 || ^1.0.0, object.fromentries@npm:^2.0.3, object.fromentries@npm:^2.0.5": version: 2.0.5 resolution: "object.fromentries@npm:2.0.5" dependencies: @@ -32563,7 +32733,7 @@ __metadata: languageName: node linkType: hard -"object.getownpropertydescriptors@npm:^2.0.3, object.getownpropertydescriptors@npm:^2.1.0, object.getownpropertydescriptors@npm:^2.1.1": +"object.getownpropertydescriptors@npm:^2.0.3, object.getownpropertydescriptors@npm:^2.1.0, object.getownpropertydescriptors@npm:^2.1.1, object.getownpropertydescriptors@npm:^2.1.2": version: 2.1.4 resolution: "object.getownpropertydescriptors@npm:2.1.4" dependencies: @@ -35393,6 +35563,20 @@ __metadata: languageName: node linkType: hard +"promise.allsettled@npm:^1.0.0": + version: 1.0.5 + resolution: "promise.allsettled@npm:1.0.5" + dependencies: + array.prototype.map: ^1.0.4 + call-bind: ^1.0.2 + define-properties: ^1.1.3 + es-abstract: ^1.19.1 + get-intrinsic: ^1.1.1 + iterate-value: ^1.0.2 + checksum: 6cc51174a075b4f63e1a0e2a4526efe3f8ccba25c81ea916bd8398c2208a43b5bec6a64ca95e59fd01d1c72a15f0bc17be496e43a4c2fdcaf200100951b72fd6 + languageName: node + linkType: hard + "promise.hash.helper@npm:^1.0.7": version: 1.0.8 resolution: "promise.hash.helper@npm:1.0.8" @@ -35400,6 +35584,17 @@ __metadata: languageName: node linkType: hard +"promise.prototype.finally@npm:^3.1.0": + version: 3.1.3 + resolution: "promise.prototype.finally@npm:3.1.3" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.3 + es-abstract: ^1.19.1 + checksum: 1d90addb68d13a2f7aa3f35e5892548928d2c9e11074e3e33dd1d58885a357a306462fe957ce2fc9acf46b3a6dd09389daa18085257c1734dec3c128c3d09bd2 + languageName: node + linkType: hard + "promise@npm:^7.0.1": version: 7.3.1 resolution: "promise@npm:7.3.1" @@ -40109,7 +40304,7 @@ __metadata: languageName: node linkType: hard -"string.prototype.matchall@npm:^4.0.6, string.prototype.matchall@npm:^4.0.7": +"string.prototype.matchall@npm:^4.0.0 || ^3.0.1, string.prototype.matchall@npm:^4.0.6, string.prototype.matchall@npm:^4.0.7": version: 4.0.7 resolution: "string.prototype.matchall@npm:4.0.7" dependencies: @@ -40136,6 +40331,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.padstart@npm:^3.0.0": + version: 3.1.3 + resolution: "string.prototype.padstart@npm:3.1.3" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.3 + es-abstract: ^1.19.1 + checksum: 3fbe6ba613461b19a69294ba4580b41906f1dc74d51234d0c34c8c1cc808578c0b87b67b46f7a91ff2c9b45c20676b98f326d5fb8b5221a39d1ebfdd899f42e7 + languageName: node + linkType: hard + "string.prototype.trim@npm:^1.2.1": version: 1.2.6 resolution: "string.prototype.trim@npm:1.2.6" @@ -40827,6 +41033,18 @@ __metadata: languageName: node linkType: hard +"symbol.prototype.description@npm:^1.0.0": + version: 1.0.5 + resolution: "symbol.prototype.description@npm:1.0.5" + dependencies: + call-bind: ^1.0.2 + get-symbol-description: ^1.0.0 + has-symbols: ^1.0.2 + object.getownpropertydescriptors: ^2.1.2 + checksum: 6009bb54faa50fd899772baa0c047d4d4fc85cd03b7e2b5e5385f23f4688879518103ab4a95a03b0b25e4c89c10cf0bb16c159865df2c932682cc56502693650 + languageName: node + linkType: hard + "symlink-or-copy@npm:^1.0.0, symlink-or-copy@npm:^1.0.1, symlink-or-copy@npm:^1.1.8, symlink-or-copy@npm:^1.2.0, symlink-or-copy@npm:^1.3.1": version: 1.3.1 resolution: "symlink-or-copy@npm:1.3.1"