Skip to content

feat(site): API tables under every piece, read from the components' own types - #58

Merged
DumiFlex merged 2 commits into
devfrom
feat/site-api-reference
Nov 2, 2026
Merged

DumiFlex merged 2 commits into
devfrom
feat/site-api-reference

Conversation

@DumiFlex

@DumiFlex DumiFlex commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

What

Each piece on the kit site gets an API section under its example. It is folded by default, and its label shows the counts (e.g. "10 props · 1 event · 1 slot"). Open it to see:

  • Props: name, type, default, required, and the JSDoc comment.
  • Events: name and payload. update:x is marked as v-model.
  • Slots: name and slot props.
  • Exposed: what defineExpose hands a template ref.

How

  • site/kit-api.ts is a Vite plugin serving virtual:kit-api. It runs vue-component-meta 2.2.12, which uses the same language core as our vue-tsc 2.2.12, over every src/*.vue.
  • The tables are read from the code on each build, so they can't drift. There is no generated file to commit.
  • It takes about 5 s for all 80 components, re-runs in dev when a component changes, and is also used by Vitest.
  • The site search now matches prop, event and slot names, so searching "clearable" finds DatePicker.
  • The tables are drawn with the kit's own Disclosure and .wp-table.

Many props have no JSDoc comment yet, so their description cell is empty. Filling those in is a follow-up.

Checks

lint, typecheck, test (459, with new kit-api.test.ts), site:build and check-package all pass.

@DumiFlex
DumiFlex merged commit e23973a into dev Nov 2, 2026
2 checks passed
@DumiFlex
DumiFlex deleted the feat/site-api-reference branch November 2, 2026 22:09
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