






















@@ -574,6 +574,55 @@ describe("stageBundledPluginRuntimeDeps", () => {
574574).toBe("module.exports = 'second';\n");
575575});
576576577+it("restages when plugin-local installed runtime dependency contents change", () => {
578+const { pluginDir, repoRoot } = createBundledPluginFixture({
579+packageJson: {
580+name: "@openclaw/fixture-plugin",
581+version: "1.0.0",
582+dependencies: { direct: "1.0.0" },
583+openclaw: { bundle: { stageRuntimeDependencies: true } },
584+},
585+});
586+const rootDirectDir = path.join(repoRoot, "node_modules", "direct");
587+const sourcePluginDir = path.join(repoRoot, "extensions", "fixture-plugin");
588+const pluginDirectDir = path.join(sourcePluginDir, "node_modules", "direct");
589+fs.mkdirSync(rootDirectDir, { recursive: true });
590+fs.mkdirSync(pluginDirectDir, { recursive: true });
591+fs.writeFileSync(
592+path.join(sourcePluginDir, "package.json"),
593+'{ "name": "@openclaw/fixture-plugin", "version": "1.0.0" }\n',
594+"utf8",
595+);
596+fs.writeFileSync(
597+path.join(rootDirectDir, "package.json"),
598+'{ "name": "direct", "version": "1.0.0" }\n',
599+"utf8",
600+);
601+fs.writeFileSync(path.join(rootDirectDir, "index.js"), "module.exports = 'root';\n", "utf8");
602+fs.writeFileSync(
603+path.join(pluginDirectDir, "package.json"),
604+'{ "name": "direct", "version": "1.0.0" }\n',
605+"utf8",
606+);
607+fs.writeFileSync(path.join(pluginDirectDir, "index.js"), "module.exports = 'first';\n", "utf8");
608+609+stageBundledPluginRuntimeDeps({ cwd: repoRoot });
610+expect(
611+fs.readFileSync(path.join(pluginDir, "node_modules", "direct", "index.js"), "utf8"),
612+).toBe("module.exports = 'first';\n");
613+614+fs.writeFileSync(
615+path.join(pluginDirectDir, "index.js"),
616+"module.exports = 'second';\n",
617+"utf8",
618+);
619+stageBundledPluginRuntimeDeps({ cwd: repoRoot });
620+621+expect(
622+fs.readFileSync(path.join(pluginDir, "node_modules", "direct", "index.js"), "utf8"),
623+).toBe("module.exports = 'second';\n");
624+});
625+577626it("fingerprints regular files when readdir reports symlink-like entries", () => {
578627const { pluginDir, repoRoot } = createBundledPluginFixture({
579628packageJson: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。