mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:38:28 +00:00
revert: Switch back to tsc for compiling.
This commit is contained in:
@@ -47,7 +47,7 @@ export async function resolveControlUiDistIndexPath(
|
||||
}
|
||||
const normalized = path.resolve(argv1);
|
||||
|
||||
// Case 1: entrypoint is directly inside dist/ (e.g., dist/entry.mjs)
|
||||
// Case 1: entrypoint is directly inside dist/ (e.g., dist/entry.js)
|
||||
const distDir = path.dirname(normalized);
|
||||
if (path.basename(distDir) === "dist") {
|
||||
return path.join(distDir, "control-ui", "index.html");
|
||||
|
||||
@@ -73,8 +73,8 @@ function isGatewayArgv(args: string[]): boolean {
|
||||
}
|
||||
|
||||
const entryCandidates = [
|
||||
"dist/index.mjs",
|
||||
"dist/entry.mjs",
|
||||
"dist/index.js",
|
||||
"dist/entry.js",
|
||||
"openclaw.mjs",
|
||||
"scripts/run-node.mjs",
|
||||
"src/index.ts",
|
||||
|
||||
@@ -6,8 +6,8 @@ describe("isMainModule", () => {
|
||||
it("returns true when argv[1] matches current file", () => {
|
||||
expect(
|
||||
isMainModule({
|
||||
currentFile: "/repo/dist/index.mjs",
|
||||
argv: ["node", "/repo/dist/index.mjs"],
|
||||
currentFile: "/repo/dist/index.js",
|
||||
argv: ["node", "/repo/dist/index.js"],
|
||||
cwd: "/repo",
|
||||
env: {},
|
||||
}),
|
||||
@@ -17,10 +17,10 @@ describe("isMainModule", () => {
|
||||
it("returns true under PM2 when pm_exec_path matches current file", () => {
|
||||
expect(
|
||||
isMainModule({
|
||||
currentFile: "/repo/dist/index.mjs",
|
||||
currentFile: "/repo/dist/index.js",
|
||||
argv: ["node", "/pm2/lib/ProcessContainerFork.js"],
|
||||
cwd: "/repo",
|
||||
env: { pm_exec_path: "/repo/dist/index.mjs", pm_id: "0" },
|
||||
env: { pm_exec_path: "/repo/dist/index.js", pm_id: "0" },
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
@@ -28,7 +28,7 @@ describe("isMainModule", () => {
|
||||
it("returns false when running under PM2 but this module is imported", () => {
|
||||
expect(
|
||||
isMainModule({
|
||||
currentFile: "/repo/node_modules/openclaw/dist/index.mjs",
|
||||
currentFile: "/repo/node_modules/openclaw/dist/index.js",
|
||||
argv: ["node", "/repo/app.js"],
|
||||
cwd: "/repo",
|
||||
env: { pm_exec_path: "/repo/app.js", pm_id: "0" },
|
||||
|
||||
@@ -37,7 +37,7 @@ describe("ports helpers", () => {
|
||||
expect(
|
||||
classifyPortListener(
|
||||
{
|
||||
commandLine: "node /Users/me/Projects/openclaw/dist/entry.mjs gateway",
|
||||
commandLine: "node /Users/me/Projects/openclaw/dist/entry.js gateway",
|
||||
},
|
||||
18789,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user