Skip to content

Commit 60b7920

Browse files
committed
feat(docsite): generate llms.txt
1 parent 7e2a57e commit 60b7920

File tree

5 files changed

+57
-30
lines changed

5 files changed

+57
-30
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
- run: yarn nx affected --target=verify-integrity
4343
- run: yarn nx affected --target=build
44-
- run: yarn nx affected --target=build-storybook
44+
- run: yarn nx affected --target=build-storybook,extract-storybook-llms
4545
- run: yarn nx affected --target=type-check
4646
- run: yarn nx affected --target=lint
4747
- run: yarn nx affected --target=test

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ jobs:
4040
node-version: '20'
4141

4242
- run: yarn install --frozen-lockfile
43-
- run: yarn nx run-many --target=build-storybook
43+
- run: npx playwright install --with-deps
44+
- run: yarn nx run-many --target=build-storybook,extract-storybook-llms
4445

4546
- name: Setup Pages
4647
uses: actions/configure-pages@v5

apps/docsite/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
"quiet": true
3535
}
3636
}
37+
},
38+
"extract-storybook-llms": {
39+
"dependsOn": ["build-storybook"],
40+
"executor": "nx:run-commands",
41+
"options": {
42+
"command": "storybook-llms-extractor --distPath dist/storybook/docsite --summaryBaseUrl https://microsoft.github.io/fluentui-contrib/docsite"
43+
}
3744
}
3845
}
3946
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@fluentui/react-migration-v8-v9": "^9.6.23",
3535
"@fluentui/react-shared-contexts": "^9.7.2",
3636
"@fluentui/scheme-utilities": "^8.3.58",
37+
"@fluentui/storybook-llms-extractor": "^0.0.2",
3738
"@griffel/shadow-dom": "~0.2.0",
3839
"@nx/devkit": "21.3.10",
3940
"@nx/eslint": "21.3.10",
@@ -86,6 +87,7 @@
8687
"nx": "21.3.10",
8788
"parsel-js": "^1.1.2",
8889
"patch-package": "^7.0.2",
90+
"playwright": "^1.54.2",
8991
"prettier": "^2.6.2",
9092
"react": "18.3.1",
9193
"react-dom": "18.3.1",

yarn.lock

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,17 @@
28532853
dependencies:
28542854
tslib "^2.1.0"
28552855

2856+
"@fluentui/storybook-llms-extractor@^0.0.2":
2857+
version "0.0.2"
2858+
resolved "https://registry.yarnpkg.com/@fluentui/storybook-llms-extractor/-/storybook-llms-extractor-0.0.2.tgz#b31182fdab862823275e9c444b2be5b154329cb5"
2859+
integrity sha512-FocJtlWkmOOazwrvNGUnQosIJjMC6AAUJ8oAGMqDDAPq0QCrVUw170VaPTOT/8LJxJCPXj8GoKt83RDNX1JFcw==
2860+
dependencies:
2861+
"@swc/helpers" "^0.5.1"
2862+
playwright "^1.49.1"
2863+
turndown "^7.2.0"
2864+
turndown-plugin-gfm "^1.0.2"
2865+
yargs "^17.7.2"
2866+
28562867
"@fluentui/style-utilities@^8.12.2":
28572868
version "8.12.2"
28582869
resolved "https://registry.yarnpkg.com/@fluentui/style-utilities/-/style-utilities-8.12.2.tgz#3a89776953ba4a60048ce6eea5017f05b1cbaad2"
@@ -3339,6 +3350,11 @@
33393350
resolved "https://registry.yarnpkg.com/@microsoft/load-themed-styles/-/load-themed-styles-1.10.295.tgz#d3c8d7ab186f422727ba112d6ebe5fe8e41051d9"
33403351
integrity sha512-W+IzEBw8a6LOOfRJM02dTT7BDZijxm+Z7lhtOAz1+y9vQm1Kdz9jlAO+qCEKsfxtUOmKilW8DIRqFw2aUgKeGg==
33413352

3353+
"@mixmark-io/domino@^2.2.0":
3354+
version "2.2.0"
3355+
resolved "https://registry.yarnpkg.com/@mixmark-io/domino/-/domino-2.2.0.tgz#4e8ec69bf1afeb7a14f0628b7e2c0f35bdb336c3"
3356+
integrity sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==
3357+
33423358
"@modelcontextprotocol/sdk@^1.8.0":
33433359
version "1.11.2"
33443360
resolved "https://registry.yarnpkg.com/@modelcontextprotocol/sdk/-/sdk-1.11.2.tgz#d81784c140d1a9cc937f61af9f071d8b78befe30"
@@ -13671,6 +13687,11 @@ [email protected]:
1367113687
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.49.1.tgz#32c62f046e950f586ff9e35ed490a424f2248015"
1367213688
integrity sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==
1367313689

13690+
13691+
version "1.54.2"
13692+
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.54.2.tgz#73cc5106f19ec6b9371908603d61a7f171ebd8f0"
13693+
integrity sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==
13694+
1367413695
1367513696
version "1.49.1"
1367613697
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.49.1.tgz#830266dbca3008022afa7b4783565db9944ded7c"
@@ -13680,6 +13701,15 @@ [email protected]:
1368013701
optionalDependencies:
1368113702
fsevents "2.3.2"
1368213703

13704+
playwright@^1.49.1, playwright@^1.54.2:
13705+
version "1.54.2"
13706+
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.54.2.tgz#e2435abb2db3a96a276f8acc3ada1a85b587dff3"
13707+
integrity sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==
13708+
dependencies:
13709+
playwright-core "1.54.2"
13710+
optionalDependencies:
13711+
fsevents "2.3.2"
13712+
1368313713
polished@^4.2.2:
1368413714
version "4.2.2"
1368513715
resolved "https://registry.yarnpkg.com/polished/-/polished-4.2.2.tgz#2529bb7c3198945373c52e34618c8fe7b1aa84d1"
@@ -15606,16 +15636,7 @@ string-length@^4.0.2:
1560615636
char-regex "^1.0.2"
1560715637
strip-ansi "^6.0.0"
1560815638

15609-
"string-width-cjs@npm:string-width@^4.2.0":
15610-
version "4.2.3"
15611-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
15612-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
15613-
dependencies:
15614-
emoji-regex "^8.0.0"
15615-
is-fullwidth-code-point "^3.0.0"
15616-
strip-ansi "^6.0.1"
15617-
15618-
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
15639+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1561915640
version "4.2.3"
1562015641
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1562115642
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -15706,14 +15727,7 @@ string_decoder@~1.1.1:
1570615727
dependencies:
1570715728
safe-buffer "~5.1.0"
1570815729

15709-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
15710-
version "6.0.1"
15711-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
15712-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
15713-
dependencies:
15714-
ansi-regex "^5.0.1"
15715-
15716-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
15730+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1571715731
version "6.0.1"
1571815732
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1571915733
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -16301,6 +16315,18 @@ tunnel-agent@^0.6.0:
1630116315
dependencies:
1630216316
safe-buffer "^5.0.1"
1630316317

16318+
turndown-plugin-gfm@^1.0.2:
16319+
version "1.0.2"
16320+
resolved "https://registry.yarnpkg.com/turndown-plugin-gfm/-/turndown-plugin-gfm-1.0.2.tgz#6f8678a361f35220b2bdf5619e6049add75bf1c7"
16321+
integrity sha512-vwz9tfvF7XN/jE0dGoBei3FXWuvll78ohzCZQuOb+ZjWrs3a0XhQVomJEb2Qh4VHTPNRO4GPZh0V7VRbiWwkRg==
16322+
16323+
turndown@^7.2.0:
16324+
version "7.2.0"
16325+
resolved "https://registry.yarnpkg.com/turndown/-/turndown-7.2.0.tgz#67d614fe8371fb511079a93345abfd156c0ffcf4"
16326+
integrity sha512-eCZGBN4nNNqM9Owkv9HAtWRYfLA4h909E/WGAWWBpmB275ehNhZyk87/Tpvjbp0jjNl9XwCsbe6bm6CqFsgD+A==
16327+
dependencies:
16328+
"@mixmark-io/domino" "^2.2.0"
16329+
1630416330
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
1630516331
version "0.14.5"
1630616332
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
@@ -17128,16 +17154,7 @@ workspace-tools@^0.34.2:
1712817154
js-yaml "^4.1.0"
1712917155
micromatch "^4.0.0"
1713017156

17131-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
17132-
version "7.0.0"
17133-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
17134-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
17135-
dependencies:
17136-
ansi-styles "^4.0.0"
17137-
string-width "^4.1.0"
17138-
strip-ansi "^6.0.0"
17139-
17140-
wrap-ansi@^7.0.0:
17157+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
1714117158
version "7.0.0"
1714217159
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1714317160
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)