Skip to main content

Maintenance Guide

This guide records local development, verification, builds, and documentation maintenance for DynamicForm. It is for project maintainers, not component users.

Local Commands

pnpm run start # Vite demo server
pnpm run build # tsup package build
pnpm run type-check # TypeScript check
pnpm run lint:check # ESLint check without fixes
pnpm run lint # ESLint with fixes
pnpm run format # Prettier for src and demos
pnpm run test # Node test runner

The repository has pnpm-lock.yaml, so pnpm is the default package manager.

Demos and Verification

Vite demos live in demos/ and are used for manual behavior checks. The current DemoSelector exposes storeBoundary, customHandlers, customComponents, formValidation, uiConfig, renderExtension, and compilerFoundation.

Run demos with:

pnpm run start

Tests

Run tests with:

pnpm run test

Current tests include a store boundary check documenting that reducer/effect store state must not hold Ant Design Form runtime values, errors, touched state, warnings, or validating state.

For source changes, prefer:

  1. pnpm run type-check
  2. pnpm run lint:check
  3. pnpm run test
  4. pnpm run build

For UI behavior, also inspect the relevant demo in the browser.

Documentation Maintenance

When library behavior, public APIs, or usage changes, update the closest library topic file in packages/dynamic-form/docs/. When workspace layout, release, CI, site planning, or repository governance changes, update root docs/. Update the root README.md if public API, high-level feature summaries, or documentation entry points change. Update AGENTS.md when the change creates useful project knowledge for future agents.

Project documentation is written in Chinese by default. The docs-site i18n/ directory is the exception and continues to maintain English translations.

Do not reintroduce the old overlapping documentation set, and do not copy demo business logic into the site directory.

Release Notes Maintenance

The repository root CHANGELOG.md is the complete release log source. The docs-site /docs/changelog page keeps only a reader-focused summary, migration impact, and related topic entry points. Keep both sources consistent when release records change, but do not copy the complete release log verbatim into the site page.

Implementation Guardrails

Preserve the Config -> State -> Runtime -> Consumer architecture. Do not add a reducer-side value store. Use fieldRegistry to locate fields because fields can be flat or grouped. Normalize behavior meta through shared utilities. Keep validation filtered by runtime capabilities. Put business-specific behavior in custom components, handlers, or render hooks rather than hard-coding it in core rendering.

Build Output

dist/ is generated by pnpm run build and is a reproducible artifact. Do not treat it as source documentation.