Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Upgrade docs-mdx for smaller install #28552

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-slot": "^1.0.2",
"@storybook/docs-mdx": "3.1.0-next.0",
"@storybook/docs-mdx": "4.0.0-next.0",
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.5",
"@tanstack/react-virtual": "^3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions code/core/src/core-server/utils/StoryIndexGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { commonGlobOptions, normalizeStoryPath } from '@storybook/core/common';
import { logger, once } from '@storybook/core/node-logger';
import { getStorySortParameter, loadConfig } from '@storybook/core/csf-tools';
import { storyNameFromExport, toId, combineTags } from '@storybook/csf';
import { analyze } from '@storybook/docs-mdx';
import { dedent } from 'ts-dedent';
import { autoName } from './autoName';
import { IndexingError, MultipleIndexingError } from './IndexingError';
Expand Down Expand Up @@ -408,7 +407,8 @@ export class StoryIndexGenerator {

const content = await fs.readFile(absolutePath, 'utf8');

const result = analyze(content);
const { analyze } = await import('@storybook/docs-mdx');
const result = await analyze(content);

// Templates are not indexed
if (result.isTemplate) return false;
Expand Down
14 changes: 8 additions & 6 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5758,7 +5758,7 @@ __metadata:
"@radix-ui/react-scroll-area": "npm:^1.0.5"
"@radix-ui/react-slot": "npm:^1.0.2"
"@storybook/csf": "npm:0.1.11"
"@storybook/docs-mdx": "npm:3.1.0-next.0"
"@storybook/docs-mdx": "npm:4.0.0-next.0"
"@storybook/global": "npm:^5.0.0"
"@storybook/icons": "npm:^1.2.5"
"@tanstack/react-virtual": "npm:^3.3.0"
Expand Down Expand Up @@ -5911,10 +5911,12 @@ __metadata:
languageName: node
linkType: hard

"@storybook/docs-mdx@npm:3.1.0-next.0":
version: 3.1.0-next.0
resolution: "@storybook/docs-mdx@npm:3.1.0-next.0"
checksum: 10c0/7622d7c6318e842c90a71c1836d68531236c31fff7081c885803eddfafb7e3f8998689f612eaa0292209ada8352a36657dcacb5d3ef4632b8e8b8a283c39602e
"@storybook/docs-mdx@npm:4.0.0-next.0":
version: 4.0.0-next.0
resolution: "@storybook/docs-mdx@npm:4.0.0-next.0"
dependencies:
acorn: "npm:^8.12.1"
checksum: 10c0/6253361e4e3c6c716c4f4c8cc30c082bcdab66b35b30183f6574d94720d875e28927916be8bda0bff4987090c3e50d348ca898160b1812a90c5afa845400414e
languageName: node
linkType: hard

Expand Down Expand Up @@ -9241,7 +9243,7 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:^8.0.0, acorn@npm:^8.10.0, acorn@npm:^8.11.2, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.6.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
"acorn@npm:^8.0.0, acorn@npm:^8.10.0, acorn@npm:^8.11.2, acorn@npm:^8.11.3, acorn@npm:^8.12.1, acorn@npm:^8.4.1, acorn@npm:^8.6.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.12.1
resolution: "acorn@npm:8.12.1"
bin:
Expand Down