Repository navigation
feat(docs): generate llms.txt and per-component LLM docs, publish to GitHub Pages - #3308
Draft
interactivellama wants to merge 8 commits into
Draft
interactivellama wants to merge 8 commits into
interactivellama wants to merge 8 commits into
Conversation
This was referenced Nov 13, 2026
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 15, 2026 21:48
8a2787f to
cada860
Compare
4 of 15 tasks
interactivellama
changed the base branch from
master
to
feat/v11-llm-3-prop-jsdoc
November 15, 2026 21:50
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 18, 2026 23:29
8161494 to
4cf8e32
Compare
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 19, 2026 04:41
4cf8e32 to
3cfde04
Compare
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 19, 2026 22:07
3cfde04 to
46dd41e
Compare
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 20, 2026 00:14
46dd41e to
4400b67
Compare
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
4 times, most recently
from
November 20, 2026 23:51
e17f66e to
94edc5b
Compare
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 23, 2026 07:59
94edc5b to
3a79dd8
Compare
scripts/generate-llm-docs.ts reads the emitted dist/types with the TypeScript compiler API and writes dist/llms/: llms.txt (llmstxt.org index), llms-full.txt (every component file), and components/<name>.md with the description, import lines, a props table (required, literal union values, @deprecated with its replacement), the referenced types, and up to three examples copied verbatim from site-stories. Public components are the package-root default exports, grouped by component directory; utilities/, private/ and directories without a component.json are skipped.
npm run build now runs build:llm-docs after build:types, so the published package has dist/llms/llms.txt for agents working offline in a consumer repo (node_modules/@salesforce/design-system-react/dist/llms/llms.txt).
Emits the declarations into a temp directory and runs the generator on them, since test:ci runs tests before build. Asserts that every public component has a file, required props are marked, @deprecated props show their replacement, and examples are copied verbatim.
On push to master and on release, build the library (which emits dist/llms) and Storybook, copy dist/llms to the site root so llms.txt is served at /llms.txt, and deploy to GitHub Pages. DNS for react.lightningdesignsystem.com is unchanged.
README gets a Documentation section (hosted Storybook, llms.txt, and the bundled dist/llms/llms.txt for agents). CHANGELOG Added line. ROADMAP: the hosted-docs workflow is done; enabling Pages and DNS for react.lightningdesignsystem.com stay open for a maintainer.
The 0.10.x docgen output was only read by the llm-docs generator, as a fallback description. Nothing regenerates it, so it had drifted from the components. The generator now falls back to the component's JSDoc in its source file, which tsc drops from the .d.ts when the component assigns displayName.
master converted components/index.js to TypeScript, so the llm-docs test failed with ENOENT reading the old path.
interactivellama
force-pushed
the
feat/v11-llm-1-llm-docs
branch
from
November 24, 2026 00:04
3a79dd8 to
9f9572f
Compare
8 of 15 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v11 docs stack (2 of 3, stack #3316). Base: #3314. Merge last: this stack merges after the clean CI and GA requirements stacks, so it documents the final API.
Additional description
Generates docs an LLM agent can fetch, straight from the generated
.d.ts, so they can't drift from the types:scripts/generate-llm-docs.tsuses the TypeScript compiler API ondist/typesand writesdist/llms/:llms.txt: an index with install and import lines and a link per componentcomponents/<name>.mdper public component: a props table (type, required, default,@deprecatedreplacement), the exported types a prop references, and thecomponent.jsonsite-stories examples verbatimllms-full.txt: every component file in one documentnpm run buildruns it (build:llm-docs, afterbuild:types), sodist/llmsships in the npm package. It is not committed.scripts/__tests__/generate-llm-docs.test.mjsemits its own declarations and checks that output covers every public component, required and deprecated props, literal unions, union props types (Button) and examples..github/workflows/docs-site.ymlpublishes Storybook to GitHub Pages withdist/llmsat the site root, on push to master and on a published release.Also deletes
components/component-docs.json, the 0.10.x docgen output. Only this generator read it (as a fallback description), and nothing regenerates it. Wheretscdrops a component's JSDoc from the.d.ts(components that assigndisplayName), the generator now reads the JSDoc from the component's source file instead.Comboboxgets a JSDoc summary, since it had none.Decisions:
https://salesforce.github.io/design-system-react/.@types/react(HTML pass-through) get a one-line summary instead of table rows.llms-full.txtincludes the examples, since examples are what an agent copies.Maintainer tasks (not done in this PR):
react.lightningdesignsystem.comat the Pages site (DNS and the redirect).Known gaps, not fixed here:
panel/component.jsonlists threesite-storiesthat were deleted in the rewrite. The generator warns and skips them, so Panel has no examples.SimpleDataTableInteractiveLinkis typedanyin the.d.ts, so its section says its props are untyped.CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.npm run typecheckis clean (tsc --noEmit).npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff.npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).content/visualPickerFigure, render props likerenderItem,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__..d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.