chore: clean up plugin dependency leftovers

This commit is contained in:
Peter Steinberger
2026-05-01 21:36:34 +01:00
parent f52fdd8553
commit 4b7a000dcb
7 changed files with 10 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ export function packageNameFromSpecifier(specifier) {
return first.startsWith("@") && second ? `${first}/${second}` : first;
}
export function collectBundledPluginRuntimeDependencySpecs(bundledPluginsDir) {
export function collectBundledPluginPackageDependencySpecs(bundledPluginsDir) {
const specs = new Map();
if (!fs.existsSync(bundledPluginsDir)) {

View File

@@ -21,7 +21,7 @@ import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entri
import {
collectRuntimeDependencySpecs,
packageNameFromSpecifier,
} from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
} from "./lib/plugin-package-dependencies.mjs";
import { runInstalledWorkspaceBootstrapSmoke } from "./lib/workspace-bootstrap-smoke.mjs";
import { parseReleaseVersion, resolveNpmCommandInvocation } from "./openclaw-npm-release-check.ts";

View File

@@ -28,8 +28,8 @@ import {
type ExtensionPackageJson as PackageJson,
} from "./lib/bundled-extension-manifest.ts";
import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entries.mjs";
import { collectBundledPluginRuntimeDependencySpecs } from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
import { collectPackUnpackedSizeErrors as collectNpmPackUnpackedSizeErrors } from "./lib/npm-pack-budget.mjs";
import { collectBundledPluginPackageDependencySpecs } from "./lib/plugin-package-dependencies.mjs";
import { listPluginSdkDistArtifacts } from "./lib/plugin-sdk-entries.mjs";
import {
runInstalledWorkspaceBootstrapSmoke,
@@ -40,7 +40,7 @@ import { sparkleBuildFloorsFromShortVersion, type SparkleBuildFloors } from "./s
import { buildCmdExeCommandLine } from "./windows-cmd-helpers.mjs";
export { collectBundledExtensionManifestErrors } from "./lib/bundled-extension-manifest.ts";
export { packageNameFromSpecifier } from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
export { packageNameFromSpecifier } from "./lib/plugin-package-dependencies.mjs";
type PackFile = { path: string };
type PackResult = { files?: PackFile[]; filename?: string; unpackedSize?: number };
@@ -147,14 +147,14 @@ function collectBundledExtensions(): BundledExtension[] {
function checkBundledExtensionMetadata() {
const extensions = collectBundledExtensions();
const manifestErrors = collectBundledExtensionManifestErrors(extensions);
const bundledRuntimeDependencySpecs = collectBundledPluginRuntimeDependencySpecs(
const bundledPackageDependencySpecs = collectBundledPluginPackageDependencySpecs(
resolve("extensions"),
);
const dependencyConflictErrors = [...bundledRuntimeDependencySpecs.entries()]
const dependencyConflictErrors = [...bundledPackageDependencySpecs.entries()]
.flatMap(([dependencyName, record]) =>
record.conflicts.map(
(conflict) =>
`bundled runtime dependency '${dependencyName}' has conflicting plugin specs: ${record.pluginIds.join(", ")} use '${record.spec}', ${conflict.pluginId} uses '${conflict.spec}'.`,
`bundled plugin package dependency '${dependencyName}' has conflicting specs: ${record.pluginIds.join(", ")} use '${record.spec}', ${conflict.pluginId} uses '${conflict.spec}'.`,
),
)
.toSorted((left, right) => left.localeCompare(right));

View File

@@ -3,7 +3,7 @@
import fs from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { packageNameFromSpecifier } from "./lib/bundled-plugin-root-runtime-mirrors.mjs";
import { packageNameFromSpecifier } from "./lib/plugin-package-dependencies.mjs";
const DEFAULT_SCAN_ROOTS = ["src", "extensions", "packages", "ui", "scripts", "test"];
const SCANNED_EXTENSIONS = new Set([".cjs", ".cts", ".js", ".jsx", ".mjs", ".mts", ".ts", ".tsx"]);