Skip to content

feat(cli): implement metadata command for API surface extraction#35843

Draft
Hotell wants to merge 19 commits intomicrosoft:experimental/fluent-clifrom
Hotell:exp/fluent-cli/cmd/metadata
Draft

feat(cli): implement metadata command for API surface extraction#35843
Hotell wants to merge 19 commits intomicrosoft:experimental/fluent-clifrom
Hotell:exp/fluent-cli/cmd/metadata

Conversation

@Hotell
Copy link
Contributor

@Hotell Hotell commented Mar 6, 2026

Description

Add new fluentui-cli metadata command that parses .d.ts build output to extract the complete API surface of a Fluent UI package.

Features

  • Parses .d.ts files using ts-morph to extract all exported symbols
  • Classifies exports into Components, Hooks, Types, and Others
  • Extracts JSDoc descriptions, tags, type signatures, and member details
  • Supports JSON (default), Markdown, and HTML output formats
  • Cross-package $ref resolution via metadata.json (JSON Schema style)
  • Entry resolution from package.json "types" field or --entry override

CLI Options

fluentui-cli metadata [options]

  --entry, -e    Path to index.d.ts (default: resolved from package.json)
  --reporter, -r Output format: json | markdown | html
  --output, -o   Output file path (default: stdout)

Output Format (JSON)

Produces structured metadata with categories:

  • Components: React components with props type $ref
  • Hooks: Parameters and return types
  • Types: Interfaces/aliases/enums with member details (name, type, required, default, description)
  • Others: Constants, render functions, utilities

Cross-package references use JSON Pointer URI style: @fluentui/react-utilities#/categories/types/ComponentProps

Dependencies

⚠️ This PR depends on #35842

Testing

  • 41 new unit tests covering entry-resolver, dts-parser, cross-package-resolver, and handler integration
  • All 189 CLI tests pass

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Pull request demo site: URL

@Hotell Hotell changed the title feat(cli): add metadata command for API surface extraction feat(cli): implement metadata command for API surface extraction Mar 6, 2026
Hotell and others added 19 commits March 6, 2026 15:00
- Add public accessibility modifiers to TsMorphAstParser methods
- Rename private methods with leading underscore per naming convention
- Replace no-explicit-any with proper types in test mocks
- Fix dot-notation violations (auto-fixed)
- Remove unused eslint-disable directive
- Use type:'string'+array:true instead of string:true for yargs options

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add new `fluentui-cli metadata` command that parses .d.ts build output
to extract the complete API surface of a Fluent UI package.

Features:
- Parses .d.ts files using ts-morph to extract all exported symbols
- Classifies exports into Components, Hooks, Types, and Others
- Extracts JSDoc descriptions, tags, type signatures, and member details
- Supports JSON (default), Markdown, and HTML output formats
- Cross-package $ref resolution via metadata.json (JSON Schema style)
- Entry resolution from package.json "types" field or --entry override

CLI options:
  --entry, -e    Path to index.d.ts (default: from package.json)
  --reporter, -r Output format: json | markdown | html
  --output, -o   Output file path (default: stdout)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Hotell Hotell force-pushed the exp/fluent-cli/cmd/metadata branch from ea59631 to fc22253 Compare March 6, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant