Skip to content

fix(cli): a {@link} in a template description resolves as astryx docs resolves it - #12224

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/template-doc-links
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/template-doc-links

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A template's description can link to a doc with {@link …}, the same way a component's or a topic's text does. astryx template, astryx build, astryx search and astryx component <Name> --blocks printed the link as written, in text and in --json, so a reader saw {@link @astryxdesign/cli:generic:theme} instead of the command that opens the doc.

Problem and solution fit

  • Why it happens: component docs and topics resolve their links when the API reads them, against the docs of the package that wrote them. Template descriptions never went through that pass.
  • Why it matters: no output may show token syntax; JSON readers get the bare command, and text readers the command with the project's command (fix(cli): component docs print their commands with the project's runner in text #12212, fix(cli): template docs never print a raw {@command} or {@pm} token; build and search text show doc commands with the project's command #12214).
  • Fix: one pass, reusing the code astryx docs and astryx component resolve links with (linkComponentDoc and componentLinkProvider in the docs adapter):
    • ownedDocLinker(cwd) (docs adapter) owns the catalog load, the provider map and the guarded link pass that astryx component used on its own: it resolves a doc's links against the docs of the package that wrote it, a Core item's against the CLI's own, and renders its doc tokens in the same pass, so an escaped token stays written. An owner that names no provider renders its tokens and leaves its links as written. linkComponentResponse now calls it, and linkOwnedTexts(items, cwd) reads text fields through it, loading the docs catalog only when a text links.
    • astryx template (list, --skeleton, a template read) runs its response through it (linkTemplateDescriptions, template adapter). The leaves go back to the authored text, so nothing renders twice.
    • astryx build resolves every template description through it when it loads templates.
    • astryx component <Name> --blocks resolves each block's description through it (linkBlockDescriptions, component adapter); the leaf goes back to the authored text.
    • astryx search resolves template results in linkSearchResponse, the pass that already resolves component results, and search indexes keep the shown text beside the scored one for templates as they do for components, and rankSearchIndex applies it to template results too.
    • Text views show the resolved command with the project's command through docText (fix(cli): template docs never print a raw {@command} or {@pm} token; build and search text show doc commands with the project's command #12214).

Expected behavior and authority

  • spec:AST-047 FR9: a read resolves each {@link <target>} to the command that opens its doc, in text and JSON.
  • spec:AST-081 FR5: every printed command starts with the command name the picker chooses.

Smallest restoration

  • api/docs/_adapter.mjs: linkOwnedTexts.
  • api/template/_adapter.mjs + template.mjs: linkTemplateDescriptions around list, show and skeleton; the leaves stop rendering on their own.
  • api/build/_adapter.mjs, api/component/_adapter.mjs (linkSearchResponse, linkBlockDescriptions) + component.mjs, api/component/detail/blocks/blocks.mjs, api/search/search-index.mjs, api/search/_gather-templates.mjs.
  • No new option, no JSON shape change, no change to template sources.

Evidence

  • Reproduction before the change: in a project whose integration declares cliCommand: 'acme astryx' and ships a template whose description is "theme it as {@link @astryxdesign/cli:generic:theme} says", the four surfaces printed the raw link in text and JSON.
  • Result after the change: text prints `acme astryx docs theme`, JSON `astryx docs theme`, no output contains {@link.
  • Representative unchanged path: template sources print byte for byte; {@command} descriptions render as in fix(cli): template docs never print a raw {@command} or {@pm} token; build and search text show doc commands with the project's command #12214; a link that names no doc prints as written, as in astryx docs.
  • Regression tests: search-index.test.mjs adds a template with a {@command} and a {@link} to its fixture integration, to the "answers as search() does" queries, and to one case that checks the printed description (all three fail without the rankSearchIndex change). Four new cases in packages/cli/clients/cli/commands/template-doc-tokens.test.mjs (template list and skeleton, build, search, component --blocks), each failing on the base.

Scope

Not in this change: doctor does not yet warn about a template description link that names no doc.

Components: CLI template, build, search, docs adapter

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli
  • pnpm check:repo, pnpm -F @astryxdesign/cli typecheck:strict, node scripts/check-cli-structure.mjs, ESLint and Prettier on the changed files.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 6:24pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 6:27 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@josephfarina
josephfarina force-pushed the josephfarina/template-doc-tokens branch from eac553a to 345c3e6 Compare November 17, 2026 04:21

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the four commands now resolve template description links, but the search index path regressed and the new link pass duplicates an existing one.

  • rankSearchIndex() ignores the shown text this change stores on template candidates, because withDisplayDescriptions in packages/cli/api/search/search-index.mjs applies it only to components, so template results now carry raw {@command …} and {@link …} tokens where the base rendered {@command}, which also makes the description's claims about search indexes and command-token rendering false.
  • linkOwnedTexts in packages/cli/api/docs/_adapter.mjs repeats the catalog load, provider map and guarded linkComponentDoc call that linkComponentResponse in packages/cli/api/component/_adapter.mjs already owns, and the two already differ when the owner is not a provider id, so please move that logic into one helper that both call.

A template case with a token in the "answers as search() does" tests in search-index.test.mjs would lock in the first fix. As a follow-up, doctor does not yet warn on a template description link that names no doc.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: a link in a template's description no longer prints as written in template list, skeleton and read, build, search and component --blocks. Verified: four new cases in template-doc-tokens.test.mjs; the template read checked by hand in JSON.
  • Changeset: text shows the project's command, JSON the bare command. Verified: the new cases assert both.
  • Changeset: the JSON shape does not change. Verified: description stays a string in every response.
  • Description: the four surfaces printed the raw link before. Verified: the new cases fail on the base.
  • Description: the new helper resolves against the owning package's docs (Core's against the CLI's), renders tokens in the same pass, keeps an escaped token written, and loads the docs catalog only when a text links. Verified: packages/cli/api/docs/_adapter.mjs:407-440; an escaped token checked by hand.
  • Description: template list, skeleton and read go through the new wrapper and the leaves return the authored text. Verified: packages/cli/api/template/template.mjs:195, 269, 276.
  • Description: build resolves every template description when it loads templates. Verified: packages/cli/api/build/_adapter.mjs:113-119.
  • Description: component --blocks resolves each block description. Verified: packages/cli/api/component/component.mjs:475, 525, 658.
  • Description: search resolves template results in the existing search pass. Verified: packages/cli/api/component/_adapter.mjs:835-851.
  • Description: search indexes keep the shown text beside the scored one for templates as they do for components. False: the index stores it, but rankSearchIndex() applies it only to components (packages/cli/api/search/search-index.mjs:259-284).
  • Description: text views show the project's command. Verified: the new cases assert it.
  • Description: no new option, no JSON shape change, no change to template sources. Verified: no option or command doc changed; the existing byte-for-byte source case passes.
  • Description: command-token descriptions render as in the base pull request. False for rankSearchIndex(): it renders them on the base and returns them raw on the head.
  • Description: a link that names no doc prints as written. Verified by hand.
  • Description: four new test cases, each failing on the base. Verified: 4 fail on the base, 10 of 10 pass on the head.
  • Description: the full CLI suite, repository checks, strict typecheck, structure check, lint and format pass. Not verified: no CI ran at this head; 20 related CLI test files (591 tests) pass in this review.
  • .changeset/template-doc-links.md: clear
  • packages/cli/api/build/_adapter.mjs: clear
  • packages/cli/api/component/_adapter.mjs: finding (one search response now links through two copies of the link loop)
  • packages/cli/api/component/component.mjs: clear
  • packages/cli/api/component/detail/blocks/blocks.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: finding (linkOwnedTexts copies the link loop of linkComponentResponse)
  • packages/cli/api/search/_gather-templates.mjs: finding (rendering removed; rankSearchIndex() not updated)
  • packages/cli/api/search/search-index.mjs: finding (template display text stored but never applied)
  • packages/cli/api/template/_adapter.mjs: clear
  • packages/cli/api/template/list/list.mjs: clear
  • packages/cli/api/template/show/show.mjs: clear
  • packages/cli/api/template/skeleton/skeleton.mjs: clear
  • packages/cli/api/template/template.mjs: clear
  • packages/cli/clients/cli/commands/template-doc-tokens.test.mjs: clear (no case for rankSearchIndex() or a template read)

Automated review (maintainer link)

Comment thread packages/cli/api/docs/_adapter.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/template-doc-links branch from ae46ee0 to afbb893 Compare November 17, 2026 04:31

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the four commands now resolve template description links, but the search index path regressed and the new link pass duplicates an existing one.

  • rankSearchIndex() ignores the shown text this change stores on template candidates, because withDisplayDescriptions in packages/cli/api/search/search-index.mjs applies it only to components, so template results now carry raw {@command …} and {@link …} tokens where the base rendered {@command}, which also makes the description's claims about search indexes and command-token rendering false.
  • linkOwnedTexts in packages/cli/api/docs/_adapter.mjs repeats the catalog load, provider map and guarded linkComponentDoc call that linkComponentResponse in packages/cli/api/component/_adapter.mjs already owns, and the two already differ when the owner is not a provider id, so please move that logic into one helper that both call.

A template case with a token in the "answers as search() does" tests in search-index.test.mjs would lock in the first fix. As a follow-up, doctor does not yet warn on a template description link that names no doc.

Claims and files checked

Review mode: carry-forward; reason: none

  • Changeset: a link in a template's description no longer prints as written in template list, skeleton and read, build, search and component --blocks. Verified: four new cases in template-doc-tokens.test.mjs; the template read checked by hand in JSON.
  • Changeset: text shows the project's command, JSON the bare command. Verified: the new cases assert both.
  • Changeset: the JSON shape does not change. Verified: description stays a string in every response.
  • Description: the four surfaces printed the raw link before. Verified: the new cases fail on the base.
  • Description: the new helper resolves against the owning package's docs (Core's against the CLI's), renders tokens in the same pass, keeps an escaped token written, and loads the docs catalog only when a text links. Verified: packages/cli/api/docs/_adapter.mjs:407-440; an escaped token checked by hand.
  • Description: template list, skeleton and read go through the new wrapper and the leaves return the authored text. Verified: packages/cli/api/template/template.mjs:195, 269, 276.
  • Description: build resolves every template description when it loads templates. Verified: packages/cli/api/build/_adapter.mjs:113-119.
  • Description: component --blocks resolves each block description. Verified: packages/cli/api/component/component.mjs:475, 525, 658.
  • Description: search resolves template results in the existing search pass. Verified: packages/cli/api/component/_adapter.mjs:835-851.
  • Description: search indexes keep the shown text beside the scored one for templates as they do for components. False: the index stores it, but rankSearchIndex() applies it only to components (packages/cli/api/search/search-index.mjs:259-284).
  • Description: text views show the project's command. Verified: the new cases assert it.
  • Description: no new option, no JSON shape change, no change to template sources. Verified: no option or command doc changed; the existing byte-for-byte source case passes.
  • Description: command-token descriptions render as in the base pull request. False for rankSearchIndex(): it renders them on the base and returns them raw on the head.
  • Description: a link that names no doc prints as written. Verified by hand.
  • Description: four new test cases, each failing on the base. Verified: 4 fail on the base, 10 of 10 pass on the head.
  • Description: the full CLI suite, repository checks, strict typecheck, structure check, lint and format pass. Not verified: no CI has run at this head; 20 related CLI test files (591 tests) passed on the same patch before the rebase.
  • .changeset/template-doc-links.md: clear
  • packages/cli/api/build/_adapter.mjs: clear
  • packages/cli/api/component/_adapter.mjs: finding (one search response now links through two copies of the link loop)
  • packages/cli/api/component/component.mjs: clear
  • packages/cli/api/component/detail/blocks/blocks.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: finding (linkOwnedTexts copies the link loop of linkComponentResponse)
  • packages/cli/api/search/_gather-templates.mjs: finding (rendering removed; rankSearchIndex() not updated)
  • packages/cli/api/search/search-index.mjs: finding (template display text stored but never applied)
  • packages/cli/api/template/_adapter.mjs: clear
  • packages/cli/api/template/list/list.mjs: clear
  • packages/cli/api/template/show/show.mjs: clear
  • packages/cli/api/template/skeleton/skeleton.mjs: clear
  • packages/cli/api/template/template.mjs: clear
  • packages/cli/clients/cli/commands/template-doc-tokens.test.mjs: clear (no case for rankSearchIndex() or a template read)

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the test and lint workflows have not run on this head yet, because this pull request targets the #12214 branch; they run once it targets main.

The template, build, search and component-blocks outputs now print a linked doc's command, and both earlier findings are fixed: rankSearchIndex() returns the same template descriptions as search(), and component reads and template descriptions share one link helper. Two optional follow-ups: the DISPLAY_FIELD comment in packages/cli/api/search/search-index.mjs still describes component candidates only, and doctor does not yet warn on a template description link that names no doc.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules since the last review (0): none
  • Changeset: a link in a template's description no longer prints as written in the template list, skeleton and read, build, search and component blocks. Verified: four new cases in template-doc-tokens.test.mjs fail on the base and pass on the head; the template read was checked by a probe.
  • Changeset: text shows the project's command, JSON the bare command, and the JSON shape does not change. Verified: the new cases assert both; description stays a string in every response.
  • Description: the four surfaces printed the raw link before, in text and JSON. Verified: the four new cases fail on the base.
  • Description: component docs and topics resolve links on read, template descriptions never did. Verified: on the base the template leaves only call renderTokens.
  • Description: the shared linker owns the catalog load, provider map and guarded link pass, resolves against the writing package's docs (Core's against the CLI's), renders tokens in the same pass so an escaped token stays written, and an owner with no provider renders tokens and leaves links as written. Verified: packages/cli/api/docs/_adapter.mjs:407-431; the escaped token was checked by a probe.
  • Description: component reads call the shared linker, and the text helper loads the docs catalog only when a text links. Verified: packages/cli/api/component/_adapter.mjs:928 and packages/cli/api/docs/_adapter.mjs:440-455.
  • Description: the template list, skeleton and read go through the new wrapper and the leaves return the authored text. Verified: packages/cli/api/template/template.mjs:213, 287, 294; list.mjs:53, show.mjs:57, skeleton.mjs:260.
  • Description: build resolves every template description when it loads templates. Verified: packages/cli/api/build/_adapter.mjs:113-119.
  • Description: component blocks resolve each block description and the leaf returns the authored text. Verified: packages/cli/api/component/component.mjs:475, 525, 658 and blocks.mjs:29.
  • Description: search resolves template results in its existing link pass. Verified: packages/cli/api/component/_adapter.mjs:816-863.
  • Description: search indexes keep the shown text beside the scored one for templates, and the index ranker applies it to template results. Verified: packages/cli/api/search/search-index.mjs:123-150 and 259-291, with tests.
  • Description: text views show the resolved command with the project's command. Verified: the new cases assert it.
  • Description: the cited navigable-output requirement governs the change. Not authority: that record is a draft; the current CLI-surface and global-mode records settle every delta.
  • Description: no new option, no JSON shape change and no change to template sources. Verified: no command doc or option changed; the byte-for-byte source case passes.
  • Description: with an integration that declares its own command, text prints that command, JSON the bare one, and no output keeps a raw link. Verified: the new cases.
  • Description: template sources, command tokens and a link that names no doc behave as before. Verified: the existing source and command-token cases pass; a link to a missing doc prints as written in a probe.
  • Description: the search-index fixture, parity queries and printed-description case all fail without the ranker change. Verified: exactly those three fail with the earlier search-index.mjs.
  • Description: the four new command cases each fail on the base. Verified.
  • Description: doctor does not yet warn on a template link that names no doc. Verified: no doctor check reads template descriptions.
  • Description: the CLI suite, repository checks, strict typecheck, structure check, ESLint and Prettier were run. Partly verified: 143 related CLI test files, ESLint, the structure check and the changeset check pass; the strict typecheck reports only two unbuilt-theme errors that the base shares; the full suite and the full repository check were not rerun, and no CI has run at this head.
  • .changeset/template-doc-links.md: clear
  • packages/cli/api/build/_adapter.mjs: clear
  • packages/cli/api/component/_adapter.mjs: clear (the link loop now lives only in the shared linker)
  • packages/cli/api/component/component.mjs: clear
  • packages/cli/api/component/detail/blocks/blocks.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/search/_gather-templates.mjs: clear
  • packages/cli/api/search/search-index.mjs: clear (non-blocking: the DISPLAY_FIELD comment still names only component candidates)
  • packages/cli/api/search/search-index.test.mjs: clear
  • packages/cli/api/template/_adapter.mjs: clear
  • packages/cli/api/template/list/list.mjs: clear
  • packages/cli/api/template/show/show.mjs: clear
  • packages/cli/api/template/skeleton/skeleton.mjs: clear
  • packages/cli/api/template/template.mjs: clear
  • packages/cli/clients/cli/commands/template-doc-tokens.test.mjs: clear

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/template-doc-links branch from edce5c9 to 29e64a6 Compare November 17, 2026 08:19
@josephfarina
josephfarina changed the base branch from josephfarina/template-doc-tokens to main November 17, 2026 08:19

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI and Lint have not run on this head yet. It was pushed while the pull request still targeted the #12214 branch, and moving the base to main does not start them; the next push, or closing and reopening the pull request, does.

The template, build, search and component-blocks outputs now print a linked doc's command, rankSearchIndex() returns the same template descriptions as search(), and component reads and template descriptions share one link helper. One optional follow-up: the DISPLAY_FIELD comment in packages/cli/api/search/search-index.mjs still describes component candidates only.

Claims and files checked

Review mode: full; reason: rebase

  • Changeset: a link in a template's description no longer prints as written in the template list, skeleton and read, build, search and component blocks. Verified: the four new cases in template-doc-tokens.test.mjs fail at the merge base and pass on the head; a template read in JSON was checked separately.
  • Changeset: text shows the project's command, JSON the bare command, and the JSON shape does not change. Verified: the new cases assert both; description stays a string in every response.
  • Description: the four surfaces printed the raw link before, in text and JSON. Verified: the four new cases fail at the merge base.
  • Description: component docs and topics resolve links on read, and template descriptions never did. Verified: at the merge base the template leaves only render tokens.
  • Description: the fix reuses the link functions the docs and component reads already use. Verified: packages/cli/api/docs/_adapter.mjs:423 and :429.
  • Description checklist: no new public API, visual change, default or interaction model, and no internal context. Verified: no export, command or option changes, nothing renders differently in a browser, and none of the added lines, the title, the body or the commit message carries internal context.
  • Description: the shared linker owns the catalog load, the provider map and the guarded link pass, resolves against the writing package's docs (Core's against the CLI's), renders tokens in the same pass so an escaped token stays written, and an owner with no provider renders tokens and leaves links as written. Verified: packages/cli/api/docs/_adapter.mjs:407-431; the escaped token was checked separately.
  • Description: component reads call the shared linker, and the text helper loads the docs catalog only when a text links. Verified: packages/cli/api/component/_adapter.mjs:928 and packages/cli/api/docs/_adapter.mjs:440-455.
  • Description: the template list, skeleton and read go through the new wrapper, and the leaves return the authored text. Verified: packages/cli/api/template/template.mjs:213, :287, :294; list.mjs:53, show.mjs:57, skeleton.mjs:260.
  • Description: build resolves every template description when it loads templates. Verified: packages/cli/api/build/_adapter.mjs:113-119.
  • Description: component blocks resolve each block description, and the leaf returns the authored text. Verified: packages/cli/api/component/component.mjs:475, :525, :658 and blocks.mjs:29.
  • Description: search resolves template results in its existing link pass. Verified: packages/cli/api/component/_adapter.mjs:816-864.
  • Description: search indexes keep the shown text beside the scored one for templates, and the index ranker applies it to template results. Verified: packages/cli/api/search/search-index.mjs:123-150 and :259-290, with tests.
  • Description: text views show the resolved command with the project's command. Verified: the new cases assert it.
  • Description: the cited navigable-output requirement governs the change. Not authority: that record is a draft; the current CLI-surface and global-mode records settle every delta.
  • Description: no new option, no JSON shape change and no change to template sources. Verified: no command doc or option changed; the byte-for-byte source case passes.
  • Description: with an integration that declares its own command, text prints that command, JSON the bare one, and no output keeps a raw link. Verified: the new cases.
  • Description: template sources, command tokens and a link that names no doc behave as before. Verified: the existing source and command-token cases pass; a link to a missing doc prints as written.
  • Description: the search-index fixture, parity queries and printed-description case all fail without the ranker change. Verified: exactly those three fail with the earlier search-index.mjs.
  • Description: the four new command cases each fail on the base. Verified.
  • Description: doctor does not yet warn on a template link that names no doc. Verified: no doctor check reads template descriptions.
  • Description: the CLI suite, repository checks, strict typecheck, structure check, ESLint and Prettier were run. Partly verified: 179 related CLI test files, ESLint and the structure check pass; Prettier flags only untouched, pre-existing lines in blocks.mjs, as it does at the merge base; the strict typecheck reports only two unbuilt-theme errors that the merge base shares; the full suite and the full repository check were not rerun.
  • .changeset/template-doc-links.md: clear
  • packages/cli/api/build/_adapter.mjs: clear
  • packages/cli/api/component/_adapter.mjs: clear (the link loop now lives only in the shared linker)
  • packages/cli/api/component/component.mjs: clear
  • packages/cli/api/component/detail/blocks/blocks.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/search/_gather-templates.mjs: clear
  • packages/cli/api/search/search-index.mjs: clear (non-blocking: the DISPLAY_FIELD comment still names only component candidates)
  • packages/cli/api/search/search-index.test.mjs: clear
  • packages/cli/api/template/_adapter.mjs: clear
  • packages/cli/api/template/list/list.mjs: clear
  • packages/cli/api/template/show/show.mjs: clear
  • packages/cli/api/template/skeleton/skeleton.mjs: clear
  • packages/cli/api/template/template.mjs: clear
  • packages/cli/clients/cli/commands/template-doc-tokens.test.mjs: clear

Automated review (maintainer link)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ce0fec9

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.50 MB packed (+2.0 kB); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

… resolves it

Template, build, search and component --blocks printed a template
description's {@link} as written. ownedDocLinker owns the catalog load,
provider map and guarded link pass that component reads already used;
linkOwnedTexts reads packages' doc text through it, resolving links against
the docs of the package that wrote them and rendering doc tokens in the same
pass. Template reads, component --blocks, build's template load and search's
link pass run descriptions through it, and stored search indexes keep the
shown text for templates as for components. JSON carries the bare command;
text shows it with the project's command.
@josephfarina
josephfarina force-pushed the josephfarina/template-doc-links branch from 29e64a6 to ce0fec9 Compare November 18, 2026 18:10
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec ce0fec9

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI is still running on this head.

The template list, skeleton and read, build, search and component --blocks outputs now print a linked doc's command, the stored search index returns the same template text as live search, and component reads share the one link helper. The rebase keeps the template read's component list from main inside the new link pass. One optional follow-up: the DISPLAY_FIELD comment in packages/cli/api/search/search-index.mjs still describes component candidates only.

Claims and files checked

Review mode: full; reason: rebase

  • Changeset: a link in a template's description no longer prints as written. Verified: the four new cases in template-doc-tokens.test.mjs fail on the base and pass on the head.
  • Changeset: the template list, skeleton and read, build, search and component blocks resolve it to the command that opens the linked doc. Verified: the new cases; the template read was checked separately in JSON.
  • Changeset: text shows the project's command and JSON the bare command. Verified: the new cases assert both.
  • Changeset: the JSON shape does not change. Verified: description stays a string in every response.
  • Description: the four surfaces printed the raw link before, in text and JSON. Verified: the four new cases fail on the base.
  • Description: component docs and topics resolve links on read, and template descriptions never did. Verified: on the base the template, block, build and search leaves only render tokens.
  • Description: no output may show token syntax; JSON gets the bare command and text the project's command. Verified: the new cases.
  • Description: the fix reuses the link code the docs and component reads use. Verified: packages/cli/api/docs/_adapter.mjs:423 and :429.
  • Description: the shared linker owns the catalog load, the provider map and the guarded link pass, resolves against the writing package's docs (Core's against the CLI's), renders tokens in the same pass so an escaped token stays written, and an owner with no provider renders tokens and leaves links as written. Verified: packages/cli/api/docs/_adapter.mjs:407-431; a relative link to an integration's own doc and an escaped link were checked separately.
  • Description: component reads call the shared linker, and the text helper loads the docs catalog only when a text links. Verified: packages/cli/api/component/_adapter.mjs:928 and packages/cli/api/docs/_adapter.mjs:441-444.
  • Description: the template list, skeleton and read go through the new wrapper, and the leaves return the authored text. Verified: packages/cli/api/template/template.mjs:214, :288, :300; list.mjs:53, show.mjs:66, skeleton.mjs:260.
  • Description: build resolves every template description when it loads templates. Verified: packages/cli/api/build/_adapter.mjs:131-137.
  • Description: component blocks resolve each block description, and the leaf returns the authored text. Verified: packages/cli/api/component/component.mjs:475, :525, :658 and blocks.mjs:29.
  • Description: search resolves template results in its existing link pass. Verified: packages/cli/api/component/_adapter.mjs:830-847.
  • Description: search indexes keep the shown text beside the scored one for templates, and the index ranker applies it to template results. Verified: packages/cli/api/search/search-index.mjs:123-150 and :262-294, with tests.
  • Description: text views show the resolved command with the project's command. Verified: the new cases.
  • Description: the cited navigable-output requirement governs the change. Not authority: that record is a draft; the current CLI-surface and global-mode records settle every delta.
  • Description: every printed command starts with the picked command name. Verified against the current global-mode record by the new cases.
  • Description: no new option, no JSON shape change and no change to template sources. Verified: no command doc or option changed; the byte-for-byte source case passes.
  • Description: with an integration that declares its own command, text prints that command, JSON the bare one, and no output keeps a raw link. Verified: the new cases.
  • Description: template sources, command tokens and a link that names no doc behave as before. Verified: the existing source and command-token cases pass; a link to a missing doc prints as written.
  • Description: the search-index fixture, parity queries and printed-description case all fail without the ranker change. Verified: exactly those three fail with the base's search-index.mjs.
  • Description: the four new command cases each fail on the base. Verified.
  • Description: doctor does not yet warn on a template link that names no doc. Verified: no doctor check reads template descriptions.
  • Description checklist: one defect restored, no tagalongs, no new public API, visual change, default or interaction model, and no internal context. Verified.
  • Description: the CLI suite, repository checks, strict typecheck, structure check, ESLint and Prettier were run. Partly verified: 197 related CLI test files pass and Lint passed in CI on this head; the full suite and the other checks are still running in CI.
  • .changeset/template-doc-links.md: clear
  • packages/cli/api/build/_adapter.mjs: clear
  • packages/cli/api/component/_adapter.mjs: clear
  • packages/cli/api/component/component.mjs: clear
  • packages/cli/api/component/detail/blocks/blocks.mjs: clear
  • packages/cli/api/docs/_adapter.mjs: clear
  • packages/cli/api/search/_gather-templates.mjs: clear
  • packages/cli/api/search/search-index.mjs: clear (non-blocking: the DISPLAY_FIELD comment names only component candidates)
  • packages/cli/api/search/search-index.test.mjs: clear
  • packages/cli/api/template/_adapter.mjs: clear
  • packages/cli/api/template/list/list.mjs: clear
  • packages/cli/api/template/show/show.mjs: clear
  • packages/cli/api/template/skeleton/skeleton.mjs: clear
  • packages/cli/api/template/template.mjs: clear (keeps the template read's component list from main)
  • packages/cli/clients/cli/commands/template-doc-tokens.test.mjs: clear

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12635 fix(cli): export loads and gives back a page whose modules import TypeScript files by .js names
  Author: @josephfarina
- #12727 fix(cli): export loads a served package's subpath exported only to imports
  Author: @josephfarina
- #12224 fix(cli): a {@link} in a template description resolves as astryx docs resolves it
  Author: @josephfarina
- #12278 fix(core): a Theme given a value that is not a theme keeps the page running
  Author: @josephfarina
- #12751 feat(Layout): LayoutContent names its container, so a theme styles a dialog's body apart from its header and footer
  Author: @josephfarina
- #12168 fix(templates): header, footer and toolbar rows wrap for longer translated labels
  Author: @josephfarina
- #12399 [experimental] export: the dropped-text warning checks Core's docs, and text not drawn yet inside Core components that take children no longer warns
  Author: @josephfarina
- #12541 [docs] Core: list the props ComplexSelector, Selector, Toast and ContextMenuItem take
  Author: @josephfarina
- #12676 docs(cli): a short form keeps its own 640 column inside a wide template frame
  Author: @josephfarina
- #12458 fix(core): Field labels use the primary text colour
  Author: @josephfarina
- #12373 [experimental] export: a link to a place in the page stays in the file in a srcdoc viewer frame
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12827.

@github-actions
github-actions Bot deleted the josephfarina/template-doc-links branch November 20, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — ce0fec9d Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant