diff --git a/package.json b/package.json index 4831151..d430128 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "test:performance": "node scripts/run-wp4-07-layer.mjs performance", "test:security": "node scripts/verify-frozen-dependencies.mjs && node scripts/redaction-scan.mjs", "test:package": "pnpm build:workspace-packages && pnpm run typecheck && node --test tests/package/wp0-09-portable.test.mjs && node scripts/package-smoke.mjs && node scripts/loopback-boundary-smoke.mjs", + "test:postv1-ui-integration": "node scripts/validate-postv1-ui-lineage.mjs && playwright test tests/e2e/projects-workspace.spec.ts tests/e2e/wp4-01-editor-background.spec.ts tests/e2e/wp4-02-editor-elements.spec.ts tests/e2e/wp4-04-color-dynamic.spec.ts --config playwright.config.ts", "package:portable": "node scripts/build-portable.mjs", "assets:manifest": "pnpm build:workspace-packages && node scripts/generate-runtime-asset-manifest.mjs", "assets:deploy": "pnpm build:workspace-packages && node scripts/deploy-runtime-assets.mjs", diff --git a/scripts/validate-postv1-ui-lineage.mjs b/scripts/validate-postv1-ui-lineage.mjs new file mode 100644 index 0000000..067c5a8 --- /dev/null +++ b/scripts/validate-postv1-ui-lineage.mjs @@ -0,0 +1,24 @@ +import { execFileSync } from "node:child_process"; + +const requiredSubjects = [ + "fix(POSTV1-07): 固定画布布局与文字贴纸选择", + "fix(POSTV1-07): 自动关闭编辑器操作提示", + "fix(POSTV1-08): 修复文字拖动闪烁与自动保存", + "fix(POSTV1-09): 展示项目生成图片", + "feat(POSTV1-10): 增加统一交互反馈", + "fix(POSTV1-11): 修复生成提交的会话令牌轮换", + "fix(POSTV1-runtime): 改善后台启动与状态窗口可见性", + "fix(POSTV1-browser): 同时支持 Chrome 150 与 151", + "fix(POSTV1-editor): 修复多选拖动与底图调整", +]; + +const subjects = new Set(execFileSync("git", ["log", "--format=%s", "HEAD"], { encoding: "utf8" }) + .split(/\r?\n/u) + .filter(Boolean)); +const missing = requiredSubjects.filter((subject) => !subjects.has(subject)); + +if (missing.length > 0) { + throw new Error(`postv1_ui_lineage_incomplete:${missing.join("|")}`); +} + +console.log(JSON.stringify({ required_commit_count: requiredSubjects.length, status: "passed" })); diff --git a/tests/e2e/wp4-04-color-dynamic.spec.ts b/tests/e2e/wp4-04-color-dynamic.spec.ts index 0179242..8a38a5e 100644 --- a/tests/e2e/wp4-04-color-dynamic.spec.ts +++ b/tests/e2e/wp4-04-color-dynamic.spec.ts @@ -29,8 +29,9 @@ const rawImages: Record = { "00000000-0000-4000-8000-000000000812": ["#102030", "#405060", "#708090", "#A0B0C0", "#D0E0F0"], }; -const dynamicRoot = process.env.DADA_DYNAMIC_ASSET_ROOT ?? join(homedir(), "Desktop", "sticker_interactive", "单模板归档", "templates"); -const textRoot = process.env.DADA_TEXT_ASSET_ROOT ?? join(homedir(), "Desktop", "sticker_text"); +const assetRoot = join(homedir(), "Desktop", "sticker_web_replication_assets"); +const dynamicRoot = process.env.DADA_DYNAMIC_ASSET_ROOT ?? join(assetRoot, "sticker_interactive", "单模板归档", "templates"); +const textRoot = process.env.DADA_TEXT_ASSET_ROOT ?? join(assetRoot, "sticker_text"); const dynamicSourceAssets: Readonly> = { "15974853bc3294ef68e7e6d58fe74fd7": { contentType: "font/ttf", path: join(dynamicRoot, "DYN002", "fonts", "15974853bc3294ef68e7e6d58fe74fd7", "0202b90o6r57rxed4027b5689e0dxe7e142r0yho9d0lljuqj.ttf") }, "46f8336813e4c48d06a1aef294fdccf6": { contentType: "font/ttf", path: join(dynamicRoot, "DYN016", "fonts", "46f8336813e4c48d06a1aef294fdccf6", "9fbfbb420cea1df916d7c7c7ac90b1c88b61e117-PingFang-SC-Semibold-2.ttf") },