From a4560ad929e76481542e8e94302a7a4401588e91 Mon Sep 17 00:00:00 2001 From: satsukies Date: Wed, 7 Oct 2026 12:45:39 +0900 Subject: [PATCH] fix: mark the plugin bundle as ESM so it loads on Node 20.0-20.18 and 22.0-22.6 --- plugin/scripts/package.json | 3 +++ src/__tests__/plugin.test.ts | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 plugin/scripts/package.json diff --git a/plugin/scripts/package.json b/plugin/scripts/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/plugin/scripts/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/src/__tests__/plugin.test.ts b/src/__tests__/plugin.test.ts index 6187301..349da53 100644 --- a/src/__tests__/plugin.test.ts +++ b/src/__tests__/plugin.test.ts @@ -160,6 +160,15 @@ describe("plugin/.mcp.json", () => { }); }); +describe("plugin/scripts/package.json", () => { + // The plugin cache copies only plugin/, so this file is what makes Node + // load bundle.js as ESM on versions without module syntax detection + // (Node < 20.19 and 22.0-22.6). + it("marks the bundle directory as ESM", () => { + expect(loadJson("plugin/scripts/package.json").type).toBe("module"); + }); +}); + describe("plugin/skills/ (slash commands)", () => { it("skills/setup/SKILL.md exists", () => { expect(existsSync(resolve(ROOT, "plugin/skills/setup/SKILL.md"))).toBe(true);