mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 00:40:30 +08:00
7b2bd307f1
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.) - frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts - scripts/: build, test-env, tools (Docker Compose, service templates, API parity) - docs/: AGENTS.md, superpowers specs, architecture docs - .gitignore: standard Java/Maven exclusions Moved from legacy maven-*/ root layout to backend/ organized structure.
921 lines
26 KiB
Markdown
921 lines
26 KiB
Markdown
# 目录结构重组 Implementation Plan
|
|
|
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
|
|
**Goal:** Restructure the monorepo directory tree — rename to kebab-case English, separate source/runtime/packages/archive, consolidate scripts, remove naming inconsistencies — while preserving all files and git history.
|
|
|
|
**Architecture:** The project spans two git repos: `源码/` (submodule, ~29K files) and the parent repo (星中心/, 部署包/, data_backup/, etc.). Each task specifies which repo it operates in. Cross-repo moves use `mv` + separate `git add`/`git rm` in each repo. No files are deleted — outdated content is relocated to `archive/`.
|
|
|
|
**Tech Stack:** git, bash, Python (path update scripts)
|
|
|
|
---
|
|
|
|
### Task 0: Safety Preflight
|
|
|
|
**Context:** Verify workspace state before any changes.
|
|
|
|
- [ ] **Step 0.1: Check git status in parent repo**
|
|
|
|
Run: `git status`
|
|
Expected: clean working tree, or note ongoing work
|
|
|
|
- [ ] **Step 0.2: Check git status in submodule (源码/)**
|
|
|
|
Run: `git status`
|
|
Expected: clean working tree (last commit was the spec doc)
|
|
|
|
- [ ] **Step 0.3: Record the current tree state for rollback**
|
|
|
|
Run: `git rev-parse HEAD` (parent repo) and `git rev-parse HEAD` (submodule)
|
|
Expected: record these SHAs for rollback reference
|
|
|
|
---
|
|
|
|
### Phase 1: Parent Repo — Rename Top-Level Directories
|
|
|
|
---
|
|
|
|
### Task 1: Rename 星中心/ → runtime/
|
|
|
|
**Files:**
|
|
- Rename: `星中心/` → `runtime/`
|
|
|
|
- [ ] **Step 1.1: git mv 星中心 to runtime**
|
|
|
|
Run (from repo root):
|
|
```bash
|
|
git mv 星中心 runtime
|
|
```
|
|
Expected: directory renamed, no content changes
|
|
|
|
- [ ] **Step 1.2: Rename internal directories (remove `_01-` prefix)**
|
|
|
|
```bash
|
|
git mv runtime/cwos_manager_01-cwos_manager runtime/cwos-manager
|
|
git mv runtime/cwos_system_api_01-cwos_system_api runtime/cwos-system-api
|
|
git mv runtime/cw-elevator-application-V1.0.0.20211103 runtime/elevator-v1
|
|
git mv runtime/ninca_crk_std_01-ninca_crk_std_backend runtime/ninca-crk-std
|
|
git mv runtime/ninca_qk_alarm_app_01-ninca_qk_alarm_app runtime/ninca-qk-alarm
|
|
git mv runtime/ninca-crk-std-backend-V2.9.1_20210630 runtime/ninca-crk-std-lib
|
|
```
|
|
Expected: all 6 directories renamed
|
|
|
|
- [ ] **Step 1.3: Rename internal frontend subdirs (runtime/frontend/)**
|
|
|
|
```bash
|
|
git mv runtime/frontend/cwos_manager_frontend runtime/frontend/cwos-manager-frontend
|
|
```
|
|
Expected: dir renamed
|
|
|
|
- [ ] **Step 1.4: Verify**
|
|
|
|
Run: `ls runtime/`
|
|
Expected: `cwos-manager/ cwos-system-api/ elevator-v1/ frontend/ ninca-crk-std/ ninca-crk-std-lib/ ninca-qk-alarm/`
|
|
|
|
- [ ] **Step 1.5: Commit**
|
|
|
|
```bash
|
|
git add runtime/
|
|
git commit -m "refactor: rename 星中心/ => runtime/, normalize service dir names"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 2: Rename 部署包/ → packages/
|
|
|
|
**Files:**
|
|
- Rename: `部署包/` → `packages/`
|
|
|
|
- [ ] **Step 2.1: git mv**
|
|
|
|
Run (from repo root):
|
|
```bash
|
|
git mv 部署包 packages
|
|
```
|
|
Expected: directory renamed
|
|
|
|
- [ ] **Step 2.2: Rename tar.gz files (remove `01-` prefix)**
|
|
|
|
List all files first:
|
|
```bash
|
|
ls packages/*.tar.gz
|
|
```
|
|
|
|
For each file, rename. Example pattern:
|
|
```bash
|
|
git mv packages/cwos_manager_01-cwos_manager.tar.gz packages/cwos-manager.tar.gz
|
|
git mv packages/cwos_system_api_01-cwos_system_api.tar.gz packages/cwos-system-api.tar.gz
|
|
git mv packages/ninca_common_backend_01-ninca_common_backend.tar.gz packages/ninca-common-backend.tar.gz
|
|
git mv packages/ninca_common_component_organization_01-ninca_common_component_organization.tar.gz packages/ninca-common-component-organization.tar.gz
|
|
git mv packages/ninca_common_monitor_app_01-ninca_common_monitor_app.tar.gz packages/ninca-common-monitor-app.tar.gz
|
|
git mv packages/ninca_common_snap_app_01-ninca_common_snap_app.tar.gz packages/ninca-common-snap-app.tar.gz
|
|
git mv packages/ninca_common_vehicle_app_01-ninca_common_vehicle_app.tar.gz packages/ninca-common-vehicle-app.tar.gz
|
|
git mv packages/ninca_crk_std_01-ninca_crk_std_backend.tar.gz packages/ninca-crk-std-backend.tar.gz
|
|
git mv packages/ninca_md_heat_analysis_01-ninca_md_heat_analysis_backend.tar.gz packages/ninca-md-heat-analysis-backend.tar.gz
|
|
git mv packages/ninca_qk_alarm_app_01-ninca_qk_alarm_app.tar.gz packages/ninca-qk-alarm-app.tar.gz
|
|
git mv packages/ninca-person-file-app-V2.9.2_20210216.tar.gz packages/ninca-person-file-app-v2.9.2.tar.gz
|
|
git mv packages/frontend.tar.gz packages/frontend.tar.gz
|
|
git mv packages/cw-elevator-application-V1.0.0.20211103.tar.gz packages/cw-elevator-application-v1.0.0.tar.gz
|
|
```
|
|
|
|
- [ ] **Step 2.3: Rename expanded component directory**
|
|
|
|
```bash
|
|
git mv packages/ninca_common_component_organization_01-ninca_common_component_organization packages/ninca-common-component-organization
|
|
```
|
|
Then rename sub-subdirs:
|
|
```bash
|
|
git mv packages/ninca-common-component-organization/ninca_common_component_organization_01-ninca_common_component_organization207 packages/ninca-common-component-organization/v207
|
|
git mv packages/ninca-common-component-organization/ninca_common_component_organization_01-ninca_common_component_organization208 packages/ninca-common-component-organization/v208
|
|
git mv packages/ninca-common-component-organization/ninca_common_component_organization_01-ninca_common_component_organization209 packages/ninca-common-component-organization/v209
|
|
```
|
|
|
|
- [ ] **Step 2.4: Verify**
|
|
|
|
Run: `ls packages/` and `ls packages/ninca-common-component-organization/`
|
|
|
|
- [ ] **Step 2.5: Commit**
|
|
|
|
```bash
|
|
git add packages/
|
|
git commit -m "refactor: rename 部署包/ => packages/, normalize tar.gz names"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 3: Rename data_backup/ → data-backups/
|
|
|
|
**Files:**
|
|
- Rename: `data_backup/` → `data-backups/`
|
|
|
|
- [ ] **Step 3.1: git mv**
|
|
|
|
```bash
|
|
git mv data_backup data-backups
|
|
```
|
|
|
|
- [ ] **Step 3.2: Commit**
|
|
|
|
```bash
|
|
git add data-backups/
|
|
git commit -m "refactor: rename data_backup/ => data-backups/ (kebab-case)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 4: Move cn/ and media/ to archive/
|
|
|
|
**Files:**
|
|
- Move: `cn/` → `archive/miscellaneous/cn/`
|
|
- Move: `media/` → `archive/miscellaneous/media/`
|
|
- Create: `archive/miscellaneous/`
|
|
|
|
- [ ] **Step 4.1: Create archive directories**
|
|
|
|
```bash
|
|
mkdir -p archive/miscellaneous
|
|
```
|
|
|
|
- [ ] **Step 4.2: Move cn/ into archive**
|
|
|
|
```bash
|
|
git mv cn archive/miscellaneous/cn
|
|
```
|
|
|
|
- [ ] **Step 4.3: Move media/ into archive**
|
|
|
|
```bash
|
|
git mv media archive/miscellaneous/media
|
|
```
|
|
|
|
- [ ] **Step 4.4: Commit**
|
|
|
|
```bash
|
|
git add archive/
|
|
git commit -m "refactor: move cn/, media/ to archive/miscellaneous/"
|
|
```
|
|
|
|
---
|
|
|
|
### Phase 2: Submodule (源码/) — Maven & Scripts Restructure
|
|
|
|
---
|
|
|
|
### Task 5: Rename Maven projects (remove `maven-` prefix)
|
|
|
|
**Files (within 源码/):**
|
|
- Rename: `maven-cloudwalk-cloud/` → `source/backend/cloudwalk-cloud/`
|
|
- Rename: `maven-cloudwalk-device-manager/` → `source/backend/cloudwalk-device-manager/`
|
|
- Rename: `maven-cloudwalk-device-sdk/` → `source/backend/cloudwalk-device-sdk/`
|
|
- Rename: `maven-cloudwalk-intelligent-davinci-manager/` → `source/backend/intelligent-davinci-manager/`
|
|
- Rename: `maven-cloudwalk-legacy-public/` → `source/backend/cloudwalk-legacy-public/`
|
|
- Rename: `maven-cw-elevator-application/` → `source/backend/cw-elevator-application/`
|
|
- Rename: `maven-cwos-common-aks/` → `source/backend/cwos-common-aks/`
|
|
- Rename: `maven-cwos-device-authentication/` → `source/backend/cwos-device-authentication/`
|
|
- Rename: `maven-cwos-resource/` → `source/backend/cwos-resource/`
|
|
- Rename: `maven-intelligent-cwoscomponent/` → `source/backend/intelligent-cwoscomponent/`
|
|
- Rename: `maven-ninca-common-component-organization/` → `source/backend/ninca-common-component-organization/`
|
|
- Rename: `maven-ninca-crk-from-lib/` → `source/backend/ninca-crk-from-lib/`
|
|
- Rename: `maven-ninca-qk-alarm/` → `source/backend/ninca-qk-alarm/`
|
|
|
|
Note: `源码/` (submodule) already means "source code" in Chinese. Creating `源码/source/` inside it would be redundant. Instead, Maven projects go under `源码/backend/`.
|
|
|
|
- [ ] **Step 5.1: Create backend/ directory**
|
|
|
|
Run (from 源码/):
|
|
```bash
|
|
mkdir -p backend
|
|
```
|
|
|
|
- [ ] **Step 5.2: Move and rename all Maven projects**
|
|
|
|
```bash
|
|
git mv maven-cloudwalk-cloud backend/cloudwalk-cloud
|
|
git mv maven-cloudwalk-device-manager backend/cloudwalk-device-manager
|
|
git mv maven-cloudwalk-device-sdk backend/cloudwalk-device-sdk
|
|
git mv maven-cloudwalk-intelligent-davinci-manager backend/intelligent-davinci-manager
|
|
git mv maven-cloudwalk-legacy-public backend/cloudwalk-legacy-public
|
|
git mv maven-cw-elevator-application backend/cw-elevator-application
|
|
git mv maven-cwos-common-aks backend/cwos-common-aks
|
|
git mv maven-cwos-device-authentication backend/cwos-device-authentication
|
|
git mv maven-cwos-resource backend/cwos-resource
|
|
git mv maven-intelligent-cwoscomponent backend/intelligent-cwoscomponent
|
|
git mv maven-ninca-common-component-organization backend/ninca-common-component-organization
|
|
git mv maven-ninca-crk-from-lib backend/ninca-crk-from-lib
|
|
git mv maven-ninca-qk-alarm backend/ninca-qk-alarm
|
|
```
|
|
|
|
Expected: all 13 projects moved, check `ls backend/`
|
|
|
|
- [ ] **Step 5.3: Verify no broken symlinks or missing dirs**
|
|
|
|
Run:
|
|
```bash
|
|
ls backend/ | wc -l
|
|
```
|
|
Expected: 13
|
|
|
|
- [ ] **Step 5.4: Commit**
|
|
|
|
```bash
|
|
git add backend/ && git rm -r maven-cloudwalk-cloud maven-cloudwalk-device-manager maven-cloudwalk-device-sdk maven-cloudwalk-intelligent-davinci-manager maven-cloudwalk-legacy-public maven-cw-elevator-application maven-cwos-common-aks maven-cwos-device-authentication maven-cwos-resource maven-intelligent-cwoscomponent maven-ninca-common-component-organization maven-ninca-crk-from-lib maven-ninca-qk-alarm
|
|
git commit -m "refactor: move Maven projects to backend/, remove maven- prefix"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 6: Create source/frontend/ from frontend-source/
|
|
|
|
**Files:**
|
|
- Move: `frontend-source/` → `source/frontend/`
|
|
|
|
Note: After Task 11 and Task 13, the old `frontend/` (runtime) is emptied. The actual frontend source (`frontend-source/`) takes its place.
|
|
|
|
- [ ] **Step 6.1: Remove empty frontend/ dir (runtime moved out)**
|
|
|
|
```bash
|
|
rmdir frontend 2>/dev/null || echo "not empty, check manually"
|
|
```
|
|
|
|
- [ ] **Step 6.2: Rename frontend-source to frontend**
|
|
|
|
```bash
|
|
git mv frontend-source frontend
|
|
```
|
|
|
|
- [ ] **Step 6.3: Commit**
|
|
|
|
```bash
|
|
git add frontend/
|
|
git commit -m "refactor: rename frontend-source/ => frontend/ (actual source)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 7: Consolidate scripts/ into submodule scripts/
|
|
|
|
**Files:**
|
|
- Move: `scripts/` (from 源码/ root) → `source/backend/cw-elevator-application/scripts/` (keep with elevator project)
|
|
- Create: `scripts/` (consolidated, at source/ root)
|
|
|
|
Actually, the design says to keep scripts at the parent source/ level, organized by function. Let me adjust.
|
|
|
|
- [ ] **Step 7.1: Create consolidated scripts/ structure**
|
|
|
|
```bash
|
|
mkdir -p scripts/build scripts/deploy scripts/tools
|
|
```
|
|
|
|
- [ ] **Step 7.2: Classify and move scripts**
|
|
|
|
Build/release scripts:
|
|
```bash
|
|
git mv scripts/release-cw-elevator-application.sh scripts/build/
|
|
git mv scripts/format_maven_formatter_all.sh scripts/build/
|
|
git mv scripts/check_maven_formatter_validate.sh scripts/build/
|
|
```
|
|
|
|
Tools/analysis scripts:
|
|
```bash
|
|
git mv scripts/check_elevator_fatjar_lib_parity.sh scripts/tools/
|
|
git mv scripts/compare_jar_to_sources.py scripts/tools/
|
|
git mv scripts/decompile_ninca_crk_lib_modules.py scripts/tools/
|
|
git mv scripts/generate_v1_v2_elevator_dependency_diff.py scripts/tools/
|
|
git mv scripts/run_full_elevator_api_suite.sh scripts/tools/
|
|
git mv scripts/run_v1v2_parity_automated.sh scripts/tools/
|
|
git mv scripts/scan_java_tail_block_comments.py scripts/tools/
|
|
git mv scripts/strip_jdcore_java_noise.py scripts/tools/
|
|
git mv scripts/verify_frontend_runtime.py scripts/tools/
|
|
git mv scripts/verify_v1_v2_config_load_order.sh scripts/tools/
|
|
git mv scripts/collect_elevator_runtime_evidence.sh scripts/tools/
|
|
git mv scripts/alibaba_heuristic_audit.py scripts/tools/
|
|
```
|
|
|
|
The `test-env/` directory stays as is under scripts/:
|
|
```bash
|
|
# test-env is already at scripts/test-env/, keep it
|
|
```
|
|
|
|
- [ ] **Step 7.3: Commit**
|
|
|
|
```bash
|
|
git add scripts/
|
|
git commit -m "refactor: consolidate scripts/ by function (build/deploy/tools)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 8: Move self-referencing 源码/源码/ to archive
|
|
|
|
**Files (in submodule):**
|
|
- Move: `源码/源码/` → parent repo `archive/miscellaneous/source-self-ref/`
|
|
|
|
This is a cross-repo move. The content is inside the submodule but should end up in the parent repo's archive.
|
|
|
|
- [ ] **Step 8.1: Create target directory in parent repo**
|
|
|
|
Run (from parent repo root):
|
|
```bash
|
|
mkdir -p archive/miscellaneous/source-self-ref
|
|
```
|
|
|
|
- [ ] **Step 8.2: Move content using regular mv**
|
|
|
|
Run (from parent repo root):
|
|
```bash
|
|
mv 源码/源码 archive/miscellaneous/source-self-ref/
|
|
```
|
|
|
|
- [ ] **Step 8.3: Register in parent repo**
|
|
|
|
```bash
|
|
git add archive/miscellaneous/source-self-ref/
|
|
git commit -m "archive: relocate 源码/源码/ (self-referencing dir)"
|
|
```
|
|
|
|
- [ ] **Step 8.4: Remove from submodule**
|
|
|
|
Run (from 源码/ submodule):
|
|
```bash
|
|
git rm -r 源码
|
|
git commit -m "refactor: remove self-referencing 源码/源码/ dir (moved to parent archive)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 9: Move decompiled sources (反1/) to parent archive
|
|
|
|
**Files:**
|
|
- Move: `反1/` (in submodule) → `archive/decompiled-sources/` (parent repo)
|
|
|
|
- [ ] **Step 9.1: Create target in parent repo**
|
|
|
|
```bash
|
|
mkdir -p archive/decompiled-sources
|
|
```
|
|
|
|
- [ ] **Step 9.2: Move via regular mv**
|
|
|
|
```bash
|
|
mv 源码/反1/* archive/decompiled-sources/
|
|
```
|
|
|
|
Verify: `ls archive/decompiled-sources/ | wc -l` should show 22 files
|
|
|
|
- [ ] **Step 9.3: Register in parent repo**
|
|
|
|
```bash
|
|
git add archive/decompiled-sources/
|
|
git commit -m "archive: add decompiled jar sources (from 反1/)"
|
|
```
|
|
|
|
- [ ] **Step 9.4: Remove from submodule**
|
|
|
|
```bash
|
|
git rm -r 反1
|
|
git commit -m "refactor: move 反1/ (decompiled sources) to parent archive"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 10: Move root-level files to archive
|
|
|
|
**Files:**
|
|
- Move: `源码/visitor-noauth-verify-v20260430.zip` → `archive/miscellaneous/`
|
|
- Move: `源码/elevator-app.log` → `archive/miscellaneous/`
|
|
|
|
- [ ] **Step 10.1: Cross-repo move zip and log**
|
|
|
|
```bash
|
|
mv 源码/visitor-noauth-verify-v20260430.zip archive/miscellaneous/
|
|
mv 源码/elevator-app.log archive/miscellaneous/
|
|
```
|
|
|
|
- [ ] **Step 10.2: Register in parent repo**
|
|
|
|
```bash
|
|
git add archive/miscellaneous/
|
|
git commit -m "archive: add root-level zip and log files from 源码/"
|
|
```
|
|
|
|
- [ ] **Step 10.3: Remove from submodule**
|
|
|
|
```bash
|
|
git rm visitor-noauth-verify-v20260430.zip elevator-app.log
|
|
git commit -m "refactor: move root-level artifacts to parent archive"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 11: Move .bak frontend dirs to archive
|
|
|
|
**Files (in submodule 源码/frontend/):**
|
|
- Move all `*.bak*` directories from `源码/frontend/` to parent `archive/frontend-backups/`
|
|
|
|
- [ ] **Step 11.1: Identify all .bak dirs**
|
|
|
|
```bash
|
|
ls -d 源码/frontend/*.bak* 2>/dev/null
|
|
```
|
|
|
|
Expected list (from earlier discovery):
|
|
```
|
|
front_acs.bak20231012 front_acs.bak20231018 front_acs.bak20231020
|
|
front_acs.bak20231027 front_acs.bak20231222
|
|
canoe-account.bak20230928 canoe-car.bak20231020
|
|
canoe-device.bak20231018 canoe-device.bak20231020
|
|
canoe-person.bak20231018 canoe-person.bak20231024
|
|
elevator-front.bak20231019
|
|
```
|
|
|
|
Also include tar.gz archives in 源码/frontend/:
|
|
```
|
|
alarm-front.tar.gz canoe-car.tar.gz canoe-device.tar.gz.20240515
|
|
heat-analysis-portal.tar.gz.zhongshanyi heat-analysis-portal.tar(4).gz
|
|
```
|
|
|
|
- [ ] **Step 11.2: Create target and move**
|
|
|
|
```bash
|
|
mkdir -p archive/frontend-backups
|
|
```
|
|
|
|
Move each .bak dir:
|
|
```bash
|
|
for d in 源码/frontend/*.bak*; do
|
|
name=$(basename "$d")
|
|
mv "$d" "archive/frontend-backups/$name"
|
|
done
|
|
```
|
|
|
|
Move tar.gz archives:
|
|
```bash
|
|
for f in 源码/frontend/*.tar.gz*; do
|
|
name=$(basename "$f")
|
|
mv "$f" "archive/frontend-backups/$name"
|
|
done
|
|
```
|
|
|
|
- [ ] **Step 11.3: Register in parent repo**
|
|
|
|
```bash
|
|
git add archive/frontend-backups/
|
|
git commit -m "archive: add frontend .bak backups from 源码/frontend/"
|
|
```
|
|
|
|
- [ ] **Step 11.4: Remove from submodule**
|
|
|
|
Run from 源码/:
|
|
```bash
|
|
for d in frontend/*.bak*; do git rm -r "$d"; done
|
|
for f in frontend/*.tar.gz*; do git rm "$f"; done
|
|
git commit -m "refactor: move frontend backups to parent archive"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 12: Move .bak frontend dirs from runtime/ to archive
|
|
|
|
**Files (in parent repo runtime/frontend/):**
|
|
- Move all `*.bak*` directories from `runtime/frontend/` to `archive/frontend-backups/`
|
|
|
|
- [ ] **Step 12.1: Identify .bak dirs in runtime/frontend/**
|
|
|
|
```bash
|
|
ls -d runtime/frontend/*.bak*
|
|
```
|
|
|
|
- [ ] **Step 12.2: Move to archive**
|
|
|
|
```bash
|
|
for d in runtime/frontend/*.bak*; do
|
|
name=$(basename "$d")
|
|
git mv "$d" "archive/frontend-backups/runtime-$name"
|
|
done
|
|
```
|
|
|
|
- [ ] **Step 12.3: Verify and commit**
|
|
|
|
```bash
|
|
ls archive/frontend-backups/ | head -20
|
|
git add archive/
|
|
git commit -m "archive: add frontend backups from runtime/frontend/"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 13: Move frontend runtime to runtime/frontend/
|
|
|
|
**Files:**
|
|
- Move: `源码/frontend/` (active non-.bak dirs) → `runtime/frontend/` (parent repo)
|
|
|
|
This merges the active frontend dirs from the submodule into the runtime.
|
|
|
|
- [ ] **Step 13.1: Identify non-.bak frontend dirs**
|
|
|
|
```bash
|
|
ls -d 源码/frontend/*/ 2>/dev/null | grep -v '\.bak' | grep -v '\.tar\.gz'
|
|
```
|
|
|
|
- [ ] **Step 13.2: Cross-repo move**
|
|
|
|
For each active frontend dir:
|
|
```bash
|
|
for d in 源码/frontend/*/; do
|
|
name=$(basename "$d")
|
|
# Skip .bak dirs
|
|
if [[ "$name" != *".bak"* ]]; then
|
|
rsync -a "$d" "runtime/frontend/$name"
|
|
fi
|
|
done
|
|
```
|
|
|
|
Use rsync/cp to copy, then verify, then remove from source.
|
|
|
|
- [ ] **Step 13.3: Check for duplicates with existing runtime/frontend/**
|
|
|
|
```bash
|
|
diff -rq 源码/frontend/alarm-front runtime/frontend/alarm-front 2>/dev/null | head -20
|
|
```
|
|
|
|
If identical, remove from 源码/:
|
|
```bash
|
|
git rm -r frontend/alarm-front
|
|
```
|
|
|
|
- [ ] **Step 13.4: Register new files in parent**
|
|
|
|
```bash
|
|
git add runtime/frontend/
|
|
git commit -m "refactor: merge active frontend dirs from submodule to runtime/frontend/"
|
|
```
|
|
|
|
- [ ] **Step 13.5: Remove from submodule**
|
|
|
|
```bash
|
|
git rm -r frontend/alarm-front frontend/area-front frontend/attendancepc ...
|
|
git commit -m "refactor: move frontend runtime to parent runtime/ (dedup)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 14: Move nginx/ to top level
|
|
|
|
**Files:**
|
|
- Move: `源码/nginx-r1.0425/` → `nginx/` (parent repo root)
|
|
|
|
- [ ] **Step 14.1: Cross-repo move**
|
|
|
|
```bash
|
|
cp -a 源码/nginx-r1.0425 nginx
|
|
```
|
|
|
|
Verify: `ls nginx/`
|
|
|
|
- [ ] **Step 14.2: Register in parent repo**
|
|
|
|
```bash
|
|
git add nginx/
|
|
git commit -m "refactor: move nginx config from submodule to top-level"
|
|
```
|
|
|
|
- [ ] **Step 14.3: Remove from submodule**
|
|
|
|
```bash
|
|
git rm -r nginx-r1.0425
|
|
git commit -m "refactor: move nginx config to parent repo top-level"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 15: Move artifacts/ to top level
|
|
|
|
**Files:**
|
|
- Move: `源码/artifacts/` → `artifacts/` (parent repo root)
|
|
|
|
- [ ] **Step 15.1: Cross-repo move using cp**
|
|
|
|
```bash
|
|
cp -a 源码/artifacts artifacts
|
|
```
|
|
|
|
- [ ] **Step 15.2: Register in parent repo**
|
|
|
|
```bash
|
|
git add artifacts/
|
|
git commit -m "refactor: move artifacts/ from submodule to top-level"
|
|
```
|
|
|
|
- [ ] **Step 15.3: Remove from submodule**
|
|
|
|
```bash
|
|
git rm -r artifacts
|
|
git commit -m "refactor: move artifacts/ to parent repo top-level"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 16: Move dev-support/ to docs/
|
|
|
|
**Files (in submodule):**
|
|
- Move: `dev-support/` → `docs/dev-support/`
|
|
|
|
- [ ] **Step 16.1: git mv**
|
|
|
|
```bash
|
|
git mv dev-support docs/dev-support
|
|
```
|
|
|
|
- [ ] **Step 16.2: Commit**
|
|
|
|
```bash
|
|
git add docs/
|
|
git commit -m "docs: merge dev-support/ into docs/ (per existing convention)"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 17: Update AGENTS.md with new paths
|
|
|
|
**Files:**
|
|
- Modify: `AGENTS.md` (submodule root)
|
|
- Modify: `docs/AGENTS.md` (docs AGENTS.md)
|
|
|
|
- [ ] **Step 17.1: Update submodule AGENTS.md — OVERVIEW section**
|
|
|
|
Replace the OVERVIEW section to reflect new paths:
|
|
|
|
```markdown
|
|
## OVERVIEW
|
|
|
|
CloudWalk (云从科技) 电梯/门禁/报警/人脸识别系统。Maven 多模块单体仓库 + 独立部署运行包。
|
|
- **source/**: 可编辑的 Maven 源码树 (主要迭代区) + 前端源码
|
|
- **runtime/**: 运行时部署包 + 配置文件 (生产/预发镜像)
|
|
- **packages/**: 13 个组件的完整 tar.gz 压缩包
|
|
- **data-backups/**: 各服务数据库备份 (SQL gz)
|
|
- **archive/**: 历史/参考/遗留内容
|
|
- **docs/**: 文档中心
|
|
- **scripts/**: 统一脚本 (build/deploy/test-env/tools)
|
|
- **nginx/**: Nginx 配置
|
|
```
|
|
|
|
- [ ] **Step 17.2: Update AGENTS.md — 顶层目录结构 section**
|
|
|
|
Replace the tree:
|
|
```markdown
|
|
```
|
|
星河湾星中星/
|
|
├── source/ # 可编辑的源码
|
|
│ ├── backend/ # Maven 后端项目 (13 个)
|
|
│ │ ├── cw-elevator-application/ # 电梯应用 (主力迭代)
|
|
│ │ ├── intelligent-cwoscomponent/
|
|
│ │ └── ...
|
|
│ ├── frontend/ # 前端源码项目
|
|
│ └── scripts/ # 构建/工具脚本
|
|
├── runtime/ # 运行时部署包 (运行目录)
|
|
│ ├── elevator-v1/ # V1 电梯应用部署
|
|
│ ├── ninca-crk-std/ # CRK 人脸识别 GPU 后端
|
|
│ └── cwos-manager/ # CWOS Manager (Docker)
|
|
├── packages/ # 部署压缩包
|
|
├── data-backups/ # 数据库备份
|
|
├── archive/ # 历史/参考/遗留内容
|
|
├── docs/ # 文档中心
|
|
├── scripts/ # 统一脚本
|
|
├── artifacts/ # 构建/还原产物
|
|
├── nginx/ # Nginx 配置
|
|
└── logs/ # 运行日志
|
|
```
|
|
```
|
|
|
|
- [ ] **Step 17.3: Update all path references in AGENTS.md**
|
|
|
|
Replace remaining old paths:
|
|
- `maven-cw-elevator-application/` → `backend/cw-elevator-application/`
|
|
- `maven-intelligent-cwoscomponent/` → `backend/intelligent-cwoscomponent/`
|
|
- `deploy/v2-maven/` → `backend/cw-elevator-application/deploy/v2-maven/`
|
|
- `scripts/test-env/` → `scripts/test-env/` (already correct)
|
|
|
|
- [ ] **Step 17.4: Commit**
|
|
|
|
```bash
|
|
git add AGENTS.md
|
|
git commit -m "docs: update AGENTS.md paths for directory restructure"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 18: Update test-env script paths
|
|
|
|
**Files:**
|
|
- Modify: `scripts/test-env/setup.sh`
|
|
- Modify: `scripts/test-env/config/env.sh`
|
|
- Modify: `scripts/test-env/start-all.sh`
|
|
- Modify: `scripts/test-env/stop-all.sh`
|
|
- Modify: `scripts/test-env/prepare-services.sh`
|
|
- Modify: `scripts/test-env/prepare-db.sh`
|
|
- Modify: `scripts/test-env/health-check.sh`
|
|
- Modify: `scripts/test-env/verify-functional.sh`
|
|
|
|
- [ ] **Step 18.1: Find all old path references in test-env/**
|
|
|
|
Run:
|
|
```bash
|
|
grep -rn "maven-cw-elevator-application\|cw-elevator-application-V1.0.0\|星中心\|部署包\|data_backup" scripts/test-env/ --include="*.sh" --include="*.yml" --include="*.py" --include="*.env"
|
|
```
|
|
|
|
Record all matches.
|
|
|
|
- [ ] **Step 18.2: Update each file**
|
|
|
|
For each reference found in step 18.1, replace:
|
|
- `maven-cw-elevator-application` → `backend/cw-elevator-application`
|
|
- `../../maven-cw-elevator-application` → `../backend/cw-elevator-application`
|
|
- `cw-elevator-application-V1.0.0.20211103` → `elevator-v1`
|
|
- `星中心` → `runtime`
|
|
- `部署包` → `packages`
|
|
- `data_backup` → `data-backups`
|
|
- `cwos_manager_01-cwos_manager` → `cwos-manager`
|
|
- `cwos_system_api_01-cwos_system_api` → `cwos-system-api`
|
|
- `ninca_crk_std_01-ninca_crk_std_backend` → `ninca-crk-std`
|
|
- `ninca_qk_alarm_app_01-ninca_qk_alarm_app` → `ninca-qk-alarm`
|
|
|
|
- [ ] **Step 18.3: Update docker-compose.infra.yml**
|
|
|
|
Run:
|
|
```bash
|
|
grep -n "maven-cw-elevator\|星中心\|部署包\|data_backup" scripts/test-env/docker-compose.infra.yml
|
|
```
|
|
Apply the same replacements.
|
|
|
|
- [ ] **Step 18.4: Commit**
|
|
|
|
```bash
|
|
git add scripts/test-env/
|
|
git commit -m "fix: update test-env script paths after directory restructure"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 19: Update elevator API parity tool paths
|
|
|
|
**Files:**
|
|
- Modify: `backend/cw-elevator-application/tools/elevator_api_parity/` (Python test files, configs)
|
|
|
|
- [ ] **Step 19.1: Find old path references**
|
|
|
|
```bash
|
|
grep -rn "maven-cw-elevator-application\|deploy/v2-maven\|cw-elevator-application-V1.0.0" backend/cw-elevator-application/tools/ --include="*.py" --include="*.sh" --include="*.json" --include="*.yml" --include="*.cfg"
|
|
```
|
|
|
|
- [ ] **Step 19.2: Update references**
|
|
|
|
Replace paths as needed. Key replacements:
|
|
- `../../deploy/` → `../../deploy/` (relative path likely still works)
|
|
- Any absolute or hard-coded paths need updating
|
|
|
|
- [ ] **Step 19.3: Commit**
|
|
|
|
```bash
|
|
git add backend/cw-elevator-application/tools/
|
|
git commit -m "fix: update parity tool paths after directory restructure"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 20: Clean up remaining submodule root
|
|
|
|
**Files (in submodule root 源码/):**
|
|
- Remove now-empty directories that had all content moved out
|
|
|
|
- [ ] **Step 20.1: Check what remains in submodule root**
|
|
|
|
```bash
|
|
ls -la
|
|
```
|
|
|
|
Expected remaining:
|
|
```
|
|
.editorconfig
|
|
.git/
|
|
.gitignore
|
|
.sisyphus/
|
|
AGENTS.md
|
|
docs/
|
|
source/
|
|
scripts/
|
|
logs/
|
|
frontend-source/ (moved to source/frontend/ - check if still exists)
|
|
```
|
|
|
|
If `frontend-source/` still exists as empty: `git rm -r frontend-source`
|
|
|
|
- [ ] **Step 20.2: Clean up empty dirs**
|
|
|
|
```bash
|
|
# Remove empty frontend-source if moved
|
|
git rm -r frontend-source 2>/dev/null || echo "already gone"
|
|
|
|
# Remove empty dev-support if moved
|
|
git rm -r dev-support 2>/dev/null || echo "already gone"
|
|
```
|
|
|
|
- [ ] **Step 20.3: Commit**
|
|
|
|
```bash
|
|
git commit -m "refactor: clean up empty directories after restructure"
|
|
```
|
|
|
|
---
|
|
|
|
### Task 21: Final verification — parent repo
|
|
|
|
- [ ] **Step 21.1: Check parent repo git status**
|
|
|
|
```bash
|
|
git status
|
|
```
|
|
Expected: clean tree, all changes committed
|
|
|
|
- [ ] **Step 21.2: Verify key directories exist**
|
|
|
|
```bash
|
|
ls -d runtime packages data-backups archive scripts nginx artifacts docs logs 2>/dev/null
|
|
```
|
|
|
|
- [ ] **Step 21.3: Verify no critical paths are broken**
|
|
|
|
```bash
|
|
ls runtime/elevator-v1 runtime/cwos-manager runtime/ninca-crk-std runtime/ninca-qk-alarm 2>/dev/null | head -5
|
|
```
|
|
|
|
---
|
|
|
|
### Task 22: Final verification — submodule (源码/)
|
|
|
|
- [ ] **Step 22.1: Check submodule git status**
|
|
|
|
```bash
|
|
git status
|
|
```
|
|
Expected: clean tree
|
|
|
|
- [ ] **Step 22.2: Verify key directories**
|
|
|
|
```bash
|
|
ls -d source/backend source/frontend docs scripts 2>/dev/null
|
|
```
|
|
|
|
- [ ] **Step 22.3: Verify submodule is committed and parent tracks new ref**
|
|
|
|
```bash
|
|
git log --oneline -3
|
|
```
|
|
Expected: shows 15+ commits for all restructuring work
|
|
|
|
- [ ] **Step 22.4: Update parent's submodule pointer**
|
|
|
|
```bash
|
|
git add 源码
|
|
git commit -m "chore: update submodule ref after directory restructure"
|
|
```
|