From 4af38a6b04faeea30cf094a37d6d72f17eb28bee Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 15 Oct 2022 14:46:48 +0800 Subject: [PATCH 01/18] Fix broken sandbox MDX --- .../stories/stories-mdx/play-functions.stories.mdx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx b/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx index 7f1ca5cbdfbf..5a0fee271bff 100644 --- a/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx +++ b/code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx @@ -4,7 +4,6 @@ import globalThis from 'global'; console.log('component play')} /> @@ -13,16 +12,9 @@ import globalThis from 'global'; This file demonstrates defining stories inside MDX. - + - console.log('story play')} - /> + console.log('story play')} /> From dffc6a4096829418ac2a994689b8382c5030851b Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 15 Oct 2022 14:59:51 +0800 Subject: [PATCH 02/18] Update to MDXv2 across the board --- code/addons/docs/package.json | 7 +- code/addons/docs/src/preset.ts | 11 +- code/examples/doc-blocks/.storybook/main.ts | 1 - code/lib/builder-vite/package.json | 11 +- .../builder-vite/src/plugins/mdx-plugin.ts | 6 +- code/lib/codemod/package.json | 2 +- code/lib/core-common/src/types.ts | 5 - .../core-server/src/presets/common-preset.ts | 1 - code/yarn.lock | 439 +++--------------- scripts/tasks/sandbox-parts.ts | 2 +- 10 files changed, 71 insertions(+), 414 deletions(-) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 01ff8bb71252..39c5ac8be255 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -62,7 +62,7 @@ "@storybook/csf": "0.0.2--canary.49.258942b.0", "@storybook/csf-tools": "7.0.0-alpha.38", "@storybook/docs-tools": "7.0.0-alpha.38", - "@storybook/mdx1-csf": "0.0.5-canary.13.9ce928a.0", + "@storybook/mdx2-csf": "0.1.0-next.0", "@storybook/node-logger": "7.0.0-alpha.38", "@storybook/postinstall": "7.0.0-alpha.38", "@storybook/preview-web": "7.0.0-alpha.38", @@ -80,19 +80,14 @@ }, "devDependencies": { "@babel/core": "^7.12.10", - "@storybook/mdx2-csf": "0.0.4-canary.14.04ffbe8.0", "@types/util-deprecate": "^1.0.0", "typescript": "~4.6.3" }, "peerDependencies": { - "@storybook/mdx2-csf": "0.0.4-canary.14.04ffbe8.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { - "@storybook/mdx2-csf": { - "optional": true - }, "react": { "optional": true }, diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index b824eadabc2b..762fb40bbe9e 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -68,12 +68,9 @@ export async function webpack( remarkPlugins: [remarkSlug, remarkExternalLinks], }; - const mdxVersion = global.FEATURES?.previewMdx2 ? 'MDX2' : 'MDX1'; - logger.info(`Addon-docs: using ${mdxVersion}`); + logger.info(`Addon-docs: using MDX2`); - const mdxLoader = global.FEATURES?.previewMdx2 - ? require.resolve('@storybook/mdx2-csf/loader') - : require.resolve('@storybook/mdx1-csf/loader'); + const mdxLoader = require.resolve('@storybook/mdx2-csf/loader'); // set `sourceLoaderOptions` to `null` to disable for manual configuration const sourceLoader = sourceLoaderOptions @@ -155,9 +152,7 @@ export const storyIndexers = async (indexers: StoryIndexer[] | null) => { const mdxIndexer = async (fileName: string, opts: IndexerOptions) => { let code = (await fs.readFile(fileName, 'utf-8')).toString(); // @ts-expect-error (Converted from ts-ignore) - const { compile } = global.FEATURES?.previewMdx2 - ? await import('@storybook/mdx2-csf') - : await import('@storybook/mdx1-csf'); + const { compile } = await import('@storybook/mdx2-csf'); code = await compile(code, {}); return loadCsf(code, { ...opts, fileName }).parse(); }; diff --git a/code/examples/doc-blocks/.storybook/main.ts b/code/examples/doc-blocks/.storybook/main.ts index 0e8ffacb423b..87e759eddc61 100644 --- a/code/examples/doc-blocks/.storybook/main.ts +++ b/code/examples/doc-blocks/.storybook/main.ts @@ -14,7 +14,6 @@ const config: StorybookConfig = { buildStoriesJson: true, babelModeV7: true, warnOnLegacyHierarchySeparator: false, - previewMdx2: true, breakingChangesV7: true, }, framework: '@storybook/react-webpack5', diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index 24855772f204..411136641c7e 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -22,7 +22,7 @@ "@storybook/client-api": "7.0.0-alpha.38", "@storybook/client-logger": "7.0.0-alpha.38", "@storybook/core-common": "7.0.0-alpha.38", - "@storybook/mdx1-csf": "0.0.5-canary.13.9ce928a.0", + "@storybook/mdx2-csf": "0.1.0-next.0", "@storybook/node-logger": "7.0.0-alpha.38", "@storybook/preview-web": "7.0.0-alpha.38", "@storybook/source-loader": "7.0.0-alpha.38", @@ -36,20 +36,11 @@ "vite": "^3.1.3" }, "devDependencies": { - "@storybook/mdx2-csf": "^0.0.3", "@types/express": "^4.17.13", "@types/node": "^16.0.0", "typescript": "~4.6.3", "vite": "^3.1.3" }, - "peerDependencies": { - "@storybook/mdx2-csf": "^0.0.3" - }, - "peerDependenciesMeta": { - "@storybook/mdx2-csf": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/lib/builder-vite/src/plugins/mdx-plugin.ts b/code/lib/builder-vite/src/plugins/mdx-plugin.ts index 03fea305fb56..e40c55bdbec1 100644 --- a/code/lib/builder-vite/src/plugins/mdx-plugin.ts +++ b/code/lib/builder-vite/src/plugins/mdx-plugin.ts @@ -56,13 +56,11 @@ export function mdxPlugin(options: Options): Plugin { if (!filter(id)) return undefined; // @ts-expect-error typescript doesn't think compile exists, but it does. - const { compile } = features?.previewMdx2 - ? await import('@storybook/mdx2-csf') - : await import('@storybook/mdx1-csf'); + const { compile } = await import('@storybook/mdx2-csf'); const mdxCode = String(await compile(src, { skipCsf: !isStorybookMdx(id) })); - const modifiedCode = injectRenderer(mdxCode, Boolean(features?.previewMdx2)); + const modifiedCode = injectRenderer(mdxCode, true); // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have const rTransform = reactRefresh?.transform; diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index b5f1fd2b4869..1b00b4e03fe2 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@babel/types": "^7.12.11", - "@mdx-js/mdx": "^1.6.22", + "@mdx-js/mdx": "^2.1.5", "@storybook/csf": "0.0.2--canary.49.258942b.0", "@storybook/csf-tools": "7.0.0-alpha.38", "@storybook/node-logger": "7.0.0-alpha.38", diff --git a/code/lib/core-common/src/types.ts b/code/lib/core-common/src/types.ts index f0fa900fc4c0..73925b769293 100644 --- a/code/lib/core-common/src/types.ts +++ b/code/lib/core-common/src/types.ts @@ -362,11 +362,6 @@ export interface StorybookConfig { * Will be removed in 7.0. */ warnOnLegacyHierarchySeparator?: boolean; - - /** - * Preview MDX2 support, will become default in 7.0 - */ - previewMdx2?: boolean; }; /** diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 9e51296c4fc2..ba9d9375506e 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -108,7 +108,6 @@ export const features = async ( interactionsDebugger: false, babelModeV7: true, argTypeTargetsV7: true, - previewMdx2: false, }); export const storyIndexers = async (indexers?: StoryIndexer[]) => { diff --git a/code/yarn.lock b/code/yarn.lock index c288ac22dc3b..3d9c63dbc8a8 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -406,30 +406,6 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.12.9": - version: 7.12.9 - resolution: "@babel/core@npm:7.12.9" - dependencies: - "@babel/code-frame": ^7.10.4 - "@babel/generator": ^7.12.5 - "@babel/helper-module-transforms": ^7.12.1 - "@babel/helpers": ^7.12.5 - "@babel/parser": ^7.12.7 - "@babel/template": ^7.12.7 - "@babel/traverse": ^7.12.9 - "@babel/types": ^7.12.7 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.1 - json5: ^2.1.2 - lodash: ^4.17.19 - resolve: ^1.3.2 - semver: ^5.4.1 - source-map: ^0.5.0 - checksum: c11d26f5a33a29c94fdd1c492dfd723f48926c51e975448dda57c081c0d74c7b03298642b2651559e0d330ec868b5757b60f9648c71cf7f89fddf79a17cf006f - languageName: node - linkType: hard - "@babel/core@npm:7.16.12": version: 7.16.12 resolution: "@babel/core@npm:7.16.12" @@ -510,7 +486,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.16.8, @babel/generator@npm:^7.19.3, @babel/generator@npm:^7.19.4, @babel/generator@npm:^7.4.0, @babel/generator@npm:^7.7.2, @babel/generator@npm:^7.8.7": +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.16.8, @babel/generator@npm:^7.19.3, @babel/generator@npm:^7.19.4, @babel/generator@npm:^7.4.0, @babel/generator@npm:^7.7.2, @babel/generator@npm:^7.8.7": version: 7.19.5 resolution: "@babel/generator@npm:7.19.5" dependencies: @@ -661,7 +637,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.16.7, @babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.19.0": +"@babel/helper-module-transforms@npm:^7.16.7, @babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helper-module-transforms@npm:7.19.0" dependencies: @@ -686,13 +662,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:7.10.4": - version: 7.10.4 - resolution: "@babel/helper-plugin-utils@npm:7.10.4" - checksum: 113d0405281f5490658f7c1c3a81b4a37927375e1ebcccd2fd90be538a102da0c2d6024561aaf26bd1c71ef7688b5a8b96a87d938db8d9774454ab635011fc7f - languageName: node - linkType: hard - "@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.18.9, @babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.19.0 resolution: "@babel/helper-plugin-utils@npm:7.19.0" @@ -787,7 +756,7 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.16.7, @babel/helpers@npm:^7.19.0, @babel/helpers@npm:^7.8.4": +"@babel/helpers@npm:^7.16.7, @babel/helpers@npm:^7.19.0, @babel/helpers@npm:^7.8.4": version: 7.19.4 resolution: "@babel/helpers@npm:7.19.4" dependencies: @@ -809,7 +778,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.12.11, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.13.12, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.12, @babel/parser@npm:^7.16.4, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.4, @babel/parser@npm:^7.19.3, @babel/parser@npm:^7.19.4, @babel/parser@npm:^7.4.3, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.7.0, @babel/parser@npm:^7.8.6, @babel/parser@npm:^7.8.7, @babel/parser@npm:^7.9.6": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.12.11, @babel/parser@npm:^7.13.12, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.12, @babel/parser@npm:^7.16.4, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.4, @babel/parser@npm:^7.19.3, @babel/parser@npm:^7.19.4, @babel/parser@npm:^7.4.3, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.7.0, @babel/parser@npm:^7.8.6, @babel/parser@npm:^7.8.7, @babel/parser@npm:^7.9.6": version: 7.19.4 resolution: "@babel/parser@npm:7.19.4" bin: @@ -993,19 +962,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-proposal-object-rest-spread@npm:7.12.1": - version: 7.12.1 - resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.12.1" - dependencies: - "@babel/helper-plugin-utils": ^7.10.4 - "@babel/plugin-syntax-object-rest-spread": ^7.8.0 - "@babel/plugin-transform-parameters": ^7.12.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: f773d59ead8b056b646d585e95d610cca2f0aeaa2eeaad74b3eb9e25821b06f27e361dd0aac9a088a10c22fee1ead8863f82a2be073e28eb04ca9a330a00941e - languageName: node - linkType: hard - "@babel/plugin-proposal-object-rest-spread@npm:^7.16.7, @babel/plugin-proposal-object-rest-spread@npm:^7.17.3, @babel/plugin-proposal-object-rest-spread@npm:^7.19.4": version: 7.19.4 resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.19.4" @@ -1216,17 +1172,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:7.12.1": - version: 7.12.1 - resolution: "@babel/plugin-syntax-jsx@npm:7.12.1" - dependencies: - "@babel/helper-plugin-utils": ^7.10.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 11d435f9e4e71c0f00e5bc295b40747c2c42341b7f38ddc5f8ac41d49ddfa247514dbe91932fa3dabd65581b4c7a9fe5b3d1c2b285e5ca32f4e5296cc185d40c - languageName: node - linkType: hard - "@babel/plugin-syntax-jsx@npm:^7.17.12, @babel/plugin-syntax-jsx@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-syntax-jsx@npm:7.18.6" @@ -1271,7 +1216,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-object-rest-spread@npm:7.8.3, @babel/plugin-syntax-object-rest-spread@npm:^7.8.0, @babel/plugin-syntax-object-rest-spread@npm:^7.8.3": +"@babel/plugin-syntax-object-rest-spread@npm:^7.8.3": version: 7.8.3 resolution: "@babel/plugin-syntax-object-rest-spread@npm:7.8.3" dependencies: @@ -1630,7 +1575,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.12.1, @babel/plugin-transform-parameters@npm:^7.16.7, @babel/plugin-transform-parameters@npm:^7.18.8": +"@babel/plugin-transform-parameters@npm:^7.16.7, @babel/plugin-transform-parameters@npm:^7.18.8": version: 7.18.8 resolution: "@babel/plugin-transform-parameters@npm:7.18.8" dependencies: @@ -2210,7 +2155,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.12.7, @babel/template@npm:^7.16.7, @babel/template@npm:^7.18.10, @babel/template@npm:^7.3.3, @babel/template@npm:^7.4.0, @babel/template@npm:^7.7.0, @babel/template@npm:^7.8.6": +"@babel/template@npm:^7.16.7, @babel/template@npm:^7.18.10, @babel/template@npm:^7.3.3, @babel/template@npm:^7.4.0, @babel/template@npm:^7.7.0, @babel/template@npm:^7.8.6": version: 7.18.10 resolution: "@babel/template@npm:7.18.10" dependencies: @@ -2221,7 +2166,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.16.10, @babel/traverse@npm:^7.19.0, @babel/traverse@npm:^7.19.1, @babel/traverse@npm:^7.19.3, @babel/traverse@npm:^7.19.4, @babel/traverse@npm:^7.4.3, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.7.2, @babel/traverse@npm:^7.8.6": +"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.16.10, @babel/traverse@npm:^7.19.0, @babel/traverse@npm:^7.19.1, @babel/traverse@npm:^7.19.3, @babel/traverse@npm:^7.19.4, @babel/traverse@npm:^7.4.3, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.7.2, @babel/traverse@npm:^7.8.6": version: 7.19.4 resolution: "@babel/traverse@npm:7.19.4" dependencies: @@ -2239,7 +2184,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.18.10, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.8, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @babel/types@npm:^7.19.3, @babel/types@npm:^7.19.4, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.0, @babel/types@npm:^7.7.2, @babel/types@npm:^7.8.3, @babel/types@npm:^7.8.6, @babel/types@npm:^7.8.7, @babel/types@npm:^7.9.6": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.12.11, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.18.10, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.8, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @babel/types@npm:^7.19.3, @babel/types@npm:^7.19.4, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.0, @babel/types@npm:^7.7.2, @babel/types@npm:^7.8.3, @babel/types@npm:^7.8.6, @babel/types@npm:^7.8.7, @babel/types@npm:^7.9.6": version: 7.19.4 resolution: "@babel/types@npm:7.19.4" dependencies: @@ -4656,33 +4601,6 @@ __metadata: languageName: node linkType: hard -"@mdx-js/mdx@npm:^1.6.22": - version: 1.6.22 - resolution: "@mdx-js/mdx@npm:1.6.22" - dependencies: - "@babel/core": 7.12.9 - "@babel/plugin-syntax-jsx": 7.12.1 - "@babel/plugin-syntax-object-rest-spread": 7.8.3 - "@mdx-js/util": 1.6.22 - babel-plugin-apply-mdx-type-prop: 1.6.22 - babel-plugin-extract-import-names: 1.6.22 - camelcase-css: 2.0.1 - detab: 2.0.4 - hast-util-raw: 6.0.1 - lodash.uniq: 4.5.0 - mdast-util-to-hast: 10.0.1 - remark-footnotes: 2.0.0 - remark-mdx: 1.6.22 - remark-parse: 8.0.3 - remark-squeeze-paragraphs: 4.0.0 - style-to-object: 0.3.0 - unified: 9.2.0 - unist-builder: 2.0.3 - unist-util-visit: 2.0.3 - checksum: 7f4c38911fc269159834240d3cc9279839145022a992bd61657530750c7ab5d0f674e8d6319b6e2e426d0e1adc6cc5ab1876e57548208783d8a3d1b8ef73ebca - languageName: node - linkType: hard - "@mdx-js/mdx@npm:^2.0.0": version: 2.1.4 resolution: "@mdx-js/mdx@npm:2.1.4" @@ -4708,6 +4626,31 @@ __metadata: languageName: node linkType: hard +"@mdx-js/mdx@npm:^2.1.5": + version: 2.1.5 + resolution: "@mdx-js/mdx@npm:2.1.5" + dependencies: + "@types/estree-jsx": ^1.0.0 + "@types/mdx": ^2.0.0 + estree-util-build-jsx: ^2.0.0 + estree-util-is-identifier-name: ^2.0.0 + estree-util-to-js: ^1.1.0 + estree-walker: ^3.0.0 + hast-util-to-estree: ^2.0.0 + markdown-extensions: ^1.0.0 + periscopic: ^3.0.0 + remark-mdx: ^2.0.0 + remark-parse: ^10.0.0 + remark-rehype: ^10.0.0 + unified: ^10.0.0 + unist-util-position-from-estree: ^1.0.0 + unist-util-stringify-position: ^3.0.0 + unist-util-visit: ^4.0.0 + vfile: ^5.0.0 + checksum: 364f70656038ea9f9281b867ca4ce9efa7c678621f489711cc293bdd253687704b68303101c2446b1bb6296adda99ef07f601e8278410399438ac8f1dc9311aa + languageName: node + linkType: hard + "@mdx-js/react@npm:^1.6.16, @mdx-js/react@npm:^1.6.22": version: 1.6.22 resolution: "@mdx-js/react@npm:1.6.22" @@ -4717,13 +4660,6 @@ __metadata: languageName: node linkType: hard -"@mdx-js/util@npm:1.6.22": - version: 1.6.22 - resolution: "@mdx-js/util@npm:1.6.22" - checksum: 2ee8da6afea0f42297ea31f52b1d50d228744d2895cce7cc9571b7d5ce97c7c96037c80b6dbcded9caa8099c9a994eda62980099eabe1c000aaa792816c66f10 - languageName: node - linkType: hard - "@mischnic/json-sourcemap@npm:^0.1.0": version: 0.1.0 resolution: "@mischnic/json-sourcemap@npm:0.1.0" @@ -6488,8 +6424,7 @@ __metadata: "@storybook/csf": 0.0.2--canary.49.258942b.0 "@storybook/csf-tools": 7.0.0-alpha.38 "@storybook/docs-tools": 7.0.0-alpha.38 - "@storybook/mdx1-csf": 0.0.5-canary.13.9ce928a.0 - "@storybook/mdx2-csf": 0.0.4-canary.14.04ffbe8.0 + "@storybook/mdx2-csf": 0.1.0-next.0 "@storybook/node-logger": 7.0.0-alpha.38 "@storybook/postinstall": 7.0.0-alpha.38 "@storybook/preview-web": 7.0.0-alpha.38 @@ -6507,12 +6442,9 @@ __metadata: typescript: ~4.6.3 util-deprecate: ^1.0.2 peerDependencies: - "@storybook/mdx2-csf": 0.0.4-canary.14.04ffbe8.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 peerDependenciesMeta: - "@storybook/mdx2-csf": - optional: true react: optional: true react-dom: @@ -7172,8 +7104,7 @@ __metadata: "@storybook/client-api": 7.0.0-alpha.38 "@storybook/client-logger": 7.0.0-alpha.38 "@storybook/core-common": 7.0.0-alpha.38 - "@storybook/mdx1-csf": 0.0.5-canary.13.9ce928a.0 - "@storybook/mdx2-csf": ^0.0.3 + "@storybook/mdx2-csf": 0.1.0-next.0 "@storybook/node-logger": 7.0.0-alpha.38 "@storybook/preview-web": 7.0.0-alpha.38 "@storybook/source-loader": 7.0.0-alpha.38 @@ -7188,11 +7119,6 @@ __metadata: slash: ^3.0.0 typescript: ~4.6.3 vite: ^3.1.3 - peerDependencies: - "@storybook/mdx2-csf": ^0.0.3 - peerDependenciesMeta: - "@storybook/mdx2-csf": - optional: true languageName: unknown linkType: soft @@ -7395,7 +7321,7 @@ __metadata: resolution: "@storybook/codemod@workspace:lib/codemod" dependencies: "@babel/types": ^7.12.11 - "@mdx-js/mdx": ^1.6.22 + "@mdx-js/mdx": ^2.1.5 "@storybook/csf": 0.0.2--canary.49.258942b.0 "@storybook/csf-tools": 7.0.0-alpha.38 "@storybook/node-logger": 7.0.0-alpha.38 @@ -7895,29 +7821,9 @@ __metadata: languageName: node linkType: hard -"@storybook/mdx1-csf@npm:0.0.5-canary.13.9ce928a.0": - version: 0.0.5-canary.13.9ce928a.0 - resolution: "@storybook/mdx1-csf@npm:0.0.5-canary.13.9ce928a.0" - dependencies: - "@babel/generator": ^7.12.11 - "@babel/parser": ^7.12.11 - "@babel/preset-env": ^7.12.11 - "@babel/types": ^7.12.11 - "@mdx-js/mdx": ^1.6.22 - "@mdx-js/react": ^1.6.22 - "@types/lodash": ^4.14.167 - js-string-escape: ^1.0.1 - loader-utils: ^2.0.0 - lodash: ^4.17.21 - prettier: ">=2.2.1 <=2.3.0" - ts-dedent: ^2.0.0 - checksum: 904c00fd2965ceff65e8a6a77b6192f17b4b5df5f8fbfad7c4c067ec0d269b428ad1733922233ac4ad2a1bd110ec0442ae122ede2be0703e07f0eb3f8b13730f - languageName: node - linkType: hard - -"@storybook/mdx2-csf@npm:0.0.4-canary.14.04ffbe8.0": - version: 0.0.4-canary.14.04ffbe8.0 - resolution: "@storybook/mdx2-csf@npm:0.0.4-canary.14.04ffbe8.0" +"@storybook/mdx2-csf@npm:0.1.0-next.0": + version: 0.1.0-next.0 + resolution: "@storybook/mdx2-csf@npm:0.1.0-next.0" dependencies: "@babel/generator": ^7.12.11 "@babel/parser": ^7.12.11 @@ -7927,23 +7833,7 @@ __metadata: js-string-escape: ^1.0.1 loader-utils: ^2.0.0 lodash: ^4.17.21 - checksum: 71d4b96cfcfa52c345bfd546a3428062800f5f627e5d6bb8ab30d019f5be02b48315f2823240468d00fa536320adfb846bdd57534f5ef9985ff9a4dcf7550ac9 - languageName: node - linkType: hard - -"@storybook/mdx2-csf@npm:^0.0.3": - version: 0.0.3 - resolution: "@storybook/mdx2-csf@npm:0.0.3" - dependencies: - "@babel/generator": ^7.12.11 - "@babel/parser": ^7.12.11 - "@mdx-js/mdx": ^2.0.0 - estree-to-babel: ^4.9.0 - hast-util-to-estree: ^2.0.2 - js-string-escape: ^1.0.1 - loader-utils: ^2.0.0 - lodash: ^4.17.21 - checksum: 0bbf5d537930c8a592a371012fb9cc3cd88a5184ff3a6a40a04ccf1c702e6f2c79a57c61b13c772b24c42c4a7f5820e9d7cf933d16a78e08f6e24a6bb2171efc + checksum: 116292c2bc658ad575dbc31c1aa6530f57e7c392ee1728143a8b31686e38ecb3fac6ccea860ce9860fe78167dabe6e09bed5ca5089594851b7733091ad0f91e9 languageName: node linkType: hard @@ -9948,13 +9838,6 @@ __metadata: languageName: node linkType: hard -"@types/parse5@npm:^5.0.0": - version: 5.0.3 - resolution: "@types/parse5@npm:5.0.3" - checksum: 7d7ebbcb704a0ef438aa0de43ea1fd9723dfa802b8fa459628ceaf063f092bd19791b2a2580265244898dcc9d40f7345588a76cf752847d29540539f802711ed - languageName: node - linkType: hard - "@types/parse5@npm:^6.0.3": version: 6.0.3 resolution: "@types/parse5@npm:6.0.3" @@ -10314,7 +10197,7 @@ __metadata: languageName: node linkType: hard -"@types/unist@npm:*, @types/unist@npm:^2.0.0, @types/unist@npm:^2.0.2, @types/unist@npm:^2.0.3": +"@types/unist@npm:*, @types/unist@npm:^2.0.0, @types/unist@npm:^2.0.2": version: 2.0.6 resolution: "@types/unist@npm:2.0.6" checksum: 8690789328e8e10c487334341fcf879fd49f8987c98ce49849f9871052f95d87477735171bb661e6f551bdb95235e015dfdad1867ca1d9b5b88a053f72ac40eb @@ -12545,18 +12428,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-apply-mdx-type-prop@npm:1.6.22": - version: 1.6.22 - resolution: "babel-plugin-apply-mdx-type-prop@npm:1.6.22" - dependencies: - "@babel/helper-plugin-utils": 7.10.4 - "@mdx-js/util": 1.6.22 - peerDependencies: - "@babel/core": ^7.11.6 - checksum: d1fd88f2eee87f3d709373cfac5165f8407793b123e1c7061308311f7e6b0778e093a4a93e7130b47c5a742f2515d0c1d4f3da5097ff195ef91011688ec17ddc - languageName: node - linkType: hard - "babel-plugin-bundled-import-meta@npm:^0.3.1": version: 0.3.2 resolution: "babel-plugin-bundled-import-meta@npm:0.3.2" @@ -12607,15 +12478,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-extract-import-names@npm:1.6.22": - version: 1.6.22 - resolution: "babel-plugin-extract-import-names@npm:1.6.22" - dependencies: - "@babel/helper-plugin-utils": 7.10.4 - checksum: c7b7206222f7b70f2c9852caa621cc3742b5d9f7dd4229a6e3c560d7683b82f835a8ea46db632df5dab5ad91b1439ead3771a8576a7a14e418248c16fd1f0cc4 - languageName: node - linkType: hard - "babel-plugin-filter-imports@npm:^4.0.0": version: 4.0.0 resolution: "babel-plugin-filter-imports@npm:4.0.0" @@ -14328,13 +14190,6 @@ __metadata: languageName: node linkType: hard -"camelcase-css@npm:2.0.1": - version: 2.0.1 - resolution: "camelcase-css@npm:2.0.1" - checksum: 1a1a3137e8a781e6cbeaeab75634c60ffd8e27850de410c162cce222ea331cd1ba5364e8fb21c95e5ca76f52ac34b81a090925ca00a87221355746d049c6e273 - languageName: node - linkType: hard - "camelcase-keys@npm:^2.0.0": version: 2.1.0 resolution: "camelcase-keys@npm:2.1.0" @@ -16765,15 +16620,6 @@ __metadata: languageName: node linkType: hard -"detab@npm:2.0.4": - version: 2.0.4 - resolution: "detab@npm:2.0.4" - dependencies: - repeat-string: ^1.5.4 - checksum: 969c7f5a04fc3f8c52eb3b9db2fd4ba20b9b9ce56c5659ebf4cf93ba6c1be68b651665d053affbe99e76733cf7d134546cdd6be038af368f8365f42a646d5fb8 - languageName: node - linkType: hard - "detect-file@npm:^1.0.0": version: 1.0.0 resolution: "detect-file@npm:1.0.0" @@ -22057,35 +21903,6 @@ __metadata: languageName: node linkType: hard -"hast-to-hyperscript@npm:^9.0.0": - version: 9.0.1 - resolution: "hast-to-hyperscript@npm:9.0.1" - dependencies: - "@types/unist": ^2.0.3 - comma-separated-tokens: ^1.0.0 - property-information: ^5.3.0 - space-separated-tokens: ^1.0.0 - style-to-object: ^0.3.0 - unist-util-is: ^4.0.0 - web-namespaces: ^1.0.0 - checksum: 630f0db8e1c78d8d6e4f8bd19dec4b6ff6c3048ba0b07b8e34bb812dfbbdc96f4c16abca16c3bfc64e7757921f42790a7bd4a693d6ce99375f99dead65a19a12 - languageName: node - linkType: hard - -"hast-util-from-parse5@npm:^6.0.0": - version: 6.0.1 - resolution: "hast-util-from-parse5@npm:6.0.1" - dependencies: - "@types/parse5": ^5.0.0 - hastscript: ^6.0.0 - property-information: ^5.0.0 - vfile: ^4.0.0 - vfile-location: ^3.2.0 - web-namespaces: ^1.0.0 - checksum: c5e7ee40347c3850ece717e37c3e277ca233848ebca341f68c2afbefdb912da415a2fd06940edc3ea4882ad520e1cac7bf3fcf66c31ae97e1bcf953fcb6a7db5 - languageName: node - linkType: hard - "hast-util-parse-selector@npm:^2.0.0": version: 2.2.5 resolution: "hast-util-parse-selector@npm:2.2.5" @@ -22093,24 +21910,6 @@ __metadata: languageName: node linkType: hard -"hast-util-raw@npm:6.0.1": - version: 6.0.1 - resolution: "hast-util-raw@npm:6.0.1" - dependencies: - "@types/hast": ^2.0.0 - hast-util-from-parse5: ^6.0.0 - hast-util-to-parse5: ^6.0.0 - html-void-elements: ^1.0.0 - parse5: ^6.0.0 - unist-util-position: ^3.0.0 - vfile: ^4.0.0 - web-namespaces: ^1.0.0 - xtend: ^4.0.0 - zwitch: ^1.0.0 - checksum: 0ed0a2731251a4853710eda38e0bb79ee1ad8ccea69b391c16eb20895895818bced1c2c9eaf8853280f0aa6dc71d22b9eb6c9aab770dd1a225bb44d522eef1ef - languageName: node - linkType: hard - "hast-util-to-estree@npm:^2.0.0, hast-util-to-estree@npm:^2.0.2": version: 2.1.0 resolution: "hast-util-to-estree@npm:2.1.0" @@ -22134,19 +21933,6 @@ __metadata: languageName: node linkType: hard -"hast-util-to-parse5@npm:^6.0.0": - version: 6.0.0 - resolution: "hast-util-to-parse5@npm:6.0.0" - dependencies: - hast-to-hyperscript: ^9.0.0 - property-information: ^5.0.0 - web-namespaces: ^1.0.0 - xtend: ^4.0.0 - zwitch: ^1.0.0 - checksum: 49d6c2389fd3170741cdb0483666bccd7e9e436fe386bcbd3931b019e4c006b5bb48022e07967e1021336e744e901082d6479cfa4bc2082efa3b1e5bdab2a36f - languageName: node - linkType: hard - "hast-util-whitespace@npm:^2.0.0": version: 2.0.0 resolution: "hast-util-whitespace@npm:2.0.0" @@ -22415,13 +22201,6 @@ __metadata: languageName: node linkType: hard -"html-void-elements@npm:^1.0.0": - version: 1.0.5 - resolution: "html-void-elements@npm:1.0.5" - checksum: 97b6c108d7d6b31a45deddf95a65eb074bd0f358b55a61f3a031e055812eec368076ca23f0181674c5212166168988f35312756a3b376490e31e73d9a51f5549 - languageName: node - linkType: hard - "html-webpack-plugin@npm:^5.5.0": version: 5.5.0 resolution: "html-webpack-plugin@npm:5.5.0" @@ -23405,7 +23184,7 @@ __metadata: languageName: node linkType: hard -"is-alphabetical@npm:1.0.4, is-alphabetical@npm:^1.0.0": +"is-alphabetical@npm:^1.0.0": version: 1.0.4 resolution: "is-alphabetical@npm:1.0.4" checksum: 1505b1de5a1fd74022c05fb21b0e683a8f5229366bac8dc4d34cf6935bcfd104d1125a5e6b083fb778847629f76e5bdac538de5367bdf2b927a1356164e23985 @@ -27799,7 +27578,7 @@ __metadata: languageName: node linkType: hard -"lodash.uniq@npm:4.5.0, lodash.uniq@npm:^4.2.0, lodash.uniq@npm:^4.5.0": +"lodash.uniq@npm:^4.2.0, lodash.uniq@npm:^4.5.0": version: 4.5.0 resolution: "lodash.uniq@npm:4.5.0" checksum: 262d400bb0952f112162a320cc4a75dea4f66078b9e7e3075ffbc9c6aa30b3e9df3cf20e7da7d566105e1ccf7804e4fbd7d804eee0b53de05d83f16ffbf41c5e @@ -28372,15 +28151,6 @@ __metadata: languageName: node linkType: hard -"mdast-squeeze-paragraphs@npm:^4.0.0": - version: 4.0.0 - resolution: "mdast-squeeze-paragraphs@npm:4.0.0" - dependencies: - unist-util-remove: ^2.0.0 - checksum: 0b44a85d7e6d98772b1dbb28a46a35c74c2791c6cf057bfd2e590a4e011d626627e5bf82d4497706f0dae03da02a63a9279aca17c4c23a9c7173792adba8e6fc - languageName: node - linkType: hard - "mdast-util-compact@npm:^2.0.0": version: 2.0.1 resolution: "mdast-util-compact@npm:2.0.1" @@ -28568,22 +28338,6 @@ __metadata: languageName: node linkType: hard -"mdast-util-to-hast@npm:10.0.1": - version: 10.0.1 - resolution: "mdast-util-to-hast@npm:10.0.1" - dependencies: - "@types/mdast": ^3.0.0 - "@types/unist": ^2.0.0 - mdast-util-definitions: ^4.0.0 - mdurl: ^1.0.0 - unist-builder: ^2.0.0 - unist-util-generated: ^1.0.0 - unist-util-position: ^3.0.0 - unist-util-visit: ^2.0.0 - checksum: 08d0977c60ee951cb5e2e84bc821a842da463c37f7bbb79abf0be0894120ed5e2fc1d003d072d3bb968d8e813a916e132a094166d5562deb424acc45e1c661f4 - languageName: node - linkType: hard - "mdast-util-to-hast@npm:^12.1.0": version: 12.2.4 resolution: "mdast-util-to-hast@npm:12.2.4" @@ -28665,7 +28419,7 @@ __metadata: languageName: node linkType: hard -"mdurl@npm:^1.0.0, mdurl@npm:^1.0.1, mdurl@npm:~1.0.0": +"mdurl@npm:^1.0.1, mdurl@npm:~1.0.0": version: 1.0.1 resolution: "mdurl@npm:1.0.1" checksum: ea8534341eb002aaa532a722daef6074cd8ca66202e10a2b4cda46722c1ebdb1da92197ac300bc953d3ef1bf41cd6561ef2cc69d82d5d0237dae00d4a61a4eee @@ -31770,7 +31524,7 @@ __metadata: languageName: node linkType: hard -"parse5@npm:6.0.1, parse5@npm:^6.0.0, parse5@npm:^6.0.1": +"parse5@npm:6.0.1, parse5@npm:^6.0.1": version: 6.0.1 resolution: "parse5@npm:6.0.1" checksum: 595821edc094ecbcfb9ddcb46a3e1fe3a718540f8320eff08b8cf6742a5114cce2d46d45f95c26191c11b184dcaf4e2960abcd9c5ed9eb9393ac9a37efcfdecb @@ -33200,7 +32954,7 @@ __metadata: languageName: node linkType: hard -"property-information@npm:^5.0.0, property-information@npm:^5.3.0": +"property-information@npm:^5.0.0": version: 5.6.0 resolution: "property-information@npm:5.6.0" dependencies: @@ -34688,13 +34442,6 @@ __metadata: languageName: node linkType: hard -"remark-footnotes@npm:2.0.0": - version: 2.0.0 - resolution: "remark-footnotes@npm:2.0.0" - checksum: 45b55b3440b74bfeed11fba5ed6b31f2fd35ab4e9ba169061b76a19f5ff4d16d851c9f3c423c7fa54eb0fa5e6043b89098cb9478e9b5b417cf4bdef5571b0236 - languageName: node - linkType: hard - "remark-gfm@npm:^1.0.0": version: 1.0.0 resolution: "remark-gfm@npm:1.0.0" @@ -34970,22 +34717,6 @@ __metadata: languageName: node linkType: hard -"remark-mdx@npm:1.6.22": - version: 1.6.22 - resolution: "remark-mdx@npm:1.6.22" - dependencies: - "@babel/core": 7.12.9 - "@babel/helper-plugin-utils": 7.10.4 - "@babel/plugin-proposal-object-rest-spread": 7.12.1 - "@babel/plugin-syntax-jsx": 7.12.1 - "@mdx-js/util": 1.6.22 - is-alphabetical: 1.0.4 - remark-parse: 8.0.3 - unified: 9.2.0 - checksum: 3a964048e58cba7848d59fc920baa330a9b7f619fedb44d4d7985d84875eba8d92e0d0dd0617e28326c6086e21ef441664748526a2517a42555d44c648453b0a - languageName: node - linkType: hard - "remark-mdx@npm:^2.0.0": version: 2.1.4 resolution: "remark-mdx@npm:2.1.4" @@ -35006,7 +34737,18 @@ __metadata: languageName: node linkType: hard -"remark-parse@npm:8.0.3, remark-parse@npm:^8.0.0": +"remark-parse@npm:^10.0.0": + version: 10.0.1 + resolution: "remark-parse@npm:10.0.1" + dependencies: + "@types/mdast": ^3.0.0 + mdast-util-from-markdown: ^1.0.0 + unified: ^10.0.0 + checksum: 1ca6e9b2f8e628d260c68a0367cb6dc92f20e6dd70c195a79584d09b237133ddf96e6398733e53bfbf379a3c4ad6168caa5792a6d83870b7cc014b259531f772 + languageName: node + linkType: hard + +"remark-parse@npm:^8.0.0": version: 8.0.3 resolution: "remark-parse@npm:8.0.3" dependencies: @@ -35030,17 +34772,6 @@ __metadata: languageName: node linkType: hard -"remark-parse@npm:^10.0.0": - version: 10.0.1 - resolution: "remark-parse@npm:10.0.1" - dependencies: - "@types/mdast": ^3.0.0 - mdast-util-from-markdown: ^1.0.0 - unified: ^10.0.0 - checksum: 1ca6e9b2f8e628d260c68a0367cb6dc92f20e6dd70c195a79584d09b237133ddf96e6398733e53bfbf379a3c4ad6168caa5792a6d83870b7cc014b259531f772 - languageName: node - linkType: hard - "remark-parse@npm:^9.0.0": version: 9.0.0 resolution: "remark-parse@npm:9.0.0" @@ -35121,15 +34852,6 @@ __metadata: languageName: node linkType: hard -"remark-squeeze-paragraphs@npm:4.0.0": - version: 4.0.0 - resolution: "remark-squeeze-paragraphs@npm:4.0.0" - dependencies: - mdast-squeeze-paragraphs: ^4.0.0 - checksum: 61b39acfde3bebb1e9364a6991957f83ab0d878c0fd1de0e86e9bf9e060574cefb7a76057d64e7422e2a2bcf6e3c54635a4ae43f00b3dda38812ae4b6f4342f4 - languageName: node - linkType: hard - "remark-stringify@npm:^8.0.0": version: 8.1.1 resolution: "remark-stringify@npm:8.1.1" @@ -37824,7 +37546,7 @@ __metadata: languageName: node linkType: hard -"style-to-object@npm:0.3.0, style-to-object@npm:^0.3.0": +"style-to-object@npm:^0.3.0": version: 0.3.0 resolution: "style-to-object@npm:0.3.0" dependencies: @@ -39715,20 +39437,6 @@ __metadata: languageName: node linkType: hard -"unified@npm:9.2.0": - version: 9.2.0 - resolution: "unified@npm:9.2.0" - dependencies: - bail: ^1.0.0 - extend: ^3.0.0 - is-buffer: ^2.0.0 - is-plain-obj: ^2.0.0 - trough: ^1.0.0 - vfile: ^4.0.0 - checksum: 53aedb794b0ada002b72593d74633f45742e3dfe771a8091c0f51b59119f74f3f1bba0a24c5d72a35629793f992cf9e1debf21aa4689dc718482ffec3a633623 - languageName: node - linkType: hard - "unified@npm:^10.0.0": version: 10.1.2 resolution: "unified@npm:10.1.2" @@ -39834,13 +39542,6 @@ __metadata: languageName: node linkType: hard -"unist-builder@npm:2.0.3, unist-builder@npm:^2.0.0": - version: 2.0.3 - resolution: "unist-builder@npm:2.0.3" - checksum: d8b13ffd774bfe6175ca988d63cbaf6d85882a0701d6158597134ce1c3acf665a09421461a4036704f77edb8a6a2792d09eb55382428c2a9a60488b44909eeae - languageName: node - linkType: hard - "unist-builder@npm:^3.0.0": version: 3.0.0 resolution: "unist-builder@npm:3.0.0" @@ -39931,15 +39632,6 @@ __metadata: languageName: node linkType: hard -"unist-util-remove@npm:^2.0.0": - version: 2.1.0 - resolution: "unist-util-remove@npm:2.1.0" - dependencies: - unist-util-is: ^4.0.0 - checksum: f7dea56fb720ddab5e406af12ce37453b028273e23a7cc3e4c9f3f1ec85e1f72c6943a1ebb907120c9be0b1d08b209d7b8c7d2191a5012e16081056edf638df9 - languageName: node - linkType: hard - "unist-util-stringify-position@npm:^2.0.0": version: 2.0.3 resolution: "unist-util-stringify-position@npm:2.0.3" @@ -39978,7 +39670,7 @@ __metadata: languageName: node linkType: hard -"unist-util-visit@npm:2.0.3, unist-util-visit@npm:^2.0.0": +"unist-util-visit@npm:^2.0.0": version: 2.0.3 resolution: "unist-util-visit@npm:2.0.3" dependencies: @@ -40524,7 +40216,7 @@ __metadata: languageName: node linkType: hard -"vfile-location@npm:^3.0.0, vfile-location@npm:^3.1.0, vfile-location@npm:^3.2.0": +"vfile-location@npm:^3.0.0, vfile-location@npm:^3.1.0": version: 3.2.0 resolution: "vfile-location@npm:3.2.0" checksum: d9513c738fcac26388f4ee04337663514434df718201309088377b53be3fdcfdb01a4a8f02f5a21ebf33690a670f31229e4c7c3991fb7af63f549fda3ec36836 @@ -41064,13 +40756,6 @@ __metadata: languageName: node linkType: hard -"web-namespaces@npm:^1.0.0": - version: 1.1.4 - resolution: "web-namespaces@npm:1.1.4" - checksum: 05b5782c32a33ef94fa7a412afdebc9d0d3cc7b59db31d2cc7bd80de3e237d4b6309cb5f156d06e3a837b9826c9414448c25111ec1d4407d2025ffeb7bea4f62 - languageName: node - linkType: hard - "web-streams-polyfill@npm:^3.0.3, web-streams-polyfill@npm:^3.2.1": version: 3.2.1 resolution: "web-streams-polyfill@npm:3.2.1" diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 848b0f1a46a3..f53094873dbc 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -127,7 +127,7 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) { // NOTE: the test regexp here will apply whether the path is symlink-preserved or otherwise const esbuildLoaderPath = require.resolve('../../code/node_modules/esbuild-loader'); const storiesMdxLoaderPath = require.resolve( - '../../code/node_modules/@storybook/mdx1-csf/loader' + '../../code/node_modules/@storybook/mdx2-csf/loader' ); const babelLoaderPath = require.resolve('babel-loader'); const jsxPluginPath = require.resolve('@babel/plugin-transform-react-jsx'); From d46e80a6df3948afa24e7b3fbe9f7351b8838304 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 15 Oct 2022 15:00:29 +0800 Subject: [PATCH 03/18] Add preliminary MDXv2 MIGRATION guide --- MIGRATION.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 0b0475d293fe..8672e58664f5 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -31,6 +31,7 @@ - [Docs Page](#docs-page) - [Configuring the Docs Container](#configuring-the-docs-container) - [External Docs](#external-docs) + - [MDX2 upgrade](#mdx2-upgrade) - [From version 6.4.x to 6.5.0](#from-version-64x-to-650) - [Vue 3 upgrade](#vue-3-upgrade) - [React18 new root API](#react18-new-root-api) @@ -704,6 +705,14 @@ export default function App({ Component, pageProps }) { } ``` +#### MDX2 upgrade + +Storybook 7 Docs uses MDXv2 instead of MDXv1. This means an improved syntax, support for inline JS expression, and improved performance among [other benefits](https://mdxjs.com/blog/v2/). + +If you use `.stories.mdx` files in your project, you may need to edit them since MDX2 contains [breaking changes](https://mdxjs.com/migrating/v2/#update-mdx-files). + +We will update this section with specific pointers based on user feedback during the prerelease period and probably add an automigration to help streamline the upgrade before final 7.0 release. + ## From version 6.4.x to 6.5.0 ### Vue 3 upgrade From 3f2430b2d98729f052e136d811c5c0a4e502db4e Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 15 Oct 2022 18:19:31 +0800 Subject: [PATCH 04/18] Delete broken mdx-to-csf codemod (will be replaced) --- MIGRATION.md | 4 +- code/addons/docs/docs/recipes.md | 7 - code/lib/codemod/README.md | 36 ---- code/lib/codemod/package.json | 1 - code/lib/codemod/src/transforms/mdx-to-csf.js | 184 ------------------ code/yarn.lock | 26 --- 6 files changed, 3 insertions(+), 255 deletions(-) delete mode 100644 code/lib/codemod/src/transforms/mdx-to-csf.js diff --git a/MIGRATION.md b/MIGRATION.md index 8672e58664f5..e0a4abb4906a 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -711,7 +711,9 @@ Storybook 7 Docs uses MDXv2 instead of MDXv1. This means an improved syntax, sup If you use `.stories.mdx` files in your project, you may need to edit them since MDX2 contains [breaking changes](https://mdxjs.com/migrating/v2/#update-mdx-files). -We will update this section with specific pointers based on user feedback during the prerelease period and probably add an automigration to help streamline the upgrade before final 7.0 release. +We will update this section with specific pointers based on user feedback during the prerelease period and probably add an codemod to help streamline the upgrade before final 7.0 release. + +As part of the upgrade we deleted the codemod `mdx-to-csf` and will be replacing it with a more sophisticated version prior to release. ## From version 6.4.x to 6.5.0 diff --git a/code/addons/docs/docs/recipes.md b/code/addons/docs/docs/recipes.md index 2f1816b131ec..18809715838c 100644 --- a/code/addons/docs/docs/recipes.md +++ b/code/addons/docs/docs/recipes.md @@ -4,7 +4,6 @@ - [Component Story Format (CSF) with DocsPage](#component-story-format-csf-with-docspage) - [Pure MDX Stories](#pure-mdx-stories) -- [Mixed CSF / MDX Stories](#mixed-csf--mdx-stories) - [CSF Stories with MDX Docs](#csf-stories-with-mdx-docs) - [CSF Stories with arbitrary MDX](#csf-stories-with-arbitrary-mdx) - [Mixing storiesOf with CSF/MDX](#mixing-storiesof-with-csfmdx) @@ -30,12 +29,6 @@ If you want to intersperse longform documentation in your Storybook, for example [MDX](mdx.md) is an alternative syntax to CSF that allows you to co-locate your stories and your documentation. Everything you can do in CSF, you can do in MDX. And if you're consuming it in [Webpack](https://webpack.js.org/), it exposes an _identical_ interface, so the two files are interchangeable. Some teams will choose to write all of their Storybook in MDX and never look back. -## Mixed CSF / MDX Stories - -Can't decide between CSF and MDX? In transition? Or have you found that each format has its own use? There's nothing stopping you from keeping some of your stories in CSF and some in MDX. And if you want to migrate one way or another, the [csf-to-mdx and mdx-to-csf codemod migrations](https://github.com/storybookjs/storybook/blob/next/code/lib/codemod/README.md) can help. - -The only limitation is that your exported titles (CSF: `default.title`, MDX `Meta.title`) should be unique across files. Loading will fail if there are duplicate titles. - ## CSF Stories with MDX Docs Perhaps you want to write your stories in CSF, but document them in MDX? Here's how to do that: diff --git a/code/lib/codemod/README.md b/code/lib/codemod/README.md index bd03d261c96d..2a539e9ea580 100644 --- a/code/lib/codemod/README.md +++ b/code/lib/codemod/README.md @@ -240,42 +240,6 @@ import { Meta, Story } from '@storybook/addon-docs'; ``` -### mdx-to-csf - -This converts all your MDX stories into Component Story Format. - -```sh -./node_modules/.bin/jscodeshift -t ./node_modules/@storybook/codemod/dist/transforms/mdx-to-csf.js . --ignore-pattern "node_modules|dist" --extensions=mdx -``` - -For example: - -```js -import React from 'react'; -import Button from './Button'; -import { Meta, Story } from '@storybook/addon-docs'; - - - -