文档运维流程(Docs Operations Workflow)
1. Daily Development Loop
bash
npm run dev
npm run test:run
npm run lint
npm run docs:buildnpm run dev runs build:demo first and then starts VitePress, which keeps live docs and embedded demos in sync.
2. Content Update Rules
When code changes, update docs in the same PR with this order:
- Update the relevant component guide in
docs/components/*.md. - Update API reference pages in
docs/api/*.md. - Update demo pages under
docs/public/components/*.htmlif behavior changed. - Update migration or troubleshooting guide when compatibility changes.
3. Pre-merge Quality Gate
bash
npm run test:run
npm run lint
npm run docs:build
npm run docs:test:smoke:ciMerge only when tests, lint, docs build, and docs smoke pass together.
4. Release Workflow (Tag-driven)
bash
npm run release:check -- vX.Y.Z
npm run test:run
npm run lint
npm run build
npm run build:demo
npm run docs:build
npm run docs:test:smoke:ci
git add -A
git commit -m "release: vX.Y.Z"
git tag -a vX.Y.Z -m "vX.Y.Z"
git push --follow-tags5. Post-release Documentation Tasks
- Update
CHANGELOG.mdwith release notes. - Confirm homepage highlights match the new feature set.
- Validate API examples and quick start snippets against published package.
- If there are breaking changes, update
docs/guides/migration-guide.md.
6. CI Deployment Gate
.github/workflows/pages.ymlnow runsnpm run docs:test:smoke:cibefore uploading Pages artifacts..github/workflows/npm-publish.ymlnow runsnpm run release:verifybefore npm publish.- If smoke tests fail in CI, download the uploaded
docs-smoke-report-*artifact and openindex.html. - Local report viewer:
npx playwright show-report playwright-report/docs-smoke. - Both workflows enforce job timeouts to avoid hanging runners (
pages: 20m/10m,npm-publish: 25m).
7. Recommended Team Convention
- API change requires API doc update.
- Component behavior change requires at least one live demo update.
- New feature is not complete until docs and changelog are updated.