@ant-design/cli 6.3.6 → 6.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,7 @@ Query component knowledge, analyze project usage, and guide migrations — fully
26
26
 
27
27
  ## 🤔 Why
28
28
 
29
- Code agents (Claude Code, Codex, Gemini CLI) write better antd code when they have instant access to the right API data. This CLI gives them exactly that — **every prop, token, demo, and changelog entry for antd v4 / v5 / v6**, bundled locally, queryable in milliseconds.
29
+ Code agents (Claude Code, Codex, Gemini CLI) write better antd code when they have instant access to the right API data. This CLI gives them exactly that — **every prop, token, demo, and changelog entry for antd v3 / v4 / v5 / v6**, bundled locally, queryable in milliseconds.
30
30
 
31
31
  ```bash
32
32
  npx skills add ant-design/ant-design-cli # install as an agent skill
@@ -37,7 +37,7 @@ npx skills add ant-design/ant-design-cli # install as an agent skill
37
37
  ## ✨ Highlights
38
38
 
39
39
  - 📦 **Fully offline** — All metadata ships with the package. No network calls, no latency, no API keys.
40
- - 🎯 **Version-accurate** — 55+ per-minor snapshots across v4/v5/v6. Query the exact API surface of `antd@5.3.0`, not just "latest v5".
40
+ - 🎯 **Version-accurate** — 55+ per-minor snapshots across v3/v4/v5/v6. Query the exact API surface of `antd@5.3.0`, not just "latest v5".
41
41
  - 🤖 **Agent-optimized** — `--format json` on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.
42
42
  - 🌍 **Bilingual** — Every component name, description, and doc has both English and Chinese. Switch with `--lang zh`.
43
43
  - 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference.
@@ -115,6 +115,7 @@ antd doctor # Diagnose project issues
115
115
  antd env # Collect env info for bug reports
116
116
  antd usage ./src # Analyze antd imports in project
117
117
  antd lint ./src # Check deprecated APIs & best practices
118
+ antd migrate 3 4 # v3 → v4 migration guide
118
119
  antd migrate 4 5 --apply ./src # Agent-ready migration prompt
119
120
  ```
120
121
 
@@ -349,9 +350,10 @@ Use `--antd-alias <source>` to treat additional package names as aliases of `ant
349
350
 
350
351
  ### `antd migrate <from> <to>`
351
352
 
352
- v4→v5 covers 25+ migration steps; v5→v6 covers 30+. Each step includes component name, breaking flag, search pattern, and before/after code.
353
+ v3→v4 covers 15+ migration steps; v4→v5 covers 25+ migration steps; v5→v6 covers 30+. Each step includes component name, breaking flag, search pattern, and before/after code.
353
354
 
354
355
  ```bash
356
+ antd migrate 3 4 # v3 → v4 migration
355
357
  antd migrate 4 5 # full checklist
356
358
  antd migrate 4 5 --component Select # component-specific
357
359
  antd migrate 4 5 --apply ./src # generate agent migration prompt
package/README.zh-CN.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## 🤔 为什么
28
28
 
29
- Code Agent(Claude Code、Codex、Gemini CLI)在拥有即时 API 数据访问能力时,能写出更好的 antd 代码。这个 CLI 正是为此而生 — **antd v4 / v5 / v6 的每个 Prop、Token、Demo 和 Changelog 条目**,本地打包,毫秒级查询。
29
+ Code Agent(Claude Code、Codex、Gemini CLI)在拥有即时 API 数据访问能力时,能写出更好的 antd 代码。这个 CLI 正是为此而生 — **antd v3 / v4 / v5 / v6 的每个 Prop、Token、Demo 和 Changelog 条目**,本地打包,毫秒级查询。
30
30
 
31
31
  ```bash
32
32
  npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
@@ -37,7 +37,7 @@ npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
37
37
  ## ✨ 亮点
38
38
 
39
39
  - 📦 **完全离线** — 所有元数据随包安装,无需网络请求,无延迟,无 API Key。
40
- - 🎯 **版本精确** — 跨 v4/v5/v6 的 55+ 小版本快照。查询 `antd@5.3.0` 的精确 API,而非仅 "最新 v5"。
40
+ - 🎯 **版本精确** — 跨 v3/v4/v5/v6 的 55+ 小版本快照。查询 `antd@5.3.0` 的精确 API,而非仅 "最新 v5"。
41
41
  - 🤖 **Agent 优化** — 所有命令支持 `--format json`。结构化错误码与修复建议。stdout/stderr 严格分离。
42
42
  - 🌍 **双语输出** — 每个组件名、描述和文档均有中英文。通过 `--lang zh` 切换。
43
43
  - 🔮 **智能纠错** — 输入 `Buttn`?CLI 基于 Levenshtein 距离建议 `Button`,优先匹配首字母相同的候选。
@@ -115,6 +115,7 @@ antd doctor # 诊断项目配置问题
115
115
  antd env # 收集环境信息用于 Bug 报告
116
116
  antd usage ./src # 分析项目中的 antd 导入
117
117
  antd lint ./src # 检查废弃 API 和最佳实践
118
+ antd migrate 3 4 # v3 → v4 迁移指南
118
119
  antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
119
120
  ```
120
121
 
@@ -349,9 +350,10 @@ antd lint ./src --only deprecated --format json --antd-alias @shared-components
349
350
 
350
351
  ### `antd migrate <from> <to>`
351
352
 
352
- v4→v5 包含 25+ 迁移步骤,v5→v6 包含 30+。每个步骤包含组件名、破坏性标记、搜索正则和前后代码对比。
353
+ v3→v4 包含 15+ 迁移步骤,v4→v5 包含 25+ 迁移步骤,v5→v6 包含 30+。每个步骤包含组件名、破坏性标记、搜索正则和前后代码对比。
353
354
 
354
355
  ```bash
356
+ antd migrate 3 4 # v3 → v4 迁移
355
357
  antd migrate 4 5 # 完整迁移清单
356
358
  antd migrate 4 5 --component Select # 指定组件
357
359
  antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
Binary file
package/data/v6.json.gz CHANGED
Binary file
@@ -62,7 +62,7 @@
62
62
  "5.9": "5.9.4"
63
63
  },
64
64
  "v6": {
65
- "6.3": "6.3.6",
65
+ "6.3": "6.3.7",
66
66
  "6.0": "6.0.1",
67
67
  "6.1": "6.1.4",
68
68
  "6.2": "6.2.3"
package/dist/index.js CHANGED
@@ -17792,7 +17792,7 @@ function collectAntdEnv(cwd, versionOverride) {
17792
17792
  function collectCliEnv() {
17793
17793
  let cliVersion;
17794
17794
  try {
17795
- cliVersion = "6.3.6";
17795
+ cliVersion = "6.3.7";
17796
17796
  } catch (err) {
17797
17797
  console.error("Failed to get CLI version:", err);
17798
17798
  cliVersion = "unknown";
@@ -32507,7 +32507,7 @@ function registerMcpCommand(program3) {
32507
32507
  const opts = program3.opts();
32508
32508
  const versionInfo = detectVersion(opts.version);
32509
32509
  const server = new Server(
32510
- { name: "antd", version: "6.3.6" },
32510
+ { name: "antd", version: "6.3.7" },
32511
32511
  { capabilities: { tools: {}, prompts: {} } }
32512
32512
  );
32513
32513
  const handleTool = createToolHandler({
@@ -32629,7 +32629,7 @@ function printUpdateNotice(currentVersion, latestVersion) {
32629
32629
  }
32630
32630
  async function checkForUpdate() {
32631
32631
  if (process.env.CI || process.env.NO_UPDATE_CHECK) return;
32632
- const currentVersion = "6.3.6";
32632
+ const currentVersion = "6.3.7";
32633
32633
  if (!valid(currentVersion)) return;
32634
32634
  const now = Date.now();
32635
32635
  const cache = readCache();
@@ -32648,7 +32648,7 @@ async function checkForUpdate() {
32648
32648
  }
32649
32649
 
32650
32650
  // src/index.ts
32651
- var CLI_VERSION = "6.3.6";
32651
+ var CLI_VERSION = "6.3.7";
32652
32652
  var program2 = new Command();
32653
32653
  program2.name("antd").description("CLI tool for querying antd knowledge and analyzing antd usage").option("--format <format>", "Output format: json, text, or markdown", "text").option("--version <version>", "Target antd version (e.g. 5.20.0)").option("--lang <lang>", "Output language: en or zh", "en").option("--detail", "Full information output", false);
32654
32654
  program2.addOption(new Option("-V, --cli-version", "Output the CLI version number"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/cli",
3
- "version": "6.3.6",
3
+ "version": "6.3.7",
4
4
  "description": "CLI tool for querying antd knowledge and analyzing antd usage in projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@ allowed-tools:
15
15
 
16
16
  # Ant Design CLI
17
17
 
18
- You have access to `@ant-design/cli` — a local CLI tool with bundled antd metadata for v4/v5/v6. Use it to query component knowledge, analyze projects, and guide migrations. All data is offline, no network needed.
18
+ You have access to `@ant-design/cli` — a local CLI tool with bundled antd metadata for v3/v4/v5/v6. Use it to query component knowledge, analyze projects, and guide migrations. All data is offline, no network needed.
19
19
 
20
20
  ## Setup
21
21
 
@@ -83,11 +83,12 @@ antd doctor --format json
83
83
 
84
84
  ### 4. Migrating between versions
85
85
 
86
- When the user wants to upgrade antd (e.g., v4 → v5):
86
+ When the user wants to upgrade antd (e.g., v3 → v4 or v4 → v5):
87
87
 
88
88
  ```bash
89
89
  # Get full migration checklist
90
- antd migrate 4 5 --format json
90
+ antd migrate 3 4 --format json # v3 → v4
91
+ antd migrate 4 5 --format json # v4 → v5
91
92
 
92
93
  # Check migration for a specific component
93
94
  antd migrate 4 5 --component Select --format json
@@ -246,7 +247,7 @@ This provides 7 tools (`antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_
246
247
  ## Key Rules
247
248
 
248
249
  1. **Always query before writing** — Don't guess antd APIs from memory. Run `antd info` first.
249
- 2. **Match the user's version** — If the project uses antd 4.x, pass `--version 4.24.0`. The CLI auto-detects from `node_modules` if no flag is given.
250
+ 2. **Match the user's version** — If the project uses antd 3.x or 4.x, pass `--version 3.26.0` or `--version 4.24.0`. The CLI auto-detects from `node_modules` if no flag is given.
250
251
  3. **Use `--format json`** — Every command supports it. Parse the JSON output rather than regex-matching text output.
251
252
  4. **Check before suggesting migration** — Run `antd changelog <v1> <v2>` and `antd migrate` before advising on version upgrades.
252
253
  5. **Lint after changes** — After writing or modifying antd code, run `antd lint` on the changed files to catch deprecated or problematic usage.