Browse Source

fix: address PR review feedback

- Preflight warning: change from Chinese-only to English
- Dependency merging: preserve user deps not found in template by default
- antd migrate: use version placeholders instead of hardcoded "5 6"
- Business files: use recursive glob src/services/**/*.ts
- Cheatsheet: temper "upgrade" to "assist" to avoid overpromising

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pull/11801/head
afc163 5 months ago
parent
commit
2a97a17d8f
  1. 12
      .claude/skills/pro-upgrade/SKILL.md
  2. 2
      docs/cheatsheet.en-US.md
  3. 2
      docs/cheatsheet.zh-CN.md

12
.claude/skills/pro-upgrade/SKILL.md

@ -29,7 +29,7 @@ You are an Ant Design Pro upgrade assistant. Your task is to help users upgrade
Before starting, confirm:
1. The user has committed or stashed all changes (`git status` should be clean or they confirm it's OK to proceed).
2. If not clean, remind them: **"请先 commit 或 stash 你的更改,升级过程会修改多个文件。"** and wait for them to confirm.
2. If not clean, remind them to commit or stash their changes first (e.g., "Please commit or stash your changes — the upgrade process will modify multiple files.") and wait for them to confirm.
## Upgrade Flow
@ -72,7 +72,7 @@ Separate the user's project files into **framework files** (Pro-owned, rarely cu
- `src/pages/**` — user pages
- `src/components/**` — user components
- `src/models/**` — user models
- `src/services/*.ts` — custom service files (NOT the `ant-design-pro/` subdirectory)
- `src/services/**/*.ts` — custom service files (NOT the `ant-design-pro/` subdirectory)
- `src/locales/**` — user translations (framework keys may need updating)
- `src/utils/**` — user utilities
- `mock/**` — user mocks
@ -93,7 +93,7 @@ For each framework file, read both the user's version and the template version.
Apply changes with these rules:
**Framework files — adopt template structure, preserve user customizations:**
- `package.json`: update dependency versions to match template. Keep any extra deps the user added. Remove deps only if the template explicitly removed them (check the template's `package.json`).
- `package.json`: update dependency versions to match template. Keep any extra deps the user added. If a dependency exists in the user's project but not in the template, assume it is a user customization and preserve it.
- `config/routes.ts`: adopt the template's route structure for framework pages, but keep all user-added routes intact.
- `config/proxy.ts`: adopt structure, preserve user's proxy targets.
- Other framework files: adopt the template version, preserving any user customizations that are clearly intentional (comments, extra exports, business logic mixed in).
@ -115,12 +115,14 @@ npx antd env --format json
npx antd lint ./src --format json --only deprecated
```
If the user is upgrading across major antd versions (e.g., 5→6), also run:
If the user is upgrading across major antd versions, also run:
```bash
npx antd migrate 5 6 --format json
npx antd migrate <current_major> <target_major> --format json
```
Detect the current major version from the user's `package.json` and the target from the template's.
Address any findings by updating the flagged code.
### Step 6 — Install and verify

2
docs/cheatsheet.en-US.md

@ -497,7 +497,7 @@ First, install the pro-upgrade skill into your project:
```bash
npx skills add ant-design/ant-design-pro
```
Then run `/pro-upgrade` in Claude Code at the project root — AI will auto-diff the latest template and upgrade your project (deps, config, code patterns, etc.). For other AI assistants, paste the content of `.claude/skills/pro-upgrade/SKILL.md` to them.
Then run `/pro-upgrade` in Claude Code at the project root — AI will auto-diff the latest template and assist your upgrade (deps, config, code patterns, etc.), with conservative handling for ambiguous merges. For other AI assistants, paste the content of `.claude/skills/pro-upgrade/SKILL.md` to them.
**Q: How to deploy?**
`npm run build` generates `dist/`. Deploy to any static file server. Set `publicPath` for non-root deployments. `npm run deploy` builds and publishes to GitHub Pages automatically (pushes to gh-pages branch).

2
docs/cheatsheet.zh-CN.md

@ -497,7 +497,7 @@ export default {
```bash
npx skills add ant-design/ant-design-pro
```
然后在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新模板并完成升级(依赖、配置、代码模式等)。如使用其他 AI 助手,可将 `.claude/skills/pro-upgrade/SKILL.md` 中的内容提供给它。
然后在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新模板并辅助完成升级(依赖、配置、代码模式等),遇到冲突时会保守处理并询问确认。如使用其他 AI 助手,可将 `.claude/skills/pro-upgrade/SKILL.md` 中的内容提供给它。
**Q: 如何部署?**
`npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。

Loading…
Cancel
Save