revert: Switch back to tsc for compiling.
This commit is contained in:
@@ -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.mjs before Commander
|
||||
// The global --profile flag is handled by /entry.js before Commander
|
||||
// This test verifies --browser-profile is a separate option
|
||||
const program = new Command();
|
||||
program.name("test");
|
||||
|
||||
@@ -4,22 +4,22 @@ import { rewriteUpdateFlagArgv } from "./run-main.js";
|
||||
|
||||
describe("rewriteUpdateFlagArgv", () => {
|
||||
it("leaves argv unchanged when --update is absent", () => {
|
||||
const argv = ["node", "entry.mjs", "status"];
|
||||
const argv = ["node", "entry.js", "status"];
|
||||
expect(rewriteUpdateFlagArgv(argv)).toBe(argv);
|
||||
});
|
||||
|
||||
it("rewrites --update into the update command", () => {
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--update"])).toEqual([
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.js", "--update"])).toEqual([
|
||||
"node",
|
||||
"entry.mjs",
|
||||
"entry.js",
|
||||
"update",
|
||||
]);
|
||||
});
|
||||
|
||||
it("preserves global flags that appear before --update", () => {
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--profile", "p", "--update"])).toEqual([
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.js", "--profile", "p", "--update"])).toEqual([
|
||||
"node",
|
||||
"entry.mjs",
|
||||
"entry.js",
|
||||
"--profile",
|
||||
"p",
|
||||
"update",
|
||||
@@ -27,9 +27,9 @@ describe("rewriteUpdateFlagArgv", () => {
|
||||
});
|
||||
|
||||
it("keeps update options after the rewritten command", () => {
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.mjs", "--update", "--json"])).toEqual([
|
||||
expect(rewriteUpdateFlagArgv(["node", "entry.js", "--update", "--json"])).toEqual([
|
||||
"node",
|
||||
"entry.mjs",
|
||||
"entry.js",
|
||||
"update",
|
||||
"--json",
|
||||
]);
|
||||
|
||||
@@ -747,7 +747,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
let afterVersion = beforeVersion;
|
||||
if (pkgRoot) {
|
||||
afterVersion = await readPackageVersion(pkgRoot);
|
||||
const entryPath = path.join(pkgRoot, "dist", "entry.mjs");
|
||||
const entryPath = path.join(pkgRoot, "dist", "entry.js");
|
||||
if (await pathExists(entryPath)) {
|
||||
const doctorStep = await runUpdateStep({
|
||||
name: `${CLI_NAME} doctor`,
|
||||
@@ -969,7 +969,9 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
try {
|
||||
const { doctorCommand } = await import("../commands/doctor.js");
|
||||
const interactiveDoctor = Boolean(process.stdin.isTTY) && !opts.json && opts.yes !== true;
|
||||
await doctorCommand(defaultRuntime, { nonInteractive: !interactiveDoctor });
|
||||
await doctorCommand(defaultRuntime, {
|
||||
nonInteractive: !interactiveDoctor,
|
||||
});
|
||||
} catch (err) {
|
||||
defaultRuntime.log(theme.warn(`Doctor failed: ${String(err)}`));
|
||||
} finally {
|
||||
@@ -1220,7 +1222,9 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/update", "docs.openclaw.ai/cli/up
|
||||
)
|
||||
.action(async (opts) => {
|
||||
try {
|
||||
await updateWizardCommand({ timeout: opts.timeout as string | undefined });
|
||||
await updateWizardCommand({
|
||||
timeout: opts.timeout as string | undefined,
|
||||
});
|
||||
} catch (err) {
|
||||
defaultRuntime.error(String(err));
|
||||
defaultRuntime.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user