From 5305b172a331a0b164af524e2ee0f979d5a84c1d 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 --- ...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 dc3720d3011..911e24b8d81 100644 --- a/scripts/test-built-bundled-channel-entry-smoke.mjs +++ b/scripts/test-built-bundled-channel-entry-smoke.mjs @@ -18,6 +18,26 @@ const { packageRoot } = parsePackageRootArg( const distExtensionsRoot = path.join(packageRoot, "dist", "extensions"); 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"); } @@ -69,10 +89,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)) {