From e61da67eae26392776a2366229e67d6729ddd46e Mon Sep 17 00:00:00 2001 From: kdletters Date: Sun, 21 Jun 2026 20:23:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E7=B4=A7=E7=A7=BB=E5=8A=A8=E5=A3=B3?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=BA=90=E7=A0=81=E6=89=AB=E6=8F=8F=E8=BE=B9?= =?UTF-8?q?=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 排除移动壳本地依赖目录进入生产源码扫描 排除移动壳测试工具目录进入生产源码扫描 反查根级 native shells 门禁保持同一排除口径 --- apps/mobile-shell/scripts/check-config.mjs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/mobile-shell/scripts/check-config.mjs b/apps/mobile-shell/scripts/check-config.mjs index f3fb7368d..5da77bed6 100644 --- a/apps/mobile-shell/scripts/check-config.mjs +++ b/apps/mobile-shell/scripts/check-config.mjs @@ -332,6 +332,10 @@ const requiredMobileShellScriptModules = [ 'check-expo-config.mjs', 'check-expo-export.mjs', ]; +const productionSourceExcludedDirectories = new Set([ + 'node_modules', + 'test-utils', +]); const devScaffoldTerms = [ 'mo' + 'ck', 'fa' + 'ke', @@ -649,6 +653,11 @@ function collectProductionSourceFiles(entry) { const directory = entry.href.endsWith('/') ? entry : new URL(`${entry.href}/`); return fs .readdirSync(entry, { withFileTypes: true }) + .filter( + (child) => + !child.isDirectory() || + !productionSourceExcludedDirectories.has(child.name), + ) .flatMap((child) => collectProductionSourceFiles( new URL(`${child.name}${child.isDirectory() ? '/' : ''}`, directory), @@ -806,6 +815,14 @@ for (const snippet of [ } } +for (const excludedDirectory of productionSourceExcludedDirectories) { + if (!nativeShellCheckSource.includes(`'${excludedDirectory}'`)) { + throw new Error( + `root native shell check is missing mobile source exclusion: ${excludedDirectory}`, + ); + } +} + assertNoDevScaffoldTerms( productionSourceRoots.flatMap((root) => collectProductionSourceFiles(root)), );