mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:30:43 +00:00
fix(plugins): simplify bundled runtime deps staging
* fix(plugins): simplify bundled runtime deps staging * refactor(plugins): declare bundled root runtime deps * fix(plugins): isolate pnpm runtime dependency installs * test(gateway): wait for deferred agent routing calls in server suite * test(ci): follow extracted update-channel assertions * fix(plugins): bypass pnpm age gate for bundled runtime deps * test: drop stale rebase leftovers * test: preserve mirrored root dependency drift guard * test: stage mirrored deps in facade fixtures * fix(plugin-sdk): expose provider setup metadata * test(plugin-sdk): satisfy spread lint in facade deps fixture * refactor(plugins): share bundled runtime deps install flow * fix(plugins): finish runtime deps rebase cleanup * fix(plugins): remove stale mirror import * refactor(plugins): centralize bundled runtime root preparation * fix(plugins): skip Windows pnpm cmd shims * refactor(plugins): let package managers own runtime deps staging * fix(plugins): validate staged runtime deps * fix(plugins): preserve lazy runtime deps fallback
This commit is contained in:
committed by
GitHub
parent
86f473d8b9
commit
8cf724a381
@@ -213,3 +213,28 @@ export function collectBundledPluginRootRuntimeMirrorErrors(params) {
|
||||
|
||||
return errors.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
export function collectDeclaredRootRuntimeDependencyMetadataErrors(rootPackageJson) {
|
||||
const declaredRootRuntimeDeps = collectRuntimeDependencySpecs(rootPackageJson);
|
||||
const declaredMirrorDeps =
|
||||
rootPackageJson?.openclaw?.bundle?.mirroredRootRuntimeDependencies ?? [];
|
||||
if (!Array.isArray(declaredMirrorDeps)) {
|
||||
return ["package.json openclaw.bundle.mirroredRootRuntimeDependencies must be an array."];
|
||||
}
|
||||
|
||||
const errors = [];
|
||||
for (const dependencyName of declaredMirrorDeps) {
|
||||
if (typeof dependencyName !== "string" || dependencyName.trim().length === 0) {
|
||||
errors.push(
|
||||
"package.json openclaw.bundle.mirroredRootRuntimeDependencies entries must be non-empty strings.",
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if (!declaredRootRuntimeDeps.has(dependencyName)) {
|
||||
errors.push(
|
||||
`package.json openclaw.bundle.mirroredRootRuntimeDependencies declares '${dependencyName}' but package.json dependencies/optionalDependencies do not include it.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return errors.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
collectBuiltBundledPluginStagedRuntimeDependencyErrors,
|
||||
collectBundledPluginRootRuntimeMirrorErrors,
|
||||
collectBundledPluginRuntimeDependencySpecs,
|
||||
collectDeclaredRootRuntimeDependencyMetadataErrors,
|
||||
collectRootDistBundledRuntimeMirrors,
|
||||
} from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
|
||||
import { collectPackUnpackedSizeErrors as collectNpmPackUnpackedSizeErrors } from "./lib/npm-pack-budget.mjs";
|
||||
@@ -52,6 +53,7 @@ export { collectBundledExtensionManifestErrors } from "./lib/bundled-extension-m
|
||||
export {
|
||||
collectBuiltBundledPluginStagedRuntimeDependencyErrors,
|
||||
collectBundledPluginRootRuntimeMirrorErrors,
|
||||
collectDeclaredRootRuntimeDependencyMetadataErrors,
|
||||
collectRootDistBundledRuntimeMirrors,
|
||||
packageNameFromSpecifier,
|
||||
} from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
|
||||
@@ -162,10 +164,16 @@ function checkBundledExtensionMetadata() {
|
||||
requiredRootMirrors,
|
||||
rootPackageJson: rootPackage,
|
||||
});
|
||||
const rootMirrorMetadataErrors = collectDeclaredRootRuntimeDependencyMetadataErrors(rootPackage);
|
||||
const builtArtifactErrors = collectBuiltBundledPluginStagedRuntimeDependencyErrors({
|
||||
bundledPluginsDir: resolve("dist/extensions"),
|
||||
});
|
||||
const errors = [...manifestErrors, ...rootMirrorErrors, ...builtArtifactErrors];
|
||||
const errors = [
|
||||
...manifestErrors,
|
||||
...rootMirrorErrors,
|
||||
...rootMirrorMetadataErrors,
|
||||
...builtArtifactErrors,
|
||||
];
|
||||
if (errors.length > 0) {
|
||||
console.error("release-check: bundled extension manifest validation failed:");
|
||||
for (const error of errors) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
collectBuiltBundledPluginStagedRuntimeDependencyErrors,
|
||||
collectBundledPluginRootRuntimeMirrorErrors,
|
||||
collectBundledPluginRuntimeDependencySpecs,
|
||||
collectDeclaredRootRuntimeDependencyMetadataErrors,
|
||||
collectRootDistBundledRuntimeMirrors,
|
||||
} from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
|
||||
import { parsePackageRootArg } from "./lib/package-root-args.mjs";
|
||||
@@ -36,6 +37,7 @@ const errors = [
|
||||
requiredRootMirrors,
|
||||
rootPackageJson,
|
||||
}),
|
||||
...collectDeclaredRootRuntimeDependencyMetadataErrors(rootPackageJson),
|
||||
...collectBuiltBundledPluginStagedRuntimeDependencyErrors({
|
||||
bundledPluginsDir: builtPluginsDir,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user