From 96b574f486e7959fe4ce842a2051c5c43ccf448b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 19:08:48 +0100 Subject: [PATCH] fix: honor package excludes in channel pack smoke (cherry picked from commit 5305b172a331a0b164af524e2ee0f979d5a84c1d) --- ...test-built-bundled-channel-entry-smoke.mjs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/test-built-bundled-channel-entry-smoke.mjs b/scripts/test-built-bundled-channel-entry-smoke.mjs index 040cd1d7560..5433b840218 100644 --- a/scripts/test-built-bundled-channel-entry-smoke.mjs +++ b/scripts/test-built-bundled-channel-entry-smoke.mjs @@ -20,6 +20,26 @@ const distExtensionsRoot = path.join(packageRoot, "dist", "extensions"); const excludedPackageExtensionDirs = collectRootPackageExcludedExtensionDirs({ cwd: packageRoot }); const installedLayoutEnv = "OPENCLAW_BUNDLED_CHANNEL_SMOKE_INSTALLED_LAYOUT"; +function collectExcludedDistExtensionIds() { + const packageJsonPath = path.join(packageRoot, "package.json"); + if (!fs.existsSync(packageJsonPath)) { + return new Set(); + } + const packageJson = readJson(packageJsonPath); + const files = Array.isArray(packageJson.files) ? packageJson.files : []; + const excludedIds = new Set(); + for (const entry of files) { + if (typeof entry !== "string") { + continue; + } + const match = /^!dist\/extensions\/([^/*]+)\/\*\*$/u.exec(entry.replaceAll("\\", "/")); + if (match) { + excludedIds.add(match[1]); + } + } + return excludedIds; +} + function packageRootLooksInstalled(root) { return root.replaceAll("\\", "/").endsWith("/node_modules/openclaw"); } @@ -71,10 +91,14 @@ function extensionEntryToDistFilename(entry) { function collectBundledChannelEntryFiles() { const files = []; + const excludedDistExtensionIds = collectExcludedDistExtensionIds(); for (const dirent of fs.readdirSync(distExtensionsRoot, { withFileTypes: true })) { if (!dirent.isDirectory()) { continue; } + if (excludedDistExtensionIds.has(dirent.name)) { + continue; + } const extensionRoot = path.join(distExtensionsRoot, dirent.name); const packageJsonPath = path.join(extensionRoot, "package.json"); if (!fs.existsSync(packageJsonPath)) {