mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
chore: clean up plugin dependency leftovers
This commit is contained in:
@@ -1446,7 +1446,6 @@
|
||||
"test": "node scripts/test-projects.mjs",
|
||||
"test:all": "pnpm lint && pnpm build && pnpm test && pnpm test:e2e && pnpm test:live && pnpm test:docker:all",
|
||||
"test:auth:compat": "node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/client.test.ts src/gateway/reconnect-gating.test.ts src/gateway/protocol/connect-error-details.test.ts",
|
||||
"test:build:bundled-runtime-deps": "node -e \"console.log('bundled plugin runtime dependency staging was removed; no-op')\"",
|
||||
"test:build:singleton": "node scripts/test-built-plugin-singleton.mjs",
|
||||
"test:build:status-message-runtime": "node scripts/test-built-status-message-runtime.mjs",
|
||||
"test:bundled": "node scripts/run-vitest.mjs run --config test/vitest/vitest.bundled.config.ts",
|
||||
@@ -1461,7 +1460,6 @@
|
||||
"test:docker:agents-delete-shared-workspace": "bash scripts/e2e/agents-delete-shared-workspace-docker.sh",
|
||||
"test:docker:all": "node scripts/test-docker-all.mjs",
|
||||
"test:docker:browser-cdp-snapshot": "bash scripts/e2e/browser-cdp-snapshot-docker.sh",
|
||||
"test:docker:bundled-channel-deps:fast": "node -e \"console.log('bundled channel dependency staging was removed; no-op')\"",
|
||||
"test:docker:bundled-plugin-install-uninstall": "bash scripts/e2e/bundled-plugin-install-uninstall-docker.sh",
|
||||
"test:docker:cleanup": "bash scripts/test-cleanup-docker.sh",
|
||||
"test:docker:commitments-safety": "bash scripts/e2e/commitments-safety-docker.sh",
|
||||
|
||||
@@ -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)) {
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
@@ -85,7 +85,7 @@ describe("ensureCliCommandBootstrap", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("loads agent command plugins with bundled runtime repair enabled", async () => {
|
||||
it("loads agent command plugins without package-manager repair", async () => {
|
||||
await ensureCliCommandBootstrap({
|
||||
runtime: {} as never,
|
||||
commandPath: ["agent"],
|
||||
|
||||
@@ -246,7 +246,7 @@ describe("collectBundledExtensionManifestErrors", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("bundled plugin root runtime mirrors", () => {
|
||||
describe("bundled plugin package dependency checks", () => {
|
||||
function makeBundledSpecs() {
|
||||
return new Map([
|
||||
["@larksuiteoapi/node-sdk", { conflicts: [], pluginIds: ["feishu"], spec: "^1.60.0" }],
|
||||
|
||||
Reference in New Issue
Block a user