From 11beb65c36b014382c417de3501dde623bd9bbe1 Mon Sep 17 00:00:00 2001 From: kdletters Date: Mon, 14 Sep 2026 16:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A1=8C=E9=9D=A2=E5=A3=B3?= =?UTF-8?q?=E5=AF=B9=E6=A0=B9=E9=97=A8=E7=A6=81=20label=20=E5=AD=97?= =?UTF-8?q?=E9=9D=A2=E9=87=8F=E7=9A=84=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run 2095 的 Native shell tests 红了,失败点是 desktop-shell 的 typecheck: apps/desktop-shell/scripts/check-config.mjs 断言根门禁脚本必须包含 `console.log('[check:native-shells] desktop-release-binary-artifact')` 字面量, 而拆分时我把 label 挪进了公共打印函数 runNativeShellGate(group, label, gate), 源码里不再有这个字面量,断言随即报 「root native shell gate must keep desktop release artifact check」。 - runNativeShellGate 收窄为 (group, gate):label 改回各门禁执行体里的字面量打印, 分组能力、日志格式与 `--groups=` 语义都不变,外部按字面量做的快照断言继续有效。 - 在该函数旁注明不要把 label 抽成变量:apps/desktop-shell 与 apps/mobile-shell 的 check-config 都会读取根脚本源码做字面量断言。 验证:node --check 通过;contract 分组通过(groups=contract + OK);mobile-shell check-config exit 0;desktop-shell check-config 已越过第 740-777 行的根脚本断言 (本机只卡在本机不存在的 Tauri 生成产物目录,Linux CI 不受影响); vitest scripts/project-ci-workflow.test.ts 11 passed;eslint 通过。 Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com> --- scripts/check-native-shells.mjs | 231 +++++++++++++++----------------- 1 file changed, 106 insertions(+), 125 deletions(-) diff --git a/scripts/check-native-shells.mjs b/scripts/check-native-shells.mjs index 816daff0f..8506e641c 100644 --- a/scripts/check-native-shells.mjs +++ b/scripts/check-native-shells.mjs @@ -136,12 +136,11 @@ function runsNativeShellGateGroup(group) { return requestedNativeShellGroups.includes(group); } -function runNativeShellGate(group, label, gate) { +function runNativeShellGate(group, gate) { if (!runsNativeShellGateGroup(group)) { return; } - console.log(`[check:native-shells] ${label}`); gate(); } @@ -227,11 +226,14 @@ function assertRootNativeShellCheckScripts() { } } -runNativeShellGate( - 'contract', - 'root-native-shell-check-scripts', - assertRootNativeShellCheckScripts, -); +// 每个门禁在自己的执行体里打印 `[check:native-shells]