From 75abcf6fd41d1f04265130ba8ca27935aa528795 Mon Sep 17 00:00:00 2001 From: kdletters Date: Sun, 21 Jun 2026 20:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=81=E5=AE=9A=E6=80=BB=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E5=A3=B3=E6=A3=80=E6=9F=A5=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 反查根 check:native-shells 脚本入口 反查根 check 必须串联原生壳验收 防止全仓检查绕过移动桌面宿主壳门禁 --- scripts/check-native-shells.mjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/check-native-shells.mjs b/scripts/check-native-shells.mjs index 424993472..7c61b101c 100644 --- a/scripts/check-native-shells.mjs +++ b/scripts/check-native-shells.mjs @@ -13,6 +13,7 @@ const hostBridgeProtocolDocPath = const developmentWorkflowDocPath = 'docs/project-memory/shared-memory/development-workflow.md'; const decisionLogDocPath = 'docs/project-memory/shared-memory/decision-log.md'; +const rootPackageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); const productionShellScanRoots = [ 'apps/mobile-shell', @@ -59,6 +60,20 @@ const h5HostBridgeScannedFacadeImports = new Set([ 'subscribeHostRuntimeChange', 'writeHostClipboardText', ]); + +function assertRootNativeShellCheckScripts() { + if (rootPackageJson.scripts?.['check:native-shells'] !== 'node scripts/check-native-shells.mjs') { + throw new Error('root check:native-shells script must run scripts/check-native-shells.mjs'); + } + if ( + rootPackageJson.scripts?.check !== + 'npm run lint && npm run test && npm run build && npm run check:content && npm run check:native-shells' + ) { + throw new Error('root check script must include check:native-shells after build and content checks'); + } +} + +assertRootNativeShellCheckScripts(); const h5HostBridgeCallChainWrapperFiles = [ 'src/hooks/useHostLifecycleActive.ts', 'src/hooks/useHostNavigationCanGoBack.ts',