





















@@ -890,6 +890,57 @@ describe("qa bundled plugin dir", () => {
890890).resolves.toBeTruthy();
891891});
892892893+it("skips transient runtime dependency artifacts while staging built bundled plugins", async () => {
894+const repoRoot = await mkdtemp(path.join(os.tmpdir(), "qa-bundled-runtime-deps-"));
895+cleanups.push(async () => {
896+await rm(repoRoot, { recursive: true, force: true });
897+});
898+await writeFile(
899+path.join(repoRoot, "package.json"),
900+JSON.stringify({ name: "openclaw", type: "module" }, null, 2),
901+"utf8",
902+);
903+const pluginDir = path.join(repoRoot, "dist", "extensions", "qa-channel");
904+await mkdir(path.join(pluginDir, ".openclaw-runtime-deps-copy-active", "node_modules"), {
905+recursive: true,
906+});
907+await writeFile(
908+path.join(pluginDir, "package.json"),
909+JSON.stringify({ name: "@openclaw/qa-channel", type: "module" }, null, 2),
910+"utf8",
911+);
912+await writeFile(path.join(pluginDir, "index.js"), "export const ok = true;\n", "utf8");
913+await writeFile(path.join(pluginDir, ".openclaw-runtime-deps.json"), "{}\n", "utf8");
914+await writeFile(path.join(pluginDir, ".openclaw-runtime-deps-stamp.json"), "{}\n", "utf8");
915+await writeFile(
916+path.join(pluginDir, ".openclaw-runtime-deps-copy-active", "node_modules", "transient.js"),
917+"export {};\n",
918+"utf8",
919+);
920+const tempRoot = await mkdtemp(path.join(os.tmpdir(), "qa-bundled-runtime-deps-target-"));
921+cleanups.push(async () => {
922+await rm(tempRoot, { recursive: true, force: true });
923+});
924+925+const { bundledPluginsDir } = await __testing.createQaBundledPluginsDir({
926+ repoRoot,
927+ tempRoot,
928+allowedPluginIds: ["qa-channel"],
929+});
930+931+const stagedPluginDir = path.join(bundledPluginsDir, "qa-channel");
932+await expect(readFile(path.join(stagedPluginDir, "index.js"), "utf8")).resolves.toContain("ok");
933+await expect(lstat(path.join(stagedPluginDir, ".openclaw-runtime-deps.json"))).rejects.toThrow(
934+/ENOENT/u,
935+);
936+await expect(
937+lstat(path.join(stagedPluginDir, ".openclaw-runtime-deps-stamp.json")),
938+).rejects.toThrow(/ENOENT/u);
939+await expect(
940+lstat(path.join(stagedPluginDir, ".openclaw-runtime-deps-copy-active")),
941+).rejects.toThrow(/ENOENT/u);
942+});
943+893944it("preserves dist-runtime-only root chunks when dist also exists", async () => {
894945const repoRoot = await mkdtemp(path.join(os.tmpdir(), "qa-bundled-mixed-runtime-"));
895946cleanups.push(async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。