Skip to content

Commit 0aedf2c

Browse files
committed
fixup
1 parent d5dfa72 commit 0aedf2c

File tree

4 files changed

+65
-26
lines changed

4 files changed

+65
-26
lines changed

.devops/templates/deployE2E.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ steps:
3838
scriptType: 'bash'
3939
scriptLocation: 'inlineScript'
4040
inlineScript: |
41+
# Upload main files (az storage blob upload-batch skips hidden files by default)
4142
az storage blob upload-batch \
4243
--destination '$web' \
4344
--source apps/pr-deploy-site/dist \
@@ -46,6 +47,21 @@ steps:
4647
--auth-mode login \
4748
--overwrite
4849
50+
# Upload .well-known directories explicitly (for agent skills discovery)
51+
# Note: upload-batch skips hidden files, so we need to upload them separately
52+
find apps/pr-deploy-site/dist -type d -name ".well-known" | while read wellknown_dir; do
53+
relative_path="${wellknown_dir#apps/pr-deploy-site/dist/}"
54+
echo "Uploading hidden directory: $relative_path"
55+
az storage blob upload-batch \
56+
--destination '$web' \
57+
--source "$wellknown_dir" \
58+
--account-name $(azureStorage) \
59+
--destination-path "$(deployBasePath)/${relative_path}" \
60+
--auth-mode login \
61+
--overwrite \
62+
--pattern "*"
63+
done
64+
4965
- task: GithubPRStatus@0
5066
displayName: 'Update PR deploy site github status'
5167
condition: eq(variables.isPR, true)

packages/react-components/react-storybook-addon/src/docs/CopyAsMarkdownButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const STORYBOOK_VARIANT_SUFFIX_PATTERN = /--\w+$/g;
179179

180180
/**
181181
* Gets the base URL for fetching markdown content from the Storybook LLM endpoint.
182-
* Each story's markdown is available at: {BASE_URL}/{storyId}.txt
182+
* Each story's markdown is available at: {BASE_URL}/{storyId}.md
183183
* @param targetWindow - The window object to use for location access
184184
* @returns The base URL constructed from current location origin and pathname
185185
*/
@@ -194,10 +194,10 @@ function getStorybookMarkdownApiBaseUrl(targetWindow: Window): string {
194194
* @param targetWindow - The window object to use for location access
195195
* @param storyId - The Storybook story ID
196196
* @returns The full URL to the markdown endpoint for the story
197-
* @example "button--primary" -> "https://storybooks.fluentui.dev/llms/button.txt"
197+
* @example "button--primary" -> "https://storybooks.fluentui.dev/llms/button.md"
198198
*/
199199
function convertStoryIdToMarkdownUrl(targetWindow: Window, storyId: string): string {
200-
return `${getStorybookMarkdownApiBaseUrl(targetWindow)}${storyId.replace(STORYBOOK_VARIANT_SUFFIX_PATTERN, '.txt')}`;
200+
return `${getStorybookMarkdownApiBaseUrl(targetWindow)}${storyId.replace(STORYBOOK_VARIANT_SUFFIX_PATTERN, '.md')}`;
201201
}
202202

203203
/**

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('generate-llms-docs', () => {
193193
| \`defaultOpenItems\` | \`unknown\` | No | | Default value for the uncontrolled state of the panel. |
194194
| \`collapsible\` | \`boolean\` | No | | Indicates if Accordion support multiple Panels closed at the same time. |
195195
| \`multiple\` | \`boolean\` | No | | Indicates if Accordion support multiple Panels opened at the same time. |
196-
| \`navigation\` | \`\\"linear\\" \\"circular\\"\` | No | | @deprecated Arrow keyboard navigation is not recommended for accordions. Consider using Tree if arrow navigation is a hard requirement. Indicates if keyboard navigation is available and gives two options, linear or circular navigation. |
196+
| \`navigation\` | \`\\"linear\\" \\\\| \\"circular\\"\` | No | | @deprecated Arrow keyboard navigation is not recommended for accordions. Consider using Tree if arrow navigation is a hard requirement. Indicates if keyboard navigation is available and gives two options, linear or circular navigation. |
197197
| \`onToggle\` | \`AccordionToggleEventHandler<unknown>\` | No | | Callback to be called when the opened items change. |
198198
| \`openItems\` | \`unknown\` | No | | Controls the state of the panel. |
199199
| \`ref\` | \`Ref<HTMLDivElement>\` | No | | |
@@ -228,13 +228,13 @@ describe('generate-llms-docs', () => {
228228
229229
| Name | Type | Required | Default | Description |
230230
|------|------|----------|---------|-------------|
231-
| \`button\` | \`NonNullable<WithSlotShorthandValue<ARIAButtonSlotProps<\\"a\\">> | null>\` | No | | The component to be used as button in heading |
232-
| \`expandIcon\` | \`WithSlotShorthandValue<{ as?: \\"span\\"; } & Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, \\"ref\\"> & { ...; }, \\"children\\"> & { ...; }> | null\` | No | | Expand icon slot rendered before (or after) children content in heading. |
233-
| \`icon\` | \`WithSlotShorthandValue<{ as?: \\"div\\"; } & Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, \\"ref\\"> & { ...; }, \\"children\\"> & { ...; }> | null\` | No | | Expand icon slot rendered before (or after) children content in heading. |
234-
| \`as\` | \`\\"div\\" \\"h1\\" \\"h2\\" \\"h3\\" \\"h4\\" \\"h5\\" \\"h6\\"\` | No | | |
235-
| \`expandIconPosition\` | \`\\"start\\" \\"end\\"\` | No | | The position of the expand icon slot in heading. |
231+
| \`button\` | \`NonNullable<WithSlotShorthandValue<ARIAButtonSlotProps<\\"a\\">> \\\\| null>\` | No | | The component to be used as button in heading |
232+
| \`expandIcon\` | \`WithSlotShorthandValue<{ as?: \\"span\\"; } & Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, \\"ref\\"> & { ...; }, \\"children\\"> & { ...; }> \\\\| null\` | No | | Expand icon slot rendered before (or after) children content in heading. |
233+
| \`icon\` | \`WithSlotShorthandValue<{ as?: \\"div\\"; } & Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, \\"ref\\"> & { ...; }, \\"children\\"> & { ...; }> \\\\| null\` | No | | Expand icon slot rendered before (or after) children content in heading. |
234+
| \`as\` | \`\\"div\\" \\\\| \\"h1\\" \\\\| \\"h2\\" \\\\| \\"h3\\" \\\\| \\"h4\\" \\\\| \\"h5\\" \\\\| \\"h6\\"\` | No | | |
235+
| \`expandIconPosition\` | \`\\"start\\" \\\\| \\"end\\"\` | No | | The position of the expand icon slot in heading. |
236236
| \`inline\` | \`boolean\` | No | | Indicates if the AccordionHeader should be rendered inline. |
237-
| \`size\` | \`\\"small\\" \\"medium\\" \\"large\\" \\"extra-large\\"\` | No | | Size of spacing in the heading. |
237+
| \`size\` | \`\\"small\\" \\\\| \\"medium\\" \\\\| \\"large\\" \\\\| \\"extra-large\\"\` | No | | Size of spacing in the heading. |
238238
| \`ref\` | \`Ref<HTMLDivElement>\` | No | | |
239239
240240
@@ -248,7 +248,7 @@ describe('generate-llms-docs', () => {
248248
249249
| Name | Type | Required | Default | Description |
250250
|------|------|----------|---------|-------------|
251-
| \`collapseMotion\` | \`PresenceMotionSlotProps | null\` | No | | |
251+
| \`collapseMotion\` | \`PresenceMotionSlotProps \\\\| null\` | No | | |
252252
| \`as\` | \`\\"div\\"\` | No | | |
253253
| \`ref\` | \`Ref<HTMLDivElement>\` | No | | |
254254
@@ -783,11 +783,17 @@ describe('generate-llms-docs', () => {
783783
784784
Fluent UI React is a library of React components that implement Microsoft's Fluent Design System.
785785
786-
- [Concepts/Introduction](https://react.fluentui.dev/llms/concepts-introduction.txt)
787-
- [Concepts/Developer/Quick Start](https://react.fluentui.dev/llms/concepts-developer-quick-start.txt)
788-
- [Components/Accordion](https://react.fluentui.dev/llms/components-accordion.txt): An accordion allows users to toggle the display of content by expanding or collapsing sections.
786+
## Concepts
789787
790-
## Optional
788+
- [Introduction](https://react.fluentui.dev/llms/concepts-introduction.md)
789+
- [Developer/Quick Start](https://react.fluentui.dev/llms/concepts-developer-quick-start.md)
790+
791+
## Components
792+
793+
- [Accordion](https://react.fluentui.dev/llms/components-accordion.md): An accordion allows users to toggle the display of content by expanding or collapsing sections.
794+
795+
796+
## Additional References
791797
792798
- [Charts v9](https://charts.fluentui.dev/llms.txt)
793799
"
@@ -818,7 +824,7 @@ describe('generate-llms-docs', () => {
818824

819825
describe('generateAgentSkillContent', () => {
820826
it('generates agent skill content', () => {
821-
expect(generateAgentSkillContent(argsWithRefs, storybookStoreItems)).toMatchInlineSnapshot(`
827+
expect(generateAgentSkillContent(argsWithRefs)).toMatchInlineSnapshot(`
822828
"---
823829
name: fluentui-v9-skill
824830
description: Agent skill for Fluent UI React v9 documentation, use it to answer questions about Fluent UI React v9 components and concepts.

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

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,19 +341,34 @@ export function generateSummaryContent(
341341
'',
342342
];
343343

344-
// Adds links to all components/pages
345-
for (const item of data) {
346-
let description = item.meta.parameters?.docs?.description?.component || '';
347-
if (description) {
348-
description = `: ${description.split('\n')[0]}`;
344+
const groupedItems: Record<string, StorybookStoreItem[]> = data.reduce((acc, item) => {
345+
const group = item.meta.title.split('/')[0];
346+
if (!acc[group]) {
347+
acc[group] = [];
349348
}
350-
summary.push(`- [${item.meta.title}](${summaryBaseUrl}/llms/${item.meta.id}.txt)${description}`);
349+
acc[group].push(item);
350+
return acc;
351+
}, {} as Record<string, StorybookStoreItem[]>);
352+
353+
for (const [groupName, items] of Object.entries(groupedItems)) {
354+
summary.push(`## ${groupName}`);
355+
summary.push('');
356+
for (const item of items) {
357+
let description = item.meta.parameters?.docs?.description?.component || '';
358+
if (description) {
359+
description = `: ${description.split('\n')[0]}`;
360+
}
361+
summary.push(
362+
`- [${item.meta.title.replace(`${groupName}/`, '')}](${summaryBaseUrl}/llms/${item.meta.id}.md)${description}`,
363+
);
364+
}
365+
summary.push('');
351366
}
352367

353368
// Adds links to all composed Storybook
354369
if (refs && refs.length > 0) {
355370
summary.push('');
356-
summary.push('## Optional');
371+
summary.push('## Additional References');
357372
summary.push('');
358373
for (const ref of refs) {
359374
summary.push(`- [${ref.title}](${ref.url.replace(/\/$/, '')}/llms.txt)`);
@@ -474,10 +489,10 @@ function stringifyPropType(type: StorybookComponentProp['type']): string {
474489
if (typeof type === 'object' && type !== null && 'name' in type && typeof type.name === 'string') {
475490
// Handle enums, unions, arrays, etc.
476491
if (type.name === 'enum' && Array.isArray(type.value)) {
477-
return type.value.map(v => (typeof v.value === 'string' ? v.value : JSON.stringify(v.value))).join(' ');
492+
return type.value.map(v => (typeof v.value === 'string' ? v.value : JSON.stringify(v.value))).join(' | ');
478493
}
479494
if (type.name === 'union' && Array.isArray(type.value)) {
480-
return type.value.map(v => (typeof v.value === 'string' ? v.value : JSON.stringify(v.value))).join(' ');
495+
return type.value.map(v => (typeof v.value === 'string' ? v.value : JSON.stringify(v.value))).join(' | ');
481496
}
482497
if (type.name === 'array' && type.value) {
483498
return `${stringifyPropType(type.value as StorybookComponentProp['type'])}[]`;
@@ -533,10 +548,12 @@ function generateComponentPropsTable(props: StorybookComponentProp[]): string[]
533548
content.push('| Name | Type | Required | Default | Description |');
534549
content.push('|------|------|----------|---------|-------------|');
535550
for (const prop of props) {
551+
// Escape pipe characters in type to prevent breaking markdown table syntax
552+
const escapedType = stringifyPropType(prop.type).replace(/\|/g, '\\|');
536553
content.push(
537554
`| ${[
538555
`\`${prop.name}\``,
539-
`\`${stringifyPropType(prop.type)}\``,
556+
`\`${escapedType}\``,
540557
prop.required ? 'Yes' : 'No',
541558
prop.defaultValue ?? '',
542559
prop.description?.replace(/\n/g, ' ') ?? '',

0 commit comments

Comments
 (0)