test: baseline bundled runtime sidecar paths

This commit is contained in:
Peter Steinberger
2026-04-03 14:25:54 +01:00
parent 8fabfa5d1c
commit bb25a8050c
12 changed files with 154 additions and 21 deletions

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env node
import path from "node:path";
import { writeBundledRuntimeSidecarPathBaseline } from "../src/plugins/runtime-sidecar-paths-baseline.js";
const args = new Set(process.argv.slice(2));
const checkOnly = args.has("--check");
const writeMode = args.has("--write");
if (checkOnly === writeMode) {
console.error("Use exactly one of --check or --write.");
process.exit(1);
}
const repoRoot = process.cwd();
const result = await writeBundledRuntimeSidecarPathBaseline({
repoRoot,
check: checkOnly,
});
if (checkOnly) {
if (result.changed) {
console.error(
[
"Bundled runtime sidecar path baseline drift detected.",
`Expected current: ${path.relative(repoRoot, result.jsonPath)}`,
"If this bundled plugin runtime-sidecar change is intentional, run `pnpm runtime-sidecars:gen` and commit the updated baseline file.",
"If not intentional, fix the bundled plugin metadata/public surface drift first.",
].join("\n"),
);
process.exit(1);
}
console.log(`OK ${path.relative(repoRoot, result.jsonPath)}`);
} else {
console.log(`Wrote ${path.relative(repoRoot, result.jsonPath)}`);
}

View File

@@ -0,0 +1,36 @@
[
"dist/extensions/acpx/runtime-api.js",
"dist/extensions/bluebubbles/runtime-api.js",
"dist/extensions/browser/runtime-api.js",
"dist/extensions/copilot-proxy/runtime-api.js",
"dist/extensions/diffs/runtime-api.js",
"dist/extensions/discord/runtime-api.js",
"dist/extensions/feishu/runtime-api.js",
"dist/extensions/google/runtime-api.js",
"dist/extensions/googlechat/runtime-api.js",
"dist/extensions/imessage/runtime-api.js",
"dist/extensions/line/runtime-api.js",
"dist/extensions/lobster/runtime-api.js",
"dist/extensions/matrix/helper-api.js",
"dist/extensions/matrix/runtime-api.js",
"dist/extensions/matrix/thread-bindings-runtime.js",
"dist/extensions/mattermost/runtime-api.js",
"dist/extensions/memory-core/runtime-api.js",
"dist/extensions/msteams/runtime-api.js",
"dist/extensions/nextcloud-talk/runtime-api.js",
"dist/extensions/nostr/runtime-api.js",
"dist/extensions/ollama/runtime-api.js",
"dist/extensions/open-prose/runtime-api.js",
"dist/extensions/qqbot/runtime-api.js",
"dist/extensions/signal/runtime-api.js",
"dist/extensions/slack/runtime-api.js",
"dist/extensions/telegram/runtime-api.js",
"dist/extensions/tlon/runtime-api.js",
"dist/extensions/twitch/runtime-api.js",
"dist/extensions/voice-call/runtime-api.js",
"dist/extensions/whatsapp/light-runtime-api.js",
"dist/extensions/whatsapp/runtime-api.js",
"dist/extensions/zai/runtime-api.js",
"dist/extensions/zalo/runtime-api.js",
"dist/extensions/zalouser/runtime-api.js"
]

View File

@@ -5,7 +5,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { pathToFileURL } from "node:url";
import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/public-artifacts.ts";
import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts";
import { parseReleaseVersion, resolveNpmCommandInvocation } from "./openclaw-npm-release-check.ts";
type InstalledPackageJson = {