Skip to content

feat: [docs, button] generate the button props table from its types - #997

Open
Shreyag02 wants to merge 4 commits into
chore/upgrade-fumadocsfrom
feat/generate-props-tables
Open

Shreyag02 wants to merge 4 commits into
chore/upgrade-fumadocsfrom
feat/generate-props-tables

Conversation

@Shreyag02

Copy link
Copy Markdown
Contributor

Summary

  • Generate the Button props table from ButtonProps. The docs props.ts re-exports the type, so a wrong name fails the docs build.
  • Map @raystack/apsara and ~/* to the package source in tsconfig.props.json, so the tables read the current types.
  • Extend the transform. It hides props that only React, the DOM or another library declares (Base UI props stay) and props tagged @ignore. It uses the Apsara JSDoc when Base UI declares the same prop, adds the @deprecated text to the description, and reads a cva prop's default from defaultVariants.
  • Show a cva prop's values in the order of its keys, without the null that cva adds. Other props keep null, since it can mean something (Progress value).
  • Write the Button prop descriptions in button.tsx and the radius description in shared/radius. Button declares nativeButton and focusableWhenDisabled again, since it changes their Base UI defaults.

Part of #879

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
apsara Ready Ready Preview Oct 30, 2026 5:13am UTC

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change documents Button and radius props, adds two optional Button props, and re-exports ButtonProps from @raystack/apsara in the Button documentation module. The type-table generator now processes declaration and JSDoc information, filters hidden entries, and derives prop types and defaults. The props TypeScript configuration adds path mappings for React and the package.

Sequence Diagram(s)

sequenceDiagram
  participant Fumadocs
  participant Generator
  participant Transform
  participant Declarations
  Fumadocs->>Generator: generateDocumentation
  Generator->>Transform: process prop entries
  Transform->>Declarations: resolve declarations and documentation
  Transform-->>Generator: return updated entries and hidden-entry state
  Generator-->>Fumadocs: return generated documentation without hidden entries
Loading

Possibly related issues

  • raystack/apsara#990 — The PR updates the type-table transform and re-exports ButtonProps from the package.
  • raystack/apsara#988 — The type-table transform reads TypeScript declaration nodes and checker types.

Suggested reviewers: rohanchkrabrty

Priority: Low

Merge Risk: Minimal · up to 1c6b6

No confirmed merge-blocking defect remains. Button variant-row visibility remains unverified; confirm the generated table includes variant, size, color, and radius during normal documentation validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: generating the Button props table from its types.
Description check Passed The description directly explains the changes to Button prop-table generation, type mapping, transform behavior, and related documentation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.5.15)
apps/www/src/content/docs/components/button/props.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

apps/www/src/lib/type-table.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

apps/www/tsconfig.props.json

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

  • 2 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@997

commit: 1c6b6a7

@Shreyag02
Shreyag02 added this pull request to stack #999 October 30, 2026 03:10
@Shreyag02
Shreyag02 marked this pull request as ready for review October 30, 2026 03:10

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

Additional comments: 1
apps/www/src/lib/type-table.ts-109-111: 1

109-111: Minor · Potential issue · Heavy lift

Unverified finding
We couldn't verify this from the code. It is shown for review, not as a verified issue.

The visibility test assumes every prop symbol has a declaration in an allowed source file. Synthetic or mapped CVA properties may instead have no declarations, or only declarations in class-variance-authority, and be hidden.

One or more Button variant rows disappear from the generated table.

This can occur when: ButtonProps variant, size, color, or radius resolves as a mapped property without a declaration pointing back to the package source.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56d0063f-1fbf-4e50-a46b-be3c3f7578f0
Commits

Reviewing files that changed from the base of the PR and between 3fe7815 and 1c6b6a7.

Files selected for processing: 5
  • apps/www/src/content/docs/components/button/props.ts
  • apps/www/src/lib/type-table.ts
  • apps/www/tsconfig.props.json
  • packages/react/components/button/button.tsx
  • packages/react/shared/radius/radius.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch was successfully deployed

1 active deployment
Preview — 1c6b6a7d Deployed Oct 30, 2026 by vercel[bot]
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