mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:00:42 +00:00
test(plugins): include source external plugin contracts
This commit is contained in:
@@ -69,31 +69,7 @@ function readJsonRecord(filePath: string): Record<string, unknown> | undefined {
|
||||
}
|
||||
}
|
||||
|
||||
function collectExcludedPackagedExtensionDirs(): ReadonlySet<string> {
|
||||
const packageJson = readJsonRecord(path.join(OPENCLAW_PACKAGE_ROOT, "package.json"));
|
||||
const files = packageJson?.files;
|
||||
if (!Array.isArray(files)) {
|
||||
return new Set();
|
||||
}
|
||||
const excluded = new Set<string>();
|
||||
for (const entry of files) {
|
||||
if (typeof entry !== "string") {
|
||||
continue;
|
||||
}
|
||||
const match = /^!dist\/extensions\/([^/]+)\/\*\*$/u.exec(entry);
|
||||
if (match?.[1]) {
|
||||
excluded.add(match[1]);
|
||||
}
|
||||
}
|
||||
return excluded;
|
||||
}
|
||||
|
||||
const EXCLUDED_PACKAGED_EXTENSION_DIRS = collectExcludedPackagedExtensionDirs();
|
||||
|
||||
function readBundledCapabilityManifest(pluginDir: string): BundledCapabilityManifest | undefined {
|
||||
if (EXCLUDED_PACKAGED_EXTENSION_DIRS.has(path.basename(pluginDir))) {
|
||||
return undefined;
|
||||
}
|
||||
const packageJson = readJsonRecord(path.join(pluginDir, "package.json"));
|
||||
const packageManifest = getPackageManifestMetadata(packageJson as PackageManifest);
|
||||
const extensions = normalizeBundledPluginStringList(packageManifest?.extensions);
|
||||
|
||||
Reference in New Issue
Block a user