fix(catalog): build-catalog 白名单归一化 platformTag,清洗上游 3 条数字脏值(重派生 win32)

This commit is contained in:
yu committed 2026-11-06 13:06:54 +08:00
1 parent 4b5c73b752
commit 2bcda3a558
3 files changed
+8 -6

No files matched your search

+3 -1
View File
@@ -243,7 +243,9 @@ function normalizeVendorComponent(component, vendorMap) {
// 任务 3.4(决策点 7)+ 五件小事 #1:platformTag 从包内 PLATFORM_GROUPS 单一源派生
// (能力 id 命中包内注册 → win32;未实现的能力与宿主原生节点 → null 跨平台占位)。
const platforms = domainPlatformMap.get(component.id) || component.platforms;
const platformTag = component.platformTag || (platforms?.includes("win32") ? "win32" : null);
// A8 归一化:源值仅接受 win32|darwin|linux 白名单字符串,其余(含上游 shizai 的数字 1 脏值)一律重派生
const sourcePlatform = ["win32", "darwin", "linux"].includes(component.platformTag) ? component.platformTag : null;
const platformTag = sourcePlatform || (platforms?.includes("win32") ? "win32" : null);
return {
id: component.id,
name: component.name,