feat: 迁移aigc 的到养马岛
This commit is contained in:
1 parent
340ecc9165
commit
f19f748b05
103 files changed
+10475
-2150
No files matched your search
@@ -0,0 +1,58 @@
|
||||
# Yangmadao AIGC Migration Implementation Plan
|
||||
|
||||
> **For agentic workers:** Use subagent-driven-development for the isolated AIGC subtree and requesting-code-review for final review. Keep all mutations outside that subtree with the root agent.
|
||||
|
||||
**Goal:** 将 duohua-new 的完整 AIGC 迁入养马岛独立客户端,接入旅行记录入口及 Tailwind,客户端配置不变。
|
||||
**Architecture:** 通过 Git 指定来源提交迁移 AIGC,复用目标认证和请求;受控隐私、导航封装在分包中,Tailwind 使用 tw: 前缀隔离旧工具类。
|
||||
**Tech Stack:** Existing uni-app/Vue 3/Vite 5, Tailwind CSS 4, weapp-tailwindcss, Yarn 1, node:test.
|
||||
|
||||
## Task 1: Baseline and immutable client configuration
|
||||
|
||||
- [x] Read both branch versions and compare package versions and component contracts.
|
||||
- [x] Run `node --test scripts/update-appid.test.cjs` (5 passing).
|
||||
- [x] Confirm target branch clean and record source/target commit hashes in design.
|
||||
|
||||
## Task 2: AIGC subtree
|
||||
|
||||
- [x] Copy every tracked file below `src/pages-aigc/` from source commit using `git show <source>:<path>` and preserve UTF-8.
|
||||
- [x] Copy source `src/components/Privacy/` to `src/pages-aigc/components/Privacy/`; copy source `src/components/TopNavBar/` to `src/pages-aigc/components/TopNavBar/`; update only AIGC imports.
|
||||
- [x] Convert existing Tailwind template utilities in transferred files to complete `tw:` prefixed classes, adding explicit box sizing where preflight was relied upon. Preserve component-specific CSS selectors and state classes.
|
||||
- [x] Adapt recharge footer `$theme-color-600` to `$theme-color-500`; leave `src/uni.scss` unchanged.
|
||||
- [x] Keep task creation, polling, payment recovery, sharing and image upload behavior from source.
|
||||
|
||||
## Task 3: Integration and build pipeline
|
||||
|
||||
- [x] Add nine source AIGC page registrations to target `src/pages.json` without altering existing routes.
|
||||
- [x] Add `travelAIGC: "Command.travelAIGC"` to target `src/model/ChatModel.js`; change first quick access title/type and login-gated destination.
|
||||
- [x] Transfer source GeneratorPhotoComponent Vue and styles, prefix Tailwind classes; retain ChatMainList's existing generator render branch.
|
||||
- [x] Add source Tailwind dependencies and postinstall to package.json, retain target scripts. Update Yarn lock consistently, do not regenerate package-lock.json.
|
||||
- [x] Add `src/app.css` with theme and utilities imports using `prefix(tw)`, omit global preflight, scan only application source, import from main.js.
|
||||
- [x] Add PostCSS Tailwind and UnifiedViteWeappTailwindcssPlugin in vite.config.js; set cssEntries, rem2rpx and disable injected global cssPreflight; retain original assetFileNames.
|
||||
- [x] Add sensitive request logging support without changing base URL, token selection or clientId; import existing removeAccessToken function used on 424.
|
||||
|
||||
## Task 4: Behavior checks and review
|
||||
|
||||
- [x] Before integration code changes, add node:test execution tests for quick access entry, generator data variants and request confidentiality; run to see intended failures.
|
||||
- [x] Run `node --test scripts/update-appid.test.cjs scripts/aigc-migration.test.cjs` after edits.
|
||||
- [x] Run `yarn build:mp-weixin`, inspect all AIGC routes and generated prefixed utility selectors, check no unprefixed Tailwind spacing and global reset override legacy SCSS.
|
||||
- [x] Run development compile once if production class conversion requires comparison.
|
||||
- [x] Run `git diff --check` and compare protected client files with target baseline.
|
||||
- [x] Request independent review while root performs final build/artifact inspection; resolve findings and rerun affected checks.
|
||||
- [x] Leave completed changes on yangmadao-zhinian-8 for user inspection; report actual validation and external integration limits.
|
||||
|
||||
|
||||
## Completion evidence
|
||||
|
||||
- Completed in the existing clean `yangmadao-zhinian-8` checkout after the user switched branches; no additional worktree was created and no changes were made to `duohua-new`.
|
||||
- Added 87 AIGC files (83 original plus isolated Privacy/TopNavBar components).
|
||||
- Review identified target router lacked internal path support. Added source-equivalent HTTP(S)/internal routing and a real router regression test.
|
||||
- Fixed inherited share initial null rendering and waited for the target's existing `getEvnUrl()` before requesting the shared work. Environment configuration files and addresses remain unchanged.
|
||||
- Fixed navbar deep selectors after class prefixing using a stable semantic class.
|
||||
- `node --test scripts/update-appid.test.cjs scripts/aigc-migration.test.cjs`: 14 passed.
|
||||
- `yarn build:mp-weixin`: passed; complete output for all nine AIGC pages verified.
|
||||
- `yarn dev:mp-weixin`: initial compilation passed; watcher stopped after verification.
|
||||
- Generated CSS verified: legacy `.m-4` remains 4px and `.w-50` remains 50%; `tw:` utilities are escaped correctly; no global box-sizing reset was introduced.
|
||||
- `git diff --check`: passed. New source files also pass UTF-8/LF/trailing whitespace checks.
|
||||
- Protected client files are byte-identical to target baseline. No versions changed for pre-existing ranges retained in yarn.lock; package-lock.json is untouched.
|
||||
- Final independent review found no remaining blocking issues.
|
||||
- Changes are uncommitted on the requested target branch. Actual generation, WeChat authorization, sharing and payment still need target-client device/backend testing.
|
||||
@@ -0,0 +1,25 @@
|
||||
# 养马岛 AIGC 定向迁移
|
||||
|
||||
来源:`duohua-new` 的 `a37eaa6e4cd776ee9d5e423f63a3799ac0d7e45c`。
|
||||
目标基线:`yangmadao-zhinian-8` 的 `340ecc9165684467c01a1f803e21040f86ba3a8f`。
|
||||
|
||||
用户已确认迁移功能,强调目标是独立客户端。禁止修改 appid、clientId、环境地址和主题配置。保留目标分支的 manifest.json、project.config.json、constant/base.js、request/base/config.js、request/base/baseUrl.js、uni.scss、client-configs.json 及客户切换脚本。
|
||||
|
||||
## 实施范围
|
||||
|
||||
1. 迁入来源分支 pages-aigc 全部九个页面及其内部依赖,注册为普通分包。
|
||||
2. ChatQuickAccess 首项快速预定改为旅行记录,使用 Command.travelAIGC,checkToken 成功后 navigateTo('/pages-aigc/home/home');其他快捷项沿用目标分支。
|
||||
3. 更新已存在的 GeneratorPhotoComponent,兼容 componentNameParams 和 aigc 数据;沿用后端 jumpUrl 的内外链路由契约。核验 ChatMainList 的导入、toolCall 传递与渲染条件;补齐目标路由缺少的 HTTP(S) 外链与内部页面分流。
|
||||
4. 补齐 Tailwind CSS 4、PostCSS、weapp-tailwindcss、postinstall、CSS 入口。新工具类使用 tw: 前缀,省略全局 preflight,避免覆盖旧 SCSS 的 w-50、m-4 等不同语义。保留原 Vite 静态资源命名规则和客户端脚本。
|
||||
5. 新版受控隐私组件与新版导航组件放入 AIGC 内部,保持主包旧组件契约;将迁入代码中的 theme-color-600 引用适配至已有 theme-color-500,不修改主题配置。
|
||||
6. 请求层仅增加 AIGC 所需的 sensitive 日志屏蔽能力和补齐已有 424 分支缺少的 removeAccessToken 导入。保留原客户端与地址选择逻辑。
|
||||
|
||||
## 验证
|
||||
|
||||
- 先运行目标已有的 scripts/update-appid.test.cjs 建立基线。
|
||||
- 行为测试覆盖旅行记录登录门控、卡片新旧数据与路由、敏感请求与公开分享请求。
|
||||
- 微信开发与生产编译检查新分包、prefixed 工具类、旧样式以及产物是否齐全。
|
||||
- 对上述受保护配置逐文件与目标基线比较,必须完全一致。
|
||||
- 真实生成、充值支付、分享打开及相册授权需要目标客户端的微信真机/后端联调,不发起真实支付。
|
||||
|
||||
收尾修复:分享页标题在数据加载前安全回退;分享请求先等待目标原有 getEvnUrl(),避免冷启动抢跑。内部导航组件采用 nav-bar-content 稳定选择器,保持页面原有间距。
|
||||
Reference in new issue
Block a user