From fbdaf0375c0f069a35e4a50274786ea16cc0b3b1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 21 May 2026 10:53:12 +0800 Subject: [PATCH] docs: add upgrade FAQ to cheatsheets Add guidance for upgrading Ant Design Pro projects using the pro-upgrade skill in both Chinese and English cheatsheets. Co-Authored-By: Claude Opus 4.7 --- docs/cheatsheet.en-US.md | 3 +++ docs/cheatsheet.zh-CN.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/cheatsheet.en-US.md b/docs/cheatsheet.en-US.md index f5eae4ee..3bbe1936 100644 --- a/docs/cheatsheet.en-US.md +++ b/docs/cheatsheet.en-US.md @@ -492,6 +492,9 @@ Edit `colorPrimary` in `config/defaultSettings.ts`. Use SettingDrawer for live p **Q: How to add global state?** Create a file in `src/models/` exporting a custom Hook, then use `useModel('filename')` in components. +**Q: How to upgrade the project?** +Run `/pro-upgrade` in Claude Code at the project root — AI will auto-diff the latest Ant Design Pro template and upgrade your project (deps, config, code patterns, etc.). For other AI assistants, paste the content from `AGENTS.md`. + **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). diff --git a/docs/cheatsheet.zh-CN.md b/docs/cheatsheet.zh-CN.md index 65ed4418..053cd87d 100644 --- a/docs/cheatsheet.zh-CN.md +++ b/docs/cheatsheet.zh-CN.md @@ -492,6 +492,9 @@ export default { **Q: 如何添加全局状态?** 在 `src/models/` 下创建文件,导出自定义 Hook,组件中通过 `useModel('文件名')` 使用。 +**Q: 如何升级项目?** +在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新 Ant Design Pro 模板并完成升级(依赖、配置、代码模式等)。如使用其他 AI 助手,可将 `AGENTS.md` 中的内容提供给它。 + **Q: 如何部署?** `npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。