mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:20:43 +00:00
fix(deps): remove extension-owned deps from root install (#69335)
* fix(deps): remove extension runtime deps from root install * fix(deps): keep bundled plugin deps local * test(plugins): assert matrix deps stay plugin-local
This commit is contained in:
committed by
GitHub
parent
8642137252
commit
f6360da116
@@ -194,7 +194,6 @@ export function collectRootDistBundledRuntimeMirrors(params) {
|
||||
}
|
||||
|
||||
export function collectBundledPluginRootRuntimeMirrorErrors(params) {
|
||||
const rootRuntimeDeps = collectRuntimeDependencySpecs(params.rootPackageJson);
|
||||
const errors = [];
|
||||
|
||||
for (const [dependencyName, record] of params.bundledRuntimeDependencySpecs) {
|
||||
@@ -205,25 +204,5 @@ export function collectBundledPluginRootRuntimeMirrorErrors(params) {
|
||||
}
|
||||
}
|
||||
|
||||
for (const [dependencyName, mirror] of params.requiredRootMirrors) {
|
||||
const rootSpec = rootRuntimeDeps.get(dependencyName);
|
||||
const importers = [...mirror.importers].toSorted((left, right) => left.localeCompare(right));
|
||||
const importerLabel = importers.join(", ");
|
||||
const pluginLabel = mirror.pluginIds
|
||||
.toSorted((left, right) => left.localeCompare(right))
|
||||
.join(", ");
|
||||
if (typeof rootSpec !== "string" || rootSpec.length === 0) {
|
||||
errors.push(
|
||||
`root dist imports bundled plugin runtime dependency '${dependencyName}' from ${importerLabel}; mirror '${dependencyName}: ${mirror.spec}' in root package.json (declared by ${pluginLabel}).`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if (rootSpec !== mirror.spec) {
|
||||
errors.push(
|
||||
`root dist imports bundled plugin runtime dependency '${dependencyName}' from ${importerLabel}; root package.json has '${rootSpec}' but plugin manifest declares '${mirror.spec}' (${pluginLabel}).`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
@@ -130,11 +130,13 @@ export function classifyRootDependencyOwnership(record) {
|
||||
const sections = new Set(record.sections);
|
||||
|
||||
if (record.rootMirrorImporters.length > 0) {
|
||||
return {
|
||||
category: "extension_only_root_mirror",
|
||||
recommendation:
|
||||
"blocked by packaged host graph: remove root mirror only after bundled runtime resolution stops importing it from root dist",
|
||||
};
|
||||
if (!sectionSetContainsCore(sections)) {
|
||||
return {
|
||||
category: "extension_only_localizable",
|
||||
recommendation:
|
||||
"remove from root package.json and rely on owning extension manifests plus doctor --fix",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (sections.size === 0) {
|
||||
@@ -169,7 +171,7 @@ export function classifyRootDependencyOwnership(record) {
|
||||
return {
|
||||
category: "extension_only_localizable",
|
||||
recommendation:
|
||||
"candidate to remove from root package.json and rely on owning extension manifests",
|
||||
"remove from root package.json and rely on owning extension manifests plus doctor --fix",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user