mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:50:42 +00:00
fix(release): preserve plugin-local runtime deps in postpublish verify
This commit is contained in:
@@ -283,6 +283,8 @@ export function collectInstalledRootDependencyManifestErrors(packageRoot: string
|
||||
];
|
||||
}
|
||||
const missingImporters = new Map<string, Set<string>>();
|
||||
const bundledExtensionRuntimeDependencyOwners =
|
||||
collectBundledExtensionRuntimeDependencyOwners(packageRoot);
|
||||
|
||||
for (const filePath of distFiles) {
|
||||
const fileStat = lstatSync(filePath);
|
||||
@@ -305,7 +307,12 @@ export function collectInstalledRootDependencyManifestErrors(packageRoot: string
|
||||
if (
|
||||
!dependencyName ||
|
||||
NODE_BUILTIN_MODULES.has(dependencyName) ||
|
||||
declaredRuntimeDeps.has(dependencyName)
|
||||
declaredRuntimeDeps.has(dependencyName) ||
|
||||
isBundledExtensionOwnedRuntimeImport({
|
||||
dependencyName,
|
||||
ownersByDependency: bundledExtensionRuntimeDependencyOwners,
|
||||
source,
|
||||
})
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -323,6 +330,35 @@ export function collectInstalledRootDependencyManifestErrors(packageRoot: string
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
function collectBundledExtensionRuntimeDependencyOwners(
|
||||
packageRoot: string,
|
||||
): Map<string, Set<string>> {
|
||||
const ownersByDependency = new Map<string, Set<string>>();
|
||||
const { manifests } = readBundledExtensionPackageJsons(packageRoot);
|
||||
for (const { id, manifest } of manifests) {
|
||||
for (const dependencyName of collectRuntimeDependencySpecs(manifest).keys()) {
|
||||
const owners = ownersByDependency.get(dependencyName) ?? new Set<string>();
|
||||
owners.add(id);
|
||||
ownersByDependency.set(dependencyName, owners);
|
||||
}
|
||||
}
|
||||
return ownersByDependency;
|
||||
}
|
||||
|
||||
function isBundledExtensionOwnedRuntimeImport(params: {
|
||||
dependencyName: string;
|
||||
ownersByDependency: Map<string, Set<string>>;
|
||||
source: string;
|
||||
}): boolean {
|
||||
const owners = params.ownersByDependency.get(params.dependencyName);
|
||||
if (!owners) {
|
||||
return false;
|
||||
}
|
||||
return [...owners].some((pluginId) =>
|
||||
params.source.includes(`//#region extensions/${pluginId}/`),
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveInstalledBinaryPath(prefixDir: string, platform = process.platform): string {
|
||||
return platform === "win32"
|
||||
? join(prefixDir, "openclaw.cmd")
|
||||
|
||||
Reference in New Issue
Block a user