feat(docs): interactive API reference on /docs/rest-api#39
Draft
vreshch wants to merge 1 commit into
Draft
Conversation
|
✅ CI - Verify PASSED Commit:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Upgrades
/docs/rest-apifrom a single hand-written endpoint into an interactive, grouped API reference that reproduces the approved prototype inside the landing docs engine.Proto source:
_archive/proto/api-reference-page/index.html(grouped endpoint list -> expandable contract per row).What changed
endpointsDocBlock type (docs/types.ts):{ type: 'endpoints', groups: EndpointGroup[] }plusEndpoint/EndpointArg/EndpointError/EndpointGroup/HttpMethod/EndpointStatus.lib/api-endpoints.ts): all 10 endpoints transcribed exactly from the protoAPIarray (same copy, contracts, grouping: Vaults / Notes / Search & export). ReusesREST_API_BASE_URLfromlib/mcp-docs.ts.components/docs/endpoint-list.tsx,'use client'): accordion rows - colored method badges (GET success / POST info / PUT warning / PATCH tag-schedules / DELETE destructive, all soft/10bg +/20border), chevron rotate,aria-expanded+aria-controls, independent open state per row, orange draft-warning line for planned rows,LivevsPlanned - wave Nchips. Bodies toggle via CSS so the contract stays in the prerendered HTML.components/docs/json-highlight.tsx,'use client'): response blocks normalized throughJSON.parse/stringify(2-space) then tokenized - keys / strings / numbers / booleans+null each distinct via semantic tokens (works light + dark). No shiki in the island; local tokenizer. Binary export response stays plain text.docs/components/doc-article.tsx):case 'endpoints'.docs/content/rest-api.ts): kept lede +endpoint+authentication+Limits and versioning+What this API is not; replaced the hand-written example / response-schema / errors sections with oneendpointsblock.Theme mapping / deviations
Proto used dashboard OKLCH tokens directly; all map 1:1 to the landing DS semantic tokens (
success/info/warning/destructive/tag-schedulesfor the PATCH purple,primary/primary-soft,muted-foreground, etc.), so light + dark both work with no custom colors. Code/response blocks reuse the landingCodeBlockchrome (copy button + language chip) instead of the proto's bare<pre>, to match existing docs pages. No forced visual deviations otherwise.Verify evidence
npm run verifygreen: type-check + lint + format:check + test + build./docs/[slug]prerenders as static HTML (SSG).next start -p 3013,curl /docs/rest-api->200. Prerendered HTML contains:/v1/vaultsx45,PATCHbadge present, method-badge classes for all 5 verbs (6 GET / 1 POST / 1 PUT / 1 PATCH / 1 DELETE), 6xPlanned - wave 2+ 3xPlanned - wave 3+ 1 live, draft-warning line, and JSON highlighting spans (numbers intext-warning, keys intext-info, strings intext-success, booleans/null intext-tag-schedules; 91 token spans, 9jsonchips). Server stopped after check.MERGE ONLY AFTER REVIEW
Merging landing
masterauto-deploys BOTH dev and prod. Do not merge until reviewed. This PR is DRAFT.