build: restore qa channel updater sidecar

This commit is contained in:
Peter Steinberger
2026-04-16 23:59:10 +01:00
parent ce1be0f43d
commit ed04d38bec
2 changed files with 17 additions and 11 deletions

View File

@@ -36,10 +36,10 @@ const DISABLE_POSTINSTALL_ENV = "OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL";
const DIST_INVENTORY_PATH = "dist/postinstall-inventory.json";
const LEGACY_UPDATE_COMPAT_SIDECARS = [
{
path: "dist/extensions/qa-lab/runtime-api.js",
removedPrefix: "dist/extensions/qa-lab/",
path: "dist/extensions/qa-channel/runtime-api.js",
removedPrefix: "dist/extensions/qa-channel/",
content:
"// Compatibility stub for older OpenClaw updaters. QA Lab is not packaged.\nexport {};\n",
"// Compatibility stub for older OpenClaw updaters. The QA channel implementation is not packaged.\nexport {};\n",
},
];
const BAILEYS_MEDIA_FILE = join(

View File

@@ -241,11 +241,14 @@ describe("bundled plugin postinstall", () => {
await expect(fs.stat(stalePackage)).rejects.toMatchObject({ code: "ENOENT" });
await expect(fs.stat(staleManifest)).rejects.toMatchObject({ code: "ENOENT" });
await expect(
fs.readFile(path.join(packageRoot, "dist", "extensions", "qa-lab", "runtime-api.js"), "utf8"),
).resolves.toContain("QA Lab is not packaged");
fs.readFile(
path.join(packageRoot, "dist", "extensions", "qa-channel", "runtime-api.js"),
"utf8",
),
).resolves.toContain("QA channel implementation is not packaged");
});
it("creates only an empty QA lab compat sidecar for fresh installs", async () => {
it("creates only an empty QA channel compat sidecar for fresh installs", async () => {
const packageRoot = await createTempDirAsync("openclaw-packaged-install-no-qa-compat-");
await fs.mkdir(path.join(packageRoot, "dist"), { recursive: true });
await fs.writeFile(path.join(packageRoot, "dist", "entry.js"), "export {};\n");
@@ -257,18 +260,21 @@ describe("bundled plugin postinstall", () => {
removedFiles: ["dist/entry-old.js"],
log: { log: vi.fn(), warn: vi.fn() },
}),
).toEqual(["dist/extensions/qa-lab/runtime-api.js"]);
).toEqual(["dist/extensions/qa-channel/runtime-api.js"]);
await expect(
fs.readFile(path.join(packageRoot, "dist", "extensions", "qa-lab", "runtime-api.js"), "utf8"),
fs.readFile(
path.join(packageRoot, "dist", "extensions", "qa-channel", "runtime-api.js"),
"utf8",
),
).resolves.toBe(
"// Compatibility stub for older OpenClaw updaters. QA Lab is not packaged.\nexport {};\n",
"// Compatibility stub for older OpenClaw updaters. The QA channel implementation is not packaged.\nexport {};\n",
);
await expect(
fs.stat(path.join(packageRoot, "dist", "extensions", "qa-lab", "package.json")),
fs.stat(path.join(packageRoot, "dist", "extensions", "qa-channel", "package.json")),
).rejects.toMatchObject({ code: "ENOENT" });
await expect(
fs.stat(path.join(packageRoot, "dist", "extensions", "qa-lab", "openclaw.plugin.json")),
fs.stat(path.join(packageRoot, "dist", "extensions", "qa-channel", "openclaw.plugin.json")),
).rejects.toMatchObject({ code: "ENOENT" });
});