chore(local-dev): aml-local-refresh 同步拉取 AML_Frontend

新增 1b 步骤:前端在 main 分支 git pull --ff-only,并检查 package.json
是否变化;因本机 Node v24 与 Angular 11 不兼容,依赖变化只报告不自动安装。
报告要求增加前端 commit 与依赖变化一项。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main
fengruixiang 2026-11-03 07:55:14 +08:00
parent 290a82b190
commit a18fe048c6
1 changed files with 17 additions and 2 deletions

View File

@ -1,6 +1,6 @@
---
name: aml-local-refresh
description: Refresh the AML local dev stack - git pull AML_Backend, restore the newest AML-local-dev-*.bak into the mssql container as AbpAML, rebuild the httpapi-host image, and restart the API bypassing db-migrator. Use when asked to 更新/还原/重建/重启本地后端环境, "拉最新代码并还原数据库", "restore the latest bak", or when local portal endpoints 500 after the backend moved on.
description: Refresh the AML local dev stack - git pull AML_Backend (and AML_Frontend), restore the newest AML-local-dev-*.bak into the mssql container as AbpAML, rebuild the httpapi-host image, and restart the API bypassing db-migrator. Use when asked to 更新/还原/重建/重启本地后端环境, "拉最新代码并还原数据库", "restore the latest bak", or when local portal endpoints 500 after the backend moved on.
---
# AML 本地环境刷新(拉代码 + 还原库 + 重启服务)
@ -41,6 +41,21 @@ cd /Users/dev/projects/AML/AML_Backend && git status -sb | head -5 && git pull
- `failed to get/store: -25308` 是 macOS keychain 的噪音,不影响 pull。
- 拉完看一眼新迁移:`ls src/iCON.Abp.FX.EntityFrameworkCore.DbMigrations/Migrations/*.cs | grep -v Designer | tail -8`,留着第 4 步核对。
### 1b. 同步拉前端代码(AML_Frontend)
后端功能(批量操作、电话区号之类)通常前后端成对提交,只更后端会让前端对不上。前端不在 docker 栈里,这一步**只拉代码**:
```bash
cd /Users/dev/projects/AML/AML_Frontend && git status -sb | head -5
OLD=$(git rev-parse HEAD) && git pull --ff-only
git log -1 --format='%h %s'
git diff --name-only $OLD HEAD -- package.json # 有输出 = 依赖变了
```
- 分支是 **`main`**(不是 dev)。`origin/dev` 的内容平时会合进 `main`;拿不准就跑 `git rev-list --count origin/main..origin/dev`,是 0 就说明 main 已经是最新。工作区有改动同样先问用户。
- `package-lock.json` 被 gitignore 了,所以只能看 `package.json` 有没有变。
- **依赖变了也别自动 `npm install`**:本机 Node 是 v24,而 Angular 11 只支持 Node 10/12/14,直接装大概率失败;而且本机一直没装过前端依赖(没有 `node_modules`)。只在报告里写清楚 package.json 改了什么,由用户决定。
### 2. 起基础设施 + 停 host
```bash
@ -135,4 +150,4 @@ curl -s -X POST http://localhost:44331/api/amlPortal/plan/portal/GetPlanList
## 报告给用户
刷新完说清楚四件事:拉到的 commit、用的 .bak 文件名、库里的数量(表 / Plans / Editions / Tenants)、以及冒烟结果。
刷新完说清楚五件事:后端拉到的 commit、前端拉到的 commit(及 package.json 是否变了)、用的 .bak 文件名、库里的数量(表 / Plans / Editions / Tenants)、以及冒烟结果。