fix(release): keep legacy memory chunk stub

This commit is contained in:
Peter Steinberger
2026-04-28 16:00:42 +01:00
parent e3bc985a6e
commit f7aebf8cb7
2 changed files with 26 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import { describe, expect, it, vi } from "vitest";
import {
copyStaticExtensionAssets,
listStaticExtensionAssetOutputs,
writeLegacyCliExitCompatChunks,
writeStableRootRuntimeAliases,
} from "../../scripts/runtime-postbuild.mjs";
import { createScriptTestHarness } from "./test-helpers.js";
@@ -79,4 +80,14 @@ describe("runtime postbuild static assets", () => {
);
await expect(fs.stat(path.join(distDir, "library.js"))).rejects.toThrow();
});
it("writes legacy CLI exit compatibility chunks", async () => {
const rootDir = createTempDir("openclaw-runtime-postbuild-");
writeLegacyCliExitCompatChunks({ rootDir });
await expect(
fs.readFile(path.join(rootDir, "dist", "memory-state-CcqRgDZU.js"), "utf8"),
).resolves.toContain("function hasMemoryRuntime()");
});
});