en un clic
repo-website-api-update
// Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source.
// Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source.
Document Formisch source code with JSDoc and inline comments. Use when writing or updating documentation comments in packages/core, packages/methods, or frameworks/* source files.
Review PRs and source code changes in Formisch packages/ and frameworks/. Use when reviewing pull requests, validating implementation patterns, or checking code quality before merging.
Create new API documentation routes for the Formisch website. Use when adding documentation for new exported functions, types, components, or methods that don't yet have website documentation.
Review and verify API documentation routes on the Formisch website. Use when checking documentation accuracy, completeness, and consistency with source code.
Write unit and type tests for Formisch framework packages (frameworks/preact, frameworks/solid, frameworks/svelte, frameworks/vue, frameworks/react). Use when adding tests for hooks/composables/runes (useForm/createForm, useField, useFieldArray) or components (Form, Field, FieldArray) in any framework wrapper.
Write unit tests for Formisch packages (packages/core and packages/methods) with proper TypeScript types. Use when creating new tests, fixing type errors in tests, or adding test coverage for core/methods functions.
| name | repo-website-api-update |
| description | Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source. |
| metadata | {"author":"formisch","version":"1.0"} |
API documentation must stay synchronized with source code. When functions, types, or interfaces change in the Formisch packages, update the corresponding documentation.
Key Principle: Source code is the single source of truth. Documentation must never deviate from what's actually implemented.
Update documentation when:
Do NOT update when:
Compare source code changes:
git diff HEAD~1 packages/core/src/path/to/file.ts
Categorize changes:
Locate files to update:
/website/src/routes/(docs)/{framework}/api/{category}/{ApiName}/
├── index.mdx
└── properties.ts
Ensure types match new source code:
// If generic constraint changed from:
TInput
// To:
TInput extends string | number
// Update properties.ts:
TInput: {
modifier: 'extends',
type: {
type: 'union',
options: ['string', 'number'],
},
},
source path if file movedSource change:
// Before
export function validate(form: FormStore): void;
// After (added config)
export function validate(form: FormStore, config?: ValidateConfig): void;
properties.ts update:
// Add new parameter
config: {
type: {
type: 'union',
options: [
{ type: 'custom', name: 'ValidateConfig', href: '../ValidateConfig/' },
'undefined',
],
},
},
index.mdx update:
Source change:
// Before
TRequirement extends number
// After
TRequirement extends number | string
properties.ts update:
TRequirement: {
modifier: 'extends',
type: {
type: 'union',
options: ['number', 'string'],
},
},
Update type documentation:
// In properties.ts, add new property
received: {
type: 'string',
},
Update index.mdx Definition section:
- `StringIssue` <Property {...properties.BaseIssue} />
- `kind` <Property {...properties.kind} />
- `type` <Property {...properties.type} />
- `received` <Property {...properties.received} /> <!-- Added -->
mv /api/oldName /api/newNameAdd deprecation notice after description:
# oldFunction
Creates a form store.
> **⚠️ Deprecated**: Use <Link href="../newFunction/">`newFunction`</Link> instead. This function will be removed in v2.0.
// ✅ Correct
href: '/core/api/FormSchema/';
// ❌ Wrong - relative won't work across packages
href: '../../../core/api/FormSchema/';
// ✅ Correct
href: '../FormStore/';
// ❌ Wrong - Qwik ignores (types) segment
href: '../(types)/FormStore/';
href links point to existing documentation// Optional = union with undefined
config: {
type: {
type: 'union',
options: [
{ type: 'custom', name: 'Config', href: '../Config/' },
'undefined',
],
},
},
\`\`\`ts
const result = fn<TSchema>(form);
const result = fn<TSchema, TPath>(form, config);
\`\`\`
Reference generic parameter names, not base types:
// ✅ Correct - use parameter name
generics: [{ type: 'custom', name: 'TFieldPath' }];
// ❌ Wrong - using constraint type
generics: [{ type: 'custom', name: 'RequiredPath' }];