mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:10:45 +00:00
fix: honor package excludes in channel pack smoke
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user