* fix: sync workflow never detects new antd versions
The check-version step compared local data/v6.json against
@ant-design/cli on npm — which is always true since CLI publishes
at the synced version, causing the workflow to skip every run.
Replace with a script that compares the antd npm latest version
against local data, and also covers the recovery scenario where
data was pushed but npm publish failed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: sync workflow never detects new antd versions
The check-version step compared local data/v6.json against
@ant-design/cli on npm — which is always true since CLI publishes
at the synced version, causing the workflow to skip every run.
Replace with a script that compares the antd npm latest version
against local data, and also covers the recovery scenario where
data was pushed but npm publish failed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add antd v3 support design spec
Design for adding antd 3.x support to enable migration assistance
and legacy project queries. Covers data extraction, command support
matrix, and enhanced v3→v4 migration knowledge.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add antd v3 support
- Add v3 data extraction with demo format compatibility
- Generate v3.json and v3.26.20.json data files
- Add v3-to-v4 migration knowledge module
- Return UNSUPPORTED_VERSION_FEATURE for token/semantic on v3
- Update spec.md with v3 support documentation
Closes#66
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address PR review comments
- Fix regex \Z anchor to $ for JS compatibility in demo extractor
- Fix v3 theming docs URL (3x.ant.design)
- Remove redundant Tree filterTreeNode migration entry
- Correct Table render description (signature unchanged)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: update design spec for v3 support
- Add language tag to code block
- Fix v3 theming docs URL to 3x.ant.design
- Update migration module path to match implementation
- Correct BackTop and Less variables migration notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address remaining PR review comments
- Fix enMatch regex to use lookahead for zh-CN section
- Make JSX code block regex more flexible (jsx or js)
- Correct ConfigProvider migration description (introduced in v4)
- Update design doc with correct module path and migration notes
- Update snapshot for v3 Watermark component
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add comprehensive v3 test coverage
- Add e2e tests for `antd migrate 3 4` command
- Add v3 error tests for token and semantic commands
- Add v3 version detection tests
- Add v3 data loading tests (components, snapshots)
- Add tests for v3-specific components (Mention, Icon, LocaleProvider)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Contributor mentions like [@guoyunhe](https://github.com/guoyunhe) were
being stripped to [](https://github.com/guoyunhe) because the regex
only removed the @username portion, leaving an empty link shell.
Fix the extractor to match and remove the full contributor link pattern
first, then fall back to stripping bare @mentions.
Also patch all 65 existing data snapshot files (28,337 occurrences fixed)
and update affected test snapshots.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
parseTableRow now replaces \| with a placeholder before splitting on |,
then restores it. This fixes 400+ malformed props across all data files
where multi-value union types like \`primary\` \| \`dashed\` \| \`link\`
were split across wrong columns (type/default/since all got wrong values).
Also removes the defensive load-time \ stripping from normalizeStore
(no longer needed after data regeneration), keeping only deduplication.
Adds scripts/extractors/__tests__/props.test.ts and expands vitest config
to include scripts/**/*.test.ts.
Use git-show to read markdown from each version's tag and inject
doc/docZh into the 61 existing snapshot files without full re-extraction.
Also adds scripts/patch-doc-fields.ts for future use.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bundle raw markdown content (doc/docZh) in component data during
extraction, and expose it via a new `doc` command. This complements
`antd info` by providing the complete unprocessed API documentation
for cases where structured prop extraction is insufficient.
- src/types.ts: Add `doc` and `docZh` optional fields to ComponentData
- scripts/extract.ts: Bundle raw markdown (frontmatter-stripped) into each component during extraction
- src/commands/doc.ts: New command — outputs markdown or JSON, with error handling and fuzzy match suggestions
- src/index.ts: Register the new doc command
- data/v5.json, data/v5.29.3.json: Re-extracted with doc/docZh fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Some components (Form, Cascader) split their API across multiple ## sections:
## API → main Form props
## Form.Item → Form.Item props
## Hooks → ### Form.useForm, ### Form.useWatch, ...
## Interface → ### FormInstance (contains validateFields), ### Rule, ...
The previous parser stopped at the first ## heading after ## API,
so everything in ## Hooks and ## Interface was silently dropped.
Fix: collect all ## sections from ## API through all intermediate
API sections, stopping only at terminal sections (Design Token, FAQ,
Note, Examples, Semantic DOM). Within each block, ## headings provide
the sub-component label for content appearing before the first ###.
Result for Form (v5.29.3):
Before: main=25, subComponentProps={}
After: main=25 | Form.Item(30) Form.FormInstance(15, incl. validateFields)
Form.List(4) Form.Rule(15) Form.WatchOptions(2) etc.
Note: Form.useWatch is a function-type annotation (not a table) so it
cannot be extracted as props — this is a docs format limitation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Improve sub-component props extraction to correctly handle all naming
conventions in antd's markdown docs, not just Splitter:
- Add 'Param' to recognized column headers (fixes Menu losing its props)
- Strip HTML <Badge> and {#anchor} noise from section labels
- Expanded isMainSection() to match:
- "Select props" / "Anchor Props" (ComponentName + " props/API" suffix)
- "Tree props" for TreeSelect (base word is prefix of component name)
- "Radio/Radio.Button" slash format
- "Mention" → "Mentions" (singular/plural variants, ≤2 chars diff)
- "common API" generic phrase
Before: Select main=0, Radio main=0, Tree main=0, FloatButton main=0...
After: all main props correctly in props[], sub-types in subComponentProps
Also re-extracted data/v5.json and data/v5.29.3.json with improved extractor.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the `info` command mixed all API table rows together, so
`antd info Splitter` incorrectly listed Panel props (defaultSize, min,
max, size, collapsible, resizable) alongside main Splitter props.
Changes:
- scripts/extractors/props.ts: split API section by ### headings;
tables under the component name become main props, other sub-sections
(e.g. "Panel") become subComponentProps keyed as "Splitter.Panel"
- scripts/extract.ts: pass componentName to extractProps; store
subComponentProps in the JSON when present
- src/types.ts: add subComponentProps?: Record<string, PropData[]>
to ComponentData
- src/commands/info.ts: render sub-component sections below the main
table in text/markdown output; include subComponentProps in JSON output
- data: re-extracted v5.json and v5.29.3.json; manually patched all v5
(5.21–5.28) and v6 snapshots to separate Splitter.Panel props
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous string-based check missed cases where `debug` attribute
appears after other attributes (e.g. `iframe="800" debug`). Switch to
a regex that matches `debug` anywhere within the <code> tag.
Regenerate all per-minor snapshots and latest v4/v5/v6.json with
the corrected filter applied.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- v4: 25 minor series (4.0.x ~ 4.24.x), extracted from each representative patch tag
- v5: 30 minor series (5.0.x ~ 5.29.x)
- v6: 4 minor series (6.0.x ~ 6.3.x)
- Update data/versions.json with all 59 minor entries
- Fix bootstrap-snapshots.ts to use git checkout -f to handle untracked file conflicts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add loadMetadataForVersion() to loader.ts with 3-level resolution:
exact minor match → nearest earlier minor → fallback to latest major
- Add data/versions.json as version index (minor series → snapshot tag)
- Update all 7 command files to use loadMetadataForVersion(versionInfo.version)
- Update sync.yml to extract per-minor snapshots on each daily sync
- Add scripts/bootstrap-snapshots.ts for one-time historical backfill
- Update spec.md with multi-snapshot architecture documentation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add scripts/extract.ts pipeline that extracts antd metadata (components,
props, demos, tokens, semantic, changelog, FAQ) from source. Add daily
GitHub Actions workflow to detect new antd releases and auto-publish.
CLI version now aligns with antd version.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>