@ant-design/cli 6.3.3 → 6.3.4

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
@@ -24,7 +24,7 @@ Query component knowledge, analyze project usage, and guide migrations — fully
24
24
 
25
25
  ## 🤔 Why
26
26
 
27
- Code agents (Claude Code, Cursor, Copilot, 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.
27
+ 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.
28
28
 
29
29
  ```bash
30
30
  npx skills add ant-design/ant-design-cli # install as an agent skill
@@ -39,7 +39,7 @@ npx skills add ant-design/ant-design-cli # install as an agent skill
39
39
  - 🤖 **Agent-optimized** — `--format json` on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.
40
40
  - 🌍 **Bilingual** — Every component name, description, and doc has both English and Chinese. Switch with `--lang zh`.
41
41
  - 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference.
42
- - 🧩 **14 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
42
+ - 🧩 **13 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
43
43
 
44
44
  <br>
45
45
 
package/README.zh-CN.md CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  ## 🤔 为什么
26
26
 
27
- Code Agent(Claude Code、Cursor、Copilot、Codex、Gemini CLI)在拥有即时 API 数据访问能力时,能写出更好的 antd 代码。这个 CLI 正是为此而生 — **antd v4 / v5 / v6 的每个 Prop、Token、Demo 和 Changelog 条目**,本地打包,毫秒级查询。
27
+ Code Agent(Claude Code、Codex、Gemini CLI)在拥有即时 API 数据访问能力时,能写出更好的 antd 代码。这个 CLI 正是为此而生 — **antd v4 / v5 / v6 的每个 Prop、Token、Demo 和 Changelog 条目**,本地打包,毫秒级查询。
28
28
 
29
29
  ```bash
30
30
  npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
@@ -39,7 +39,7 @@ npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
39
39
  - 🤖 **Agent 优化** — 所有命令支持 `--format json`。结构化错误码与修复建议。stdout/stderr 严格分离。
40
40
  - 🌍 **双语输出** — 每个组件名、描述和文档均有中英文。通过 `--lang zh` 切换。
41
41
  - 🔮 **智能纠错** — 输入 `Buttn`?CLI 基于 Levenshtein 距离建议 `Button`,优先匹配首字母相同的候选。
42
- - 🧩 **14 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。
42
+ - 🧩 **13 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。
43
43
 
44
44
  <br>
45
45
 
package/data/v4.json.gz CHANGED
Binary file
package/data/v5.json.gz CHANGED
Binary file
Binary file
package/data/v6.json.gz CHANGED
Binary file
@@ -59,7 +59,7 @@
59
59
  "5.9": "5.9.4"
60
60
  },
61
61
  "v6": {
62
- "6.3": "6.3.3",
62
+ "6.3": "6.3.4",
63
63
  "6.0": "6.0.1",
64
64
  "6.1": "6.1.4",
65
65
  "6.2": "6.2.3"
package/dist/index.js CHANGED
@@ -1450,9 +1450,10 @@ function getDeprecatedProps(store) {
1450
1450
  }
1451
1451
  return result;
1452
1452
  }
1453
- function hasNearbyMatch(lines, i, lookahead, pattern) {
1453
+ function hasNearbyMatch(lines, i, lookahead, pattern, lookbehind = 0) {
1454
+ const start = Math.max(0, i - lookbehind);
1454
1455
  const end = Math.min(i + lookahead, lines.length);
1455
- for (let j = i; j < end; j++) {
1456
+ for (let j = start; j < end; j++) {
1456
1457
  if (pattern.test(lines[j])) return true;
1457
1458
  }
1458
1459
  return false;
@@ -1473,8 +1474,14 @@ function lintFile(filePath, deprecatedMap, only) {
1473
1474
  for (const compName of importedComponents) {
1474
1475
  const deprecations = deprecatedMap.get(compName);
1475
1476
  if (!deprecations) continue;
1477
+ const compRegex = new RegExp(`<${escapeRegExp(compName)}[\\s/>]`);
1476
1478
  for (const dep of deprecations) {
1477
- deprecatedChecks.push({ compName, dep, regex: new RegExp(`\\b${escapeRegExp(dep.prop)}\\b\\s*[=({]`) });
1479
+ deprecatedChecks.push({
1480
+ compName,
1481
+ dep,
1482
+ regex: new RegExp(`\\b${escapeRegExp(dep.prop)}\\b\\s*[=({]`),
1483
+ compRegex
1484
+ });
1478
1485
  }
1479
1486
  }
1480
1487
  }
@@ -1490,8 +1497,8 @@ function lintFile(filePath, deprecatedMap, only) {
1490
1497
  const hasTypography = importedComponents.includes("Typography");
1491
1498
  for (let i = 0; i < lines.length; i++) {
1492
1499
  const line = lines[i];
1493
- for (const { compName, dep, regex } of deprecatedChecks) {
1494
- if (regex.test(line)) {
1500
+ for (const { compName, dep, regex, compRegex } of deprecatedChecks) {
1501
+ if (regex.test(line) && hasNearbyMatch(lines, i, 3, compRegex, 10)) {
1495
1502
  issues.push({
1496
1503
  file: filePath,
1497
1504
  line: i + 1,
@@ -2817,7 +2824,7 @@ function collectAntdEnv(cwd, versionOverride) {
2817
2824
  function collectCliEnv() {
2818
2825
  let cliVersion;
2819
2826
  try {
2820
- cliVersion = "6.3.3";
2827
+ cliVersion = "6.3.4";
2821
2828
  } catch (err) {
2822
2829
  console.error("Failed to get CLI version:", err);
2823
2830
  cliVersion = "unknown";
@@ -2837,7 +2844,7 @@ function buildAntdIssueBody(fields) {
2837
2844
  const expected = fields.expected || PLACEHOLDER;
2838
2845
  const actual = fields.actual || PLACEHOLDER;
2839
2846
  const extra = fields.extra || "";
2840
- let body = `<!-- generated by @ant-design/cli. DO NOT REMOVE -->
2847
+ let body = `<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
2841
2848
 
2842
2849
  ### Reproduction link
2843
2850
 
@@ -3157,7 +3164,7 @@ function printUpdateNotice(currentVersion, latestVersion) {
3157
3164
  }
3158
3165
  async function checkForUpdate() {
3159
3166
  if (process.env.CI || process.env.NO_UPDATE_CHECK) return;
3160
- const currentVersion = "6.3.3";
3167
+ const currentVersion = "6.3.4";
3161
3168
  if (!valid(currentVersion)) return;
3162
3169
  const now = Date.now();
3163
3170
  const cache = readCache();
@@ -3176,7 +3183,7 @@ async function checkForUpdate() {
3176
3183
  }
3177
3184
 
3178
3185
  // src/index.ts
3179
- var CLI_VERSION = "6.3.3";
3186
+ var CLI_VERSION = "6.3.4";
3180
3187
  var program = new Command();
3181
3188
  program.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);
3182
3189
  program.addOption(new Option("-V, --cli-version", "Output the CLI version number"));