Skip to content

feat(cli): component --props shows the types its props name - #12326

Draft
cixzhang wants to merge 5 commits into
mainfrom
lane4/component-props-inline-types
Draft

cixzhang wants to merge 5 commits into
mainfrom
lane4/component-props-inline-types

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

astryx component <Name> --props names a prop's type but does not show it, so an agent that has to build a value of that type opens Core's .d.ts files to find its shape. After the props list, the answer now prints one TypeScript block: an import type line for the types the props name that the owner package exports, and each declaration without its comments. It also prints the types those declarations name, within a length limit. With --json, each such prop carries types: [{name, declaration?}].

Example, astryx component Typeahead --props (end of the answer):

import type {SearchSource, SearchableItem, SearchContext, BaseTypeaheadMenu, BaseTypeaheadListboxMenuInfo, BaseTypeaheadDialogMenuInfo, BaseTypeaheadHandle, SizeValue, IconType} from '@astryxdesign/core';

interface SearchSource<T extends SearchableItem = SearchableItem> {
    search(query: string, context?: SearchContext<T>): Promise<T[]> | T[];
    bootstrap(): Promise<T[]> | T[];
    cancel?(): void;
}
interface SearchableItem<TAuxData = unknown> {
    id: string;
    label: string;
    action?: ReactNode;
    element?: ReactNode;
    auxiliaryData?: TAuxData;
}
...

What changes for you

  • An agent or a person reading --props sees the shape of SearchSource, TableColumn, ISODateString, ToastContentRenderProps and the other exported types a prop names, and the line that imports them, in the same answer.
  • --json readers get the same declarations on each prop (types), so the text stays a projection of the JSON (architecture:cli-surface INV4). The envelope and the data array keep their shape; types is a new optional field on each prop entry.
  • A type that a listed type names past the length limit (1,200 characters of nested declarations) carries only its name, and the text names it on a // Not shown: line.
  • A name that is not an exported type (a component, a React or DOM type, a generic parameter) is left out.

How

  • foundation/discovery/type-declarations.mjs follows export lists and export * through the package's published .d.ts files with patterns, from the root types entry, and parses only a file that declares a printed type (Babel's TypeScript parser, a CLI dependency). It runs no compiler.
  • api/component/_adapter.mjs finds the owner package from the doc's path, so Core and integration packages both work, and attaches the types to each prop; the props.mjs leaf stays free of file access (architecture:cli-surface INV21).
  • component-format.mjs prints the block once, in the order the props name the types.

Why this reads .d.ts files with its own small walk, not foundation/discovery/module-exports.mjs: that module is owned elsewhere, and with {types: true} it parses every module with Babel (about 2.5 s cold on Core's dist/index.d.ts) and resolves ./x.js to the runtime file, so it finds no types there. This walk answers in about 0.2 s and parses only the files it prints a declaration from. A shared .d.ts resolver in module-exports.mjs could be a later change by that module's owner.

The parser loads on demand through foundation/runtime/lazy-dependencies.mjs, so importing the API, astryx component Button and astryx discover load no parser. A type that two prop types reach belongs to both props.

Agent check

docs/contributing/cli-conventions.md asks for a check with agents when an answer grows. Agents with no tools and no files (claude-opus-5-5, claude -p --tools "", 3 runs per task per arm) got only the old or the new --props answer and one task. The file each one wrote was type-checked with tsc --strict against Core's published types:

Task old answer compiles new answer compiles
Typeahead searchSource over a local user list 0/3 3/3
Table columns with a right-aligned Price 1/3 3/3
Controlled DateInput value 3/3 3/3
Toast content render with a Close button 0/3 0/3

No task came out worse. The Toast runs failed in both arms for another reason: ToastProps requires type, isAutoHide and autoHideDuration, which the doc lists as optional. That is reported separately.

Answer size: Typeahead 5,451 to 6,770 characters, Table 4,725 to 7,806, DateInput 10,298 to 10,519, Toast 1,854 to 2,229.

Testing

  • New foundation/discovery/type-declarations.test.mjs: export * and export lists, a renamed export, names left out, the nested-length limit, typeNamesIn.
  • New api/component/detail/props/props.test.mjs: per-prop types, a doc outside the owner package, the printed block, an answer with no types. Both fail on main, where these functions and fields do not exist.
  • text-json-parity, json-contract, component.test.mjs, component-format.test.mjs, response-types.doc.test.mjs, readme-gen and doc-loads pass.
  • pnpm -F @astryxdesign/cli typecheck:strict after sync:api-types: no new errors. eslint and Prettier pass on the changed files.
  • outside-project.test.mjs "init outside a project (own) --user …" fails on macOS at this base and on this branch alike; nothing here touches init.

Scope

  • Inline types and their import line only. Which entry exports a hook or a helper is not part of this change.
  • Docs that name a type the package does not export, such as Selector's options (SelectorOption[], where the type is SelectorOptionType), resolve to nothing here; a separate fix corrects them.

Overlap checked: #12291, #12218, #12224, #12302, #12057, #12287, #12285, #12275, #12273, #12272, #12039, #11510, #5103, #11596, #5531 (#12291 changes the default component read and keeps --props as the read that prints props whole, and merges cleanly; #12218 adds another response-types line, so the generated README table conflicts in text and whichever lands second regenerates it; #12224, #12302, #12057, #12287, #12285, #12275, #12273, #12272 and #12039 edit other parts of the shared files and merge cleanly; #11510, #5103, #11596 and #5531 already conflict with main in the files they share)

Owner: fix-loop lane 4. Land path: Specs decided-check, owner approval of the new optional types field (additive public API), CodeBunny, CI, then the drain merges.

After the props list, `astryx component <Name> --props` prints one
TypeScript block: an `import type` line for the types the props name
that the owner package exports, and each declaration without comments,
then the types those declarations name, within a length limit. With
--json, each such prop carries `types: [{name, declaration?}]`.

The declarations are read from the package's published .d.ts files:
export lists and `export *` are followed with patterns, and only a file
that declares a printed type is parsed.
@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 10:36pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 18, 2026, 10:40 PM UTC

@cixzhang cixzhang added the lane:4 Astryx fix-loop lane 4 owns this label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 needed, and approval also waits on an owner decision about the surface itself.

No current record decides that astryx component <Name> --props prints the declarations of the types its props name, or that component.detail.props carries the new optional types field, and the description's land path asks for exactly that approval. architecture:cli-surface INV4/INV5 and spec:AST-017 FR13/DEC-4 say how such a field must be typed, tested, projected and documented, not that it should exist. An engineering owner records the decision by commenting /approve-spec bda0ccf9f592963c7fd9e7d495f7f645e9abd842 on this pull request, and you may do so yourself if you are an engineering owner. These fixes are needed either way:

  • pnpm check:cli-structure fails at this head with INV21: component/detail/props/props.mjs imports fs, discovery, because the props leaf reads the file system directly instead of going through api/component/_adapter.mjs.
  • packages/cli/test/lazy-dependencies.test.mjs ("are not loaded by importing the API") fails because foundation/discovery/type-declarations.mjs:15 imports @babel/parser statically, so every run that reaches the component API loads the parser; call babelParse from foundation/runtime/lazy-dependencies.mjs instead.
  • pnpm check:changesets fails: .changeset/cli-props-show-types.md has no contributor credit line (@yourhandle on its own line), while the base passes with 767 valid changesets.
  • A prop's types omits a type its own declarations name when another prop reached that type first — astryx component Table --props --json gives plugins the TablePlugin declaration with no TableColumn entry, and Selector's renderOption and renderValue lose IconType — although the changeset, the README row, the response-type doc and the ComponentPropsEntry typedef all say the prop carries "those types and then the types they name"; keep every name a type was reached from, or correct the wording in all four places.
  • foundation/discovery/type-declarations.mjs re-implements relative-module resolution and export-list and export * following with regular expressions, which foundation/discovery/module-exports.mjs already owns from the parse tree (moduleExportOrigins(file, {types: true}), moduleExportSource, resolveLocalModule), with cycle handling and a type-export mode; extend that module to resolve .d.ts files and call it.

The resolution itself holds up: across all 174 Core components the answer misses no type Core exports, and the text answer stays an exact projection of the JSON.

Claims and files checked

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

Claims

  • The text answer stays a projection of the JSON — verified: the head text equals the base text up to the inserted block, and the block renders exactly the JSON types.
  • The envelope and the data array keep their shape, with types optional — verified: head data equals base data once types is stripped.
  • A nested type past the length limit carries only its name, and the text names it — verified on Table's answer.
  • A name that is not an exported type is left out — verified: all 41 such names across Core fail to resolve as exported types under tsc --strict.
  • The owner package is found from the doc's path, so Core and integration packages both work — verified at the six call sites and by the unit test for a doc outside the owner package.
  • Both new test files fail on main — verified against a base tree.
  • The named existing tests pass — verified (599 tests over those files at the head).
  • Strict typecheck after the type sync has no new errors — verified: the head and the base report the same two pre-existing errors.
  • eslint and Prettier pass on the changed files — verified.
  • The quoted answer sizes — verified byte for byte.
  • The macOS-only outside-project failure — not checked; this review runs on Linux and nothing rests on it.
  • The agent-check table — not reproduced; self-reported, and no finding rests on it.
  • The changeset's wording matches the behaviour, except that each prop does not carry every type its declarations name.

Files

  • .changeset/cli-props-show-types.md — missing contributor credit.
  • packages/cli/README.md, packages/cli/foundation/response/response-types.doc.mjs, packages/cli/api/component/component.doc.mjs, packages/cli/clients/cli/commands/component.doc.mjs — generated row and docs agree with each other; wording overstates the per-prop field.
  • packages/cli/api/component/component.mjs — all six call sites pass the doc path; clear.
  • packages/cli/api/component/component.type.mjs — the new typedefs; clear apart from the wording above.
  • packages/cli/api/component/detail/props/props.mjs — the INV21 violation and the dropped nested type.
  • packages/cli/foundation/discovery/type-declarations.mjs — the eager parser import, the first-reached-from tagging, and the duplicated export following.
  • packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs — the handler stays a thin renderer and the block prints once, batch rows included; clear.
  • packages/cli/api/component/detail/props/props.test.mjs, packages/cli/foundation/discovery/type-declarations.test.mjs — cover the new behaviour and fail on main; the second locks in a renamed export printing a declaration under a different name.

Automated review (maintainer link)

Comment thread .changeset/cli-props-show-types.md Resolved
…t adapter

Environment access belongs in the adapter (architecture:cli-surface
INV21), so finding the owner package and reading its declarations moves
from the props leaf to api/component/_adapter.mjs. The changeset credits
its author.

@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 needed, and approval also waits on an engineering owner deciding the new surface.

No current record decides that astryx component <Name> --props prints the declarations of the types its props name, or that component.detail.props entries carry the optional types field (architecture:cli-surface INV4/INV5 and spec:AST-017 FR13/DEC-4 say only how such a field is projected and documented), so approval needs an engineering owner to approve this surface or identify the record that governs it, which they record by commenting /approve-spec 19ccd7db512383d756f2a34d8e9c6ca7bb8528ad on this pull request; you may do so yourself if you are an engineering owner. The earlier check:cli-structure and check:changesets failures are fixed, and these fixes are still needed either way:

  • foundation/discovery/type-declarations.mjs:15 imports @babel/parser statically and api/component/_adapter.mjs now imports that module, so importing the API, astryx component Button and astryx discover all load the parser and test/lazy-dependencies.test.mjs ("are not loaded by importing the API") still fails; call babelParse from foundation/runtime/lazy-dependencies.mjs instead.
  • A prop's types omits a type its own declarations name when another prop reached that type first (astryx component Table --props --json gives plugins the TablePlugin declaration but no TableColumn, and Selector's renderOption and renderValue lose IconType), although the changeset, the README row, the response-type doc and the ComponentPropsEntry typedef say the prop carries "those types and then the types they name"; keep every name a type was reached from, or correct the wording in all four places.
  • foundation/discovery/type-declarations.mjs re-implements relative-module resolution and export-list and export * following with regular expressions, which foundation/discovery/module-exports.mjs already owns from the parse tree (moduleExportOrigins(file, {types: true}), moduleExportSource, resolveLocalModule); extend that module to resolve .d.ts files and call it.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims

  • The text answer stays a projection of the JSON: verified, the head text equals the base text up to the inserted block and the parity tests pass.
  • The envelope and the data array keep their shape, with types optional: verified, the JSON contract tests pass and the response path is unchanged since the last check.
  • A nested type past the length limit carries only its name, and the text names it: verified, the formatter is unchanged since the last check.
  • A name that is not an exported type is left out: verified, the resolver is unchanged since the last check.
  • The component adapter finds the owner package from the doc's path, and the props leaf stays free of file access: verified, the structure check passes and every call site passes the doc path.
  • The declarations are read with patterns and a Babel parse, with no compiler: verified; the parser import is static (first fix above).
  • Both new test files fail on main: verified earlier, and neither file changed since.
  • The named existing tests pass: verified at this head.
  • Strict typecheck after the type sync shows no new errors: verified, the head and the base report the same two existing errors.
  • eslint and Prettier pass on the changed files: verified.
  • The quoted answer sizes: verified at this head.
  • The macOS-only outside-project failure: not checked; nothing rests on it.
  • The agent-check table: not reproduced; self-reported, and nothing rests on it.
  • Each prop carries the types its types name: false for props whose nested types another prop reached first (second fix above).

Files

  • .changeset/cli-props-show-types.md: the credit line is added; wording overstates the per-prop field.
  • packages/cli/README.md, packages/cli/foundation/response/response-types.doc.mjs, packages/cli/api/component/component.doc.mjs, packages/cli/api/component/component.type.mjs: agree with each other; wording overstates the per-prop field.
  • packages/cli/clients/cli/commands/component.doc.mjs: option description; clear.
  • packages/cli/api/component/_adapter.mjs: the file reads now live here; its new import pulls in the static parser import.
  • packages/cli/api/component/detail/props/props.mjs: imports only from the adapter; clear.
  • packages/cli/api/component/component.mjs: every call site passes the doc path; clear.
  • packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs: the handler stays a thin renderer and the block prints once; clear.
  • packages/cli/foundation/discovery/type-declarations.mjs: the static parser import, the first-reached-from tagging and the duplicated export following.
  • packages/cli/api/component/detail/props/props.test.mjs, packages/cli/foundation/discovery/type-declarations.test.mjs: cover the new behaviour; the second locks in a renamed export printing a declaration under a different name.

Automated review (maintainer link)

Comment thread packages/cli/api/component/_adapter.mjs Resolved
… props reach belongs to both

The type-declaration reader takes @babel/parser through
lazy-dependencies, so importing the API, component and discover load no
parser. A type reached from two prop types now lists both, so each prop
carries every type its own declarations name, as the response type says.

@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.

Approval waits on an engineering owner deciding the new surface; the three points from the last review are resolved at this head.

No current record decides that astryx component <Name> --props prints the declarations of the types its props name, or that component.detail.props entries carry the optional types field (architecture:cli-surface INV4/INV5 and spec:AST-017 FR13/DEC-4 say only how such a field is projected and documented). An engineering owner approves this surface, the printed Types block and the types: [{name, declaration?}] field with its 1,200-character budget for nested types, or names the record that governs it, by commenting /approve-spec cc6aa7549b550810ab00da6bd41ffebdcec419eb on this pull request; you may do so yourself if you are an engineering owner. One non-blocking suggestion:

  • Each prop's types follows the answer-wide order, so Table.plugins lists TableColumn before its own TablePlugin, while the ComponentPropsEntry typedef, the response-type doc and the README row say "those types and then the types they name"; list a prop's own types first, or reword those three places.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims

  • The text answer stays a projection of the JSON: verified, the head's text starts with the base's whole answer, byte for byte, and the parity tests pass.
  • The envelope and the data array keep their shape, with types new and optional: verified, the JSON contract tests pass.
  • A nested type past the length limit carries only its name, and the text names it on a "Not shown" line: verified on Table, where five types are cut.
  • A name that is not an exported type is left out: verified by the unit tests and the real answers.
  • The component adapter finds the owner package from the doc's path, and the props leaf reads no files: verified, the structure check passes.
  • The reader follows export lists and export * with patterns, parses only a file it prints from, and runs no compiler: verified in the code.
  • The shared export-reading module cannot serve, because it parses each module and resolves ./x.js to the runtime file: verified, it finds no type in Core's built declarations; the timing figure was not reproduced (0.7 s here), and nothing rests on it.
  • The parser loads on demand, so importing the API, component Button and discover load none: verified by the lazy-dependencies test and a module-load trace.
  • A type that two props reach belongs to both: verified, Table.plugins now carries TableColumn.
  • Both new test files fail on main: verified, they import functions and fields main does not have.
  • The named existing tests pass: verified at this head.
  • Strict typecheck after the type sync shows no new errors: verified, only the two existing unbuilt-theme errors remain.
  • eslint and Prettier pass on the changed files: verified.
  • The quoted answer sizes: verified in both trees.
  • The changeset's description of the Types block and the per-prop field: verified for content; the per-prop order differs (suggestion above).
  • The macOS-only outside-project failure: not checked; nothing rests on it.
  • The agent-check table: not reproduced; self-reported, and nothing rests on it.

Files

  • .changeset/cli-props-show-types.md: clear.
  • packages/cli/README.md, packages/cli/foundation/response/response-types.doc.mjs, packages/cli/api/component/component.doc.mjs, packages/cli/api/component/component.type.mjs: agree with each other; the order wording is the suggestion above.
  • packages/cli/clients/cli/commands/component.doc.mjs: option description; clear.
  • packages/cli/api/component/_adapter.mjs: the file reads live here and each prop keeps every matching type; clear.
  • packages/cli/api/component/detail/props/props.mjs: imports only from the adapter; clear.
  • packages/cli/api/component/component.mjs: every call site passes the doc path; clear.
  • packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs: the handler stays a thin renderer and the block prints once; clear.
  • packages/cli/foundation/discovery/type-declarations.mjs: the parser loads on first use and a nested type keeps every prop that reached it; clear.
  • packages/cli/api/component/detail/props/props.test.mjs, packages/cli/foundation/discovery/type-declarations.test.mjs: cover the new behaviour; the second locks in a renamed export printing under its declared name.

Automated review (maintainer link)

Each prop's types followed the answer-wide order, so Table.plugins listed
TableColumn before TablePlugin. A prop now lists the types its type names
first, as the response type says.

@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.

Approval waits on an engineering owner deciding the new surface; the suggestion from the last review is resolved at this head.

No current record decides that astryx component <Name> --props prints the declarations of the types its props name, or that component.detail.props entries carry the optional types field (architecture:cli-surface INV4/INV5 and spec:AST-017 FR13/DEC-4 say only how such a field is projected and documented). An engineering owner approves this surface, the printed Types block and the types: [{name, declaration?}] field with its 1,200-character budget for nested types, or names the record that governs it, by commenting /approve-spec 09ea029aafb3b7aa018e74ab94c3dae5302e05f4 on this pull request; you may do so yourself if you are an engineering owner. One non-blocking suggestion:

  • A type the package re-exports under another name prints its declaration under the original name (export type {Size as WidgetSize} prints type Size = ... beside an import of WidgetSize); no Core prop names such a type today, but printing type WidgetSize = Size would keep the block correct once one does.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims

  • After the props list, the answer prints one TypeScript block with an import line for the exported types the props name and each declaration without comments: verified on the Typeahead and Table answers and in the unit tests.
  • It also prints the types those declarations name, within a length limit: verified, one level within 1,200 characters.
  • With --json, each such prop carries types: [{name, declaration?}]: verified on the Table, Selector and Tokenizer answers.
  • The text stays a projection of the JSON: verified, each answer starts with the base's whole answer, byte for byte, and the parity tests pass.
  • The envelope and the data array keep their shape, with types new and optional: verified, the JSON contract tests pass.
  • A nested type past the length limit carries only its name, and the text names it on a "Not shown" line: verified on Table, where five types are cut.
  • A name that is not an exported type is left out: verified by the unit tests and the real answers.
  • The component adapter finds the owner package from the doc's path, and the props leaf reads no files: verified, the structure check passes.
  • The reader follows export lists and export * with patterns, parses only a file it prints from, and runs no compiler: verified in the code.
  • The shared export-reading module cannot serve: verified in the last review, and neither module changed since; the timing figure was not reproduced, and nothing rests on it.
  • The parser loads on demand, so other runs load none: verified, the lazy-dependencies test passes.
  • A type that two props reach belongs to both: verified, Table.plugins carries TableColumn.
  • Each prop lists its own types first, then the types they name: verified, Table.plugins now opens with TablePlugin.
  • Both new test files fail on main: verified, they import functions and fields main does not have.
  • The named existing tests pass: verified at this head.
  • Strict typecheck after the type sync shows no new errors: verified, only the two existing unbuilt-theme errors remain.
  • eslint and Prettier pass on the changed files: verified.
  • The quoted answer sizes: verified for Typeahead and Table; DateInput's props list measures 11 characters shorter here, and its Types block adds the same 221.
  • The changeset's description of the Types block and the per-prop field: verified.
  • The macOS-only outside-project failure: not checked; nothing rests on it.
  • The agent-check table: not reproduced; self-reported, and nothing rests on it.

Files

  • .changeset/cli-props-show-types.md: clear.
  • packages/cli/README.md, packages/cli/foundation/response/response-types.doc.mjs, packages/cli/api/component/component.doc.mjs, packages/cli/api/component/component.type.mjs: agree with each other and with the per-prop order; clear.
  • packages/cli/clients/cli/commands/component.doc.mjs: option description; clear.
  • packages/cli/api/component/_adapter.mjs: the file reads live here and each prop lists its own types first; clear.
  • packages/cli/api/component/detail/props/props.mjs: imports only from the adapter; clear.
  • packages/cli/api/component/component.mjs: every call site passes the doc path; clear.
  • packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs: the handler stays a thin renderer and the block prints once; clear.
  • packages/cli/foundation/discovery/type-declarations.mjs: the parser loads on first use; the renamed re-export is the suggestion above.
  • packages/cli/api/component/detail/props/props.test.mjs, packages/cli/foundation/discovery/type-declarations.test.mjs: cover the new behaviour and the new order.

Automated review (maintainer link)

The CLI README's generated response-types table conflicted; it takes
main's text and is regenerated, so it adds only this branch's row text.

@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.

Approval waits on an engineering owner deciding the new surface; nothing else blocks.

No current record decides that astryx component <Name> --props prints the declarations of the types its props name, or that component.detail.props entries carry the optional types field (architecture:cli-surface INV4/INV5 and spec:AST-017 FR13/DEC-4 say only how such a field is projected and documented). An engineering owner approves this surface, the printed Types block and the types: [{name, declaration?}] field with its 1,200-character budget for nested types, or names the record that governs it, by commenting /approve-spec 0f3d2a3664c7a9f1dccd26f6d8295ece30c4f1e9 on this pull request; you may do so yourself if you are an engineering owner. Two non-blocking suggestions:

  • The default short answer now points to --props only for "Each prop's whole description", so an agent reading it is not told that --props also carries the type declarations; naming the Types block in that pointer would lead agents to it.
  • A type the package re-exports under another name prints its declaration under the original name (export type {Size as WidgetSize} prints type Size = ... beside an import of WidgetSize); no Core prop names such a type today, but printing type WidgetSize = Size would keep the block correct once one does.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims

  • After the props list, the answer prints one TypeScript block with an import line for the exported types the props name and each declaration without comments: verified on the Typeahead and Table answers and in the unit tests.
  • It also prints the types those declarations name, within a length limit: verified, one level within 1,200 characters.
  • With --json, each such prop carries types: [{name, declaration?}]: verified on the Table and Typeahead answers.
  • The text stays a projection of the JSON: verified, each answer starts with the base's whole answer, byte for byte, and the parity tests pass.
  • The envelope and the data array keep their shape, with types new and optional: verified, each prop equals the base's once types is removed, and the JSON contract tests pass.
  • A nested type past the length limit carries only its name, and the text names it on a "Not shown" line: verified on Table, where five types are cut.
  • A name that is not an exported type is left out: verified by the unit tests and a sweep of every Core component.
  • The component adapter finds the owner package from the doc's path, and the props leaf reads no files: verified, the structure check passes.
  • The reader follows export lists and export * with patterns, parses only a file it prints from, and runs no compiler: verified in the code.
  • The shared export-reading module cannot serve: verified in an earlier review; the timing figures were not reproduced, and nothing rests on them.
  • The parser loads on demand, so other runs load none: verified, the lazy-dependencies test passes.
  • A type that two props reach belongs to both: verified, Table.plugins carries TableColumn.
  • The agent-check table: not reproduced; self-reported, and nothing rests on it.
  • The quoted answer sizes: the growth each answer gains matches to the character (Typeahead +1,319, Table +3,081, DateInput +221, Toast +375); the absolute figures predate the merge of main, whose props lists are longer (Table now 7,275 to 10,356).
  • Both new test files fail on main: verified, they import functions and fields main does not have.
  • The named existing tests pass: verified at this head, with the new short-answer test.
  • Strict typecheck after the type sync shows no new errors: verified, only the two existing unbuilt-theme errors remain.
  • eslint and Prettier pass on the changed files: verified.
  • The macOS-only outside-project failure: not checked; nothing rests on it.
  • The overlapping pull requests: verified, the short-answer change merged with no conflict and --props still prints every description whole; the response-types change conflicted only in the generated README row, which is in sync.
  • The changeset's description of the Types block and the per-prop field: verified.

Files

  • .changeset/cli-props-show-types.md: clear.
  • packages/cli/README.md: the merge's resolution keeps this row, and the generated tables are in sync; clear.
  • packages/cli/foundation/response/response-types.doc.mjs, packages/cli/api/component/component.doc.mjs, packages/cli/api/component/component.type.mjs: agree with each other and with the per-prop order; clear.
  • packages/cli/clients/cli/commands/component.doc.mjs: option description; clear.
  • packages/cli/api/component/_adapter.mjs: the file reads live here and each prop lists its own types first; clear.
  • packages/cli/api/component/detail/props/props.mjs: imports only from the adapter; clear.
  • packages/cli/api/component/component.mjs: every call site passes the doc path after the merge; clear.
  • packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs: the handler stays a thin renderer and the block prints once; the short answer's pointer is the first suggestion above.
  • packages/cli/foundation/discovery/type-declarations.mjs: the parser loads on first use; the renamed re-export is the second suggestion above.
  • packages/cli/api/component/detail/props/props.test.mjs, packages/cli/foundation/discovery/type-declarations.test.mjs: cover the new behaviour and the order.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 0f3d2a36 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. lane:4 Astryx fix-loop lane 4 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant