Skip to content

Commit 7e31f20

Browse files
committed
fix review comments
1 parent 4bdce8d commit 7e31f20

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

apps/public-docsite-v9/storybook-llms.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const storybookConfig = require('./.storybook/main');
66
* Config for the LLMs docs generator script.
77
* @see {@link file://./../../tools/storybook-llms-extractor/src/cli.ts}
88
*
9-
* @type {import('@fluentui/storybook-llms-extractor').Args}
9+
* @type {import('@fluentui/storybook-llms-extractor').Config}
1010
*/
1111
module.exports = {
1212
distPath: './dist/storybook',

tools/storybook-llms-extractor/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"outputPath": "{projectRoot}/dist",
1313
"main": "tools/storybook-llms-extractor/src/index.ts",
1414
"tsConfig": "tools/storybook-llms-extractor/tsconfig.lib.json",
15-
"assets": ["tools/storybook-llms-extractor/*.md", "tools/storybook-llms-extractor/src/template/*"]
15+
"assets": ["tools/storybook-llms-extractor/*.md"]
1616
}
1717
}
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export type { Args } from './types';
1+
export type { Args as Config } from './types';
22

33
export {};

tools/storybook-llms-extractor/src/types.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,3 @@ export type StorybookComponentProp = {
117117
* ```
118118
*/
119119
export type StorybookRef = { title: string; url: string; sourceUrl?: string };
120-
121-
/**
122-
* Storybook Client API store, contains methods to cache CSF files and cached items.
123-
*/
124-
type StorybookStoryStore = {
125-
/**
126-
* Caches all CSF files in the Storybook store.
127-
* This method must be called before accessing `cachedCSFFiles`.
128-
*/
129-
cacheAllCSFFiles: () => Promise<void>;
130-
/**
131-
* CSF files become available after `cacheAllCSFFiles()` is resolved.
132-
**/
133-
cachedCSFFiles?: Record<string, StorybookStoreItem>;
134-
};
135-
136-
/**
137-
* Storybook Client API store, contains methods to cache CSF files.
138-
*/
139-
export interface StorybookGlobals extends Window {
140-
/**
141-
* Storybook Client API, contains story store and other metadata.
142-
* `storyStore` is used for Storybook 7, `storyStoreValue` for >= 8.
143-
*/
144-
__STORYBOOK_PREVIEW__?: { storyStore: StorybookStoryStore } | { storyStoreValue: StorybookStoryStore };
145-
}

tools/storybook-llms-extractor/src/utils.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { type BrowserContext, type Page, chromium } from 'playwright';
66
import Turndown from 'turndown';
77
import { strikethrough, tables, taskListItems } from 'turndown-plugin-gfm';
88

9-
import type { Args, StorybookComponentProp, StorybookComponent, StorybookStoreItem, StorybookGlobals } from './types';
9+
import type { Args, StorybookComponentProp, StorybookComponent, StorybookStoreItem } from './types';
1010

1111
/**
1212
* Get content type based on file extension
@@ -135,6 +135,32 @@ export async function extractStorybookData({ distPath }: Args): Promise<Storyboo
135135
}
136136
}
137137

138+
/**
139+
* Storybook Client API store, contains methods to cache CSF files and cached items.
140+
*/
141+
type StorybookStoryStore = {
142+
/**
143+
* Caches all CSF files in the Storybook store.
144+
* This method must be called before accessing `cachedCSFFiles`.
145+
*/
146+
cacheAllCSFFiles: () => Promise<void>;
147+
/**
148+
* CSF files become available after `cacheAllCSFFiles()` is resolved.
149+
**/
150+
cachedCSFFiles?: Record<string, StorybookStoreItem>;
151+
};
152+
153+
/**
154+
* Storybook Client API store, contains methods to cache CSF files.
155+
*/
156+
interface StorybookGlobals extends Window {
157+
/**
158+
* Storybook Client API, contains story store and other metadata.
159+
* `storyStore` is used for Storybook 7, `storyStoreValue` for >= 8.
160+
*/
161+
__STORYBOOK_PREVIEW__?: { storyStore: StorybookStoryStore } | { storyStoreValue: StorybookStoryStore };
162+
}
163+
138164
/**
139165
* Extracts all stories from Storybook Client API store.
140166
*/

0 commit comments

Comments
 (0)