From 4b7406719cf785975835d8dae1c8c20bb98daea0 Mon Sep 17 00:00:00 2001 From: cpojer Date: Sat, 31 Jan 2026 17:44:43 +0900 Subject: [PATCH] fix: Update a few more `entry.js` to `entry.mjs` paths. --- scripts/postinstall.js | 2 +- scripts/run-node.mjs | 2 +- src/cli/browser-cli.test.ts | 2 +- src/cli/run-main.test.ts | 14 +++++++------- src/cli/update-cli.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 32b6eb3fa6..d262aa3c7b 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -276,7 +276,7 @@ function main() { const repoRoot = getRepoRoot(); process.chdir(repoRoot); - ensureExecutable(path.join(repoRoot, "dist", "entry.js")); + ensureExecutable(path.join(repoRoot, "dist", "entry.mjs")); setupGitHooks({ repoRoot }); trySetupCompletion(repoRoot); diff --git a/scripts/run-node.mjs b/scripts/run-node.mjs index 27171ce4f4..3c4d65a9a1 100644 --- a/scripts/run-node.mjs +++ b/scripts/run-node.mjs @@ -12,7 +12,7 @@ const compiler = compilerOverride === "tsc" ? "tsc" : "tsgo"; const projectArgs = ["--project", "tsconfig.json"]; const distRoot = path.join(cwd, "dist"); -const distEntry = path.join(distRoot, "entry.js"); +const distEntry = path.join(distRoot, "entry.mjs"); const buildStampPath = path.join(distRoot, ".buildstamp"); const srcRoot = path.join(cwd, "src"); const configFiles = [path.join(cwd, "tsconfig.json"), path.join(cwd, "package.json")]; diff --git a/src/cli/browser-cli.test.ts b/src/cli/browser-cli.test.ts index 20cc1ca09b..6c146a3518 100644 --- a/src/cli/browser-cli.test.ts +++ b/src/cli/browser-cli.test.ts @@ -43,7 +43,7 @@ describe("browser CLI --browser-profile flag", () => { }); it("does not conflict with global --profile flag", () => { - // The global --profile flag is handled by entry.js before Commander + // The global --profile flag is handled by entry.mjs before Commander // This test verifies --browser-profile is a separate option const program = new Command(); program.name("test"); diff --git a/src/cli/run-main.test.ts b/src/cli/run-main.test.ts index 65bc2bf0b4..ac16407880 100644 --- a/src/cli/run-main.test.ts +++ b/src/cli/run-main.test.ts @@ -4,22 +4,22 @@ import { rewriteUpdateFlagArgv } from "./run-main.js"; describe("rewriteUpdateFlagArgv", () => { it("leaves argv unchanged when --update is absent", () => { - const argv = ["node", "entry.js", "status"]; + const argv = ["node", "entry.mjs", "status"]; expect(rewriteUpdateFlagArgv(argv)).toBe(argv); }); it("rewrites --update into the update command", () => { - expect(rewriteUpdateFlagArgv(["node", "entry.js", "--update"])).toEqual([ + expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--update"])).toEqual([ "node", - "entry.js", + "entry.mjs", "update", ]); }); it("preserves global flags that appear before --update", () => { - expect(rewriteUpdateFlagArgv(["node", "entry.js", "--profile", "p", "--update"])).toEqual([ + expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--profile", "p", "--update"])).toEqual([ "node", - "entry.js", + "entry.mjs", "--profile", "p", "update", @@ -27,9 +27,9 @@ describe("rewriteUpdateFlagArgv", () => { }); it("keeps update options after the rewritten command", () => { - expect(rewriteUpdateFlagArgv(["node", "entry.js", "--update", "--json"])).toEqual([ + expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--update", "--json"])).toEqual([ "node", - "entry.js", + "entry.mjs", "update", "--json", ]); diff --git a/src/cli/update-cli.ts b/src/cli/update-cli.ts index fd91e13518..f28fa803e3 100644 --- a/src/cli/update-cli.ts +++ b/src/cli/update-cli.ts @@ -747,7 +747,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise { let afterVersion = beforeVersion; if (pkgRoot) { afterVersion = await readPackageVersion(pkgRoot); - const entryPath = path.join(pkgRoot, "dist", "entry.js"); + const entryPath = path.join(pkgRoot, "dist", "entry.mjs"); if (await pathExists(entryPath)) { const doctorStep = await runUpdateStep({ name: `${CLI_NAME} doctor`,