Update existing API documentation pages after source code changes. Use when syncing docs with library changes like new parameters, type constraint changes, interface updates, or function renames. Covers common change patterns and verification steps.
Guide for syncing API docs with source code changes.
Prerequisite: Read the repo-website-api-create skill for properties.ts and index.mdx patterns.
Update documentation when source code changes:
Do NOT update for: Internal implementation changes (~run method), test changes, non-JSDoc comments.
properties.ts - Match types exactly to source; for optional object keys, keep the plain key name and use a union with as the last option instead of appending undefined?index.mdx - Signature, generics, parameters, examplesmenu.md if renamed// Before: one overload
export function action<TInput>(requirement: TRequirement): Action<...>;
// After: two overloads (message is optional)
export function action<TInput>(requirement: TRequirement): Action<..., undefined>;
export function action<TInput, TMessage>(requirement: TRequirement, message: TMessage): Action<..., TMessage>;
Update:
TMessage generic to properties.tsmessage parameter to properties.tsindex.mdxproperties.tsindex.mdx// Before
TRequirement extends number
// After
TRequirement extends number | string
Update:
properties.ts(types)/TypeName/properties.ts; if the source key is optional, do not append ? to the key name and model it as a union with undefined lastmenu.md (maintain alphabetical order)Add notice at top of index.mdx (import Link from ~/components):
> **⚠️ Deprecated**: Use <Link href="../newFunction/">\`newFunction\`</Link> instead. Will be removed in v2.0.
When source introduces a type alias:
// Before: TInput extends string | unknown[]
// After: TInput extends LengthInput
properties.ts to reference new type with href(types)/When sync and async variants are added:
When a function changes, check:
(types)/TypeName/)After updating, verify:
href links are validmenu.md updated if renamedproperties.ts → index.mdx → related files| Change | Files to Update |
|---|---|
| New parameter | properties.ts, index.mdx (signature, generics, params, examples) |
| Removed parameter | properties.ts, index.mdx |
| Type change | properties.ts, index.mdx (explanation, examples) |
| Interface change | (types)/TypeName/properties.ts, (types)/TypeName/index.mdx |
| Renamed function | Folder name, all files, menu.md, cross-references |
| Deprecation | index.mdx (add warning) |