fix: Update a few more entry.js to entry.mjs paths.
This commit is contained in:
parent
821ed35be1
commit
4b7406719c
5 changed files with 11 additions and 11 deletions
|
|
@ -276,7 +276,7 @@ function main() {
|
||||||
const repoRoot = getRepoRoot();
|
const repoRoot = getRepoRoot();
|
||||||
process.chdir(repoRoot);
|
process.chdir(repoRoot);
|
||||||
|
|
||||||
ensureExecutable(path.join(repoRoot, "dist", "entry.js"));
|
ensureExecutable(path.join(repoRoot, "dist", "entry.mjs"));
|
||||||
setupGitHooks({ repoRoot });
|
setupGitHooks({ repoRoot });
|
||||||
trySetupCompletion(repoRoot);
|
trySetupCompletion(repoRoot);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ const compiler = compilerOverride === "tsc" ? "tsc" : "tsgo";
|
||||||
const projectArgs = ["--project", "tsconfig.json"];
|
const projectArgs = ["--project", "tsconfig.json"];
|
||||||
|
|
||||||
const distRoot = path.join(cwd, "dist");
|
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 buildStampPath = path.join(distRoot, ".buildstamp");
|
||||||
const srcRoot = path.join(cwd, "src");
|
const srcRoot = path.join(cwd, "src");
|
||||||
const configFiles = [path.join(cwd, "tsconfig.json"), path.join(cwd, "package.json")];
|
const configFiles = [path.join(cwd, "tsconfig.json"), path.join(cwd, "package.json")];
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ describe("browser CLI --browser-profile flag", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not conflict with global --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
|
// This test verifies --browser-profile is a separate option
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
program.name("test");
|
program.name("test");
|
||||||
|
|
|
||||||
|
|
@ -4,22 +4,22 @@ import { rewriteUpdateFlagArgv } from "./run-main.js";
|
||||||
|
|
||||||
describe("rewriteUpdateFlagArgv", () => {
|
describe("rewriteUpdateFlagArgv", () => {
|
||||||
it("leaves argv unchanged when --update is absent", () => {
|
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);
|
expect(rewriteUpdateFlagArgv(argv)).toBe(argv);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("rewrites --update into the update command", () => {
|
it("rewrites --update into the update command", () => {
|
||||||
expect(rewriteUpdateFlagArgv(["node", "entry.js", "--update"])).toEqual([
|
expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--update"])).toEqual([
|
||||||
"node",
|
"node",
|
||||||
"entry.js",
|
"entry.mjs",
|
||||||
"update",
|
"update",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("preserves global flags that appear before --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",
|
"node",
|
||||||
"entry.js",
|
"entry.mjs",
|
||||||
"--profile",
|
"--profile",
|
||||||
"p",
|
"p",
|
||||||
"update",
|
"update",
|
||||||
|
|
@ -27,9 +27,9 @@ describe("rewriteUpdateFlagArgv", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps update options after the rewritten command", () => {
|
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",
|
"node",
|
||||||
"entry.js",
|
"entry.mjs",
|
||||||
"update",
|
"update",
|
||||||
"--json",
|
"--json",
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -747,7 +747,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||||
let afterVersion = beforeVersion;
|
let afterVersion = beforeVersion;
|
||||||
if (pkgRoot) {
|
if (pkgRoot) {
|
||||||
afterVersion = await readPackageVersion(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)) {
|
if (await pathExists(entryPath)) {
|
||||||
const doctorStep = await runUpdateStep({
|
const doctorStep = await runUpdateStep({
|
||||||
name: `${CLI_NAME} doctor`,
|
name: `${CLI_NAME} doctor`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue