mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
Fix legacy update compat sidecars
This commit is contained in:
@@ -10,7 +10,9 @@ import {
|
||||
discoverBundledPluginRuntimeDeps,
|
||||
pruneBundledPluginSourceNodeModules,
|
||||
runBundledPluginPostinstall,
|
||||
restoreLegacyUpdaterCompatSidecars,
|
||||
} from "../../scripts/postinstall-bundled-plugins.mjs";
|
||||
import { NPM_UPDATE_COMPAT_SIDECARS } from "../../src/infra/npm-update-compat-sidecars.ts";
|
||||
import { writePackageDistInventory } from "../../src/infra/package-dist-inventory.ts";
|
||||
import { createScriptTestHarness } from "./test-helpers.js";
|
||||
|
||||
@@ -308,6 +310,22 @@ describe("bundled plugin postinstall", () => {
|
||||
).resolves.toBe("export {};\n");
|
||||
});
|
||||
|
||||
it("keeps postinstall QA compat sidecars aligned with update verification metadata", async () => {
|
||||
const packageRoot = await createTempDirAsync("openclaw-packaged-install-qa-compat-");
|
||||
|
||||
const restored = restoreLegacyUpdaterCompatSidecars({
|
||||
packageRoot,
|
||||
log: { log: vi.fn(), warn: vi.fn() },
|
||||
});
|
||||
|
||||
expect(restored).toEqual(NPM_UPDATE_COMPAT_SIDECARS.map((sidecar) => sidecar.path));
|
||||
for (const sidecar of NPM_UPDATE_COMPAT_SIDECARS) {
|
||||
await expect(fs.readFile(path.join(packageRoot, sidecar.path), "utf8")).resolves.toBe(
|
||||
sidecar.content,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps packaged postinstall non-fatal when the dist inventory is missing", async () => {
|
||||
const packageRoot = await createTempDirAsync("openclaw-packaged-install-missing-inventory-");
|
||||
const staleFile = path.join(packageRoot, "dist", "channel-CJUAgRQR.js");
|
||||
|
||||
Reference in New Issue
Block a user