Browse Source

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 <noreply@anthropic.com>
pull/11801/head
afc163 5 months ago
parent
commit
fbdaf0375c
  1. 3
      docs/cheatsheet.en-US.md
  2. 3
      docs/cheatsheet.zh-CN.md

3
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?** **Q: How to add global state?**
Create a file in `src/models/` exporting a custom Hook, then use `useModel('filename')` in components. 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?** **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). `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).

3
docs/cheatsheet.zh-CN.md

@ -492,6 +492,9 @@ export default {
**Q: 如何添加全局状态?** **Q: 如何添加全局状态?**
在 `src/models/` 下创建文件,导出自定义 Hook,组件中通过 `useModel('文件名')` 使用。 在 `src/models/` 下创建文件,导出自定义 Hook,组件中通过 `useModel('文件名')` 使用。
**Q: 如何升级项目?**
在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新 Ant Design Pro 模板并完成升级(依赖、配置、代码模式等)。如使用其他 AI 助手,可将 `AGENTS.md` 中的内容提供给它。
**Q: 如何部署?** **Q: 如何部署?**
`npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。 `npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。

Loading…
Cancel
Save