fix(plugins): preserve host package during managed peer repair

This commit is contained in:
Vincent Koc
2026-05-16 03:30:24 +08:00
parent 56aec53dde
commit 89a9b4e75a
8 changed files with 187 additions and 15 deletions

View File

@@ -688,12 +688,18 @@ describe("runtime postbuild static assets", () => {
it("writes compatibility aliases for previous gateway shutdown chunk names", async () => {
const rootDir = createTempDir("openclaw-runtime-postbuild-");
const distDir = path.join(rootDir, "dist");
await fs.mkdir(path.join(distDir, "plugins"), { recursive: true });
await fs.mkdir(distDir, { recursive: true });
await fs.writeFile(
path.join(distDir, "server-close.runtime.js"),
'export * from "./server-close.runtime-NewHash.js";\n',
"utf8",
);
await fs.writeFile(
path.join(distDir, "plugins", "hook-runner-global.js"),
"export const runGlobalHook = true;\n",
"utf8",
);
writeLegacyRootRuntimeCompatAliases({ rootDir });
@@ -703,6 +709,9 @@ describe("runtime postbuild static assets", () => {
expect(await fs.readFile(path.join(distDir, "server-close-DvAvfgr8.js"), "utf8")).toBe(
'export * from "./server-close.runtime.js";\n',
);
expect(await fs.readFile(path.join(distDir, "hook-runner-global-B8rMIo8I.js"), "utf8")).toBe(
'export * from "./plugins/hook-runner-global.js";\n',
);
});
it("writes compatibility aliases for previous tool and ACP manager chunk names", async () => {