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',