



























@@ -497,6 +497,40 @@ describe("runtime postbuild static assets", () => {
497497);
498498});
499499500+it("keeps text-transform runtime imports hashed after the stable alias export surface grew", async () => {
501+const rootDir = createTempDir("openclaw-runtime-postbuild-");
502+const distDir = path.join(rootDir, "dist");
503+await fs.mkdir(distDir, { recursive: true });
504+await fs.writeFile(
505+path.join(distDir, "text-transforms.runtime-NewHash.js"),
506+"export const n = true;\nexport const t = true;\n",
507+"utf8",
508+);
509+await fs.writeFile(
510+path.join(distDir, "provider-runtime-NewHash.js"),
511+[
512+'import { n as applyPluginTextReplacements } from "./text-transforms.runtime-NewHash.js";',
513+"export { applyPluginTextReplacements };",
514+"",
515+].join("\n"),
516+"utf8",
517+);
518+519+rewriteRootRuntimeImportsToStableAliases({ rootDir });
520+writeStableRootRuntimeAliases({ rootDir });
521+522+expect(await fs.readFile(path.join(distDir, "provider-runtime-NewHash.js"), "utf8")).toBe(
523+[
524+'import { n as applyPluginTextReplacements } from "./text-transforms.runtime-NewHash.js";',
525+"export { applyPluginTextReplacements };",
526+"",
527+].join("\n"),
528+);
529+expect(await fs.readFile(path.join(distDir, "text-transforms.runtime.js"), "utf8")).toBe(
530+'export * from "./text-transforms.runtime-NewHash.js";\n',
531+);
532+});
533+500534it("rewrites gateway shutdown imports to stable runtime aliases", async () => {
501535const rootDir = createTempDir("openclaw-runtime-postbuild-");
502536const distDir = path.join(rootDir, "dist");
@@ -728,6 +762,26 @@ describe("runtime postbuild static assets", () => {
728762);
729763});
730764765+it("writes compatibility aliases for previous text-transform runtime chunk names", async () => {
766+const rootDir = createTempDir("openclaw-runtime-postbuild-");
767+const distDir = path.join(rootDir, "dist");
768+await fs.mkdir(distDir, { recursive: true });
769+await fs.writeFile(
770+path.join(distDir, "text-transforms.runtime.js"),
771+'export * from "./text-transforms.runtime-NewHash.js";\n',
772+"utf8",
773+);
774+775+writeLegacyRootRuntimeCompatAliases({ rootDir });
776+777+expect(
778+await fs.readFile(path.join(distDir, "text-transforms.runtime-D9-SpAmI.js"), "utf8"),
779+).toBe('export * from "./text-transforms.runtime.js";\n');
780+expect(
781+await fs.readFile(path.join(distDir, "text-transforms.runtime-sEqsN4pN.js"), "utf8"),
782+).toBe('export * from "./text-transforms.runtime.js";\n');
783+});
784+731785it("writes compatibility aliases for previous gateway shutdown chunk names", async () => {
732786const rootDir = createTempDir("openclaw-runtime-postbuild-");
733787const distDir = path.join(rootDir, "dist");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。