docs-i18n 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -2357,6 +2357,7 @@ var streamSSE = (c, cb, onError) => {
|
|
|
2357
2357
|
// src/admin/server/services/job-manager.ts
|
|
2358
2358
|
import { spawn } from "child_process";
|
|
2359
2359
|
var PROJECT_ROOT = process.cwd();
|
|
2360
|
+
var CLI_BIN = process.argv[1] ?? "docs-i18n";
|
|
2360
2361
|
var JobManager = class {
|
|
2361
2362
|
jobs = /* @__PURE__ */ new Map();
|
|
2362
2363
|
processes = /* @__PURE__ */ new Map();
|
|
@@ -2384,8 +2385,7 @@ var JobManager = class {
|
|
|
2384
2385
|
};
|
|
2385
2386
|
this.jobs.set(id, job);
|
|
2386
2387
|
const args = [
|
|
2387
|
-
|
|
2388
|
-
// In dev; in production would be the installed bin
|
|
2388
|
+
CLI_BIN,
|
|
2389
2389
|
"translate",
|
|
2390
2390
|
"--lang",
|
|
2391
2391
|
opts.lang,
|
|
@@ -2399,7 +2399,7 @@ var JobManager = class {
|
|
|
2399
2399
|
if (opts.project) args.push("--project", opts.project);
|
|
2400
2400
|
if (opts.model) args.push("--model", opts.model);
|
|
2401
2401
|
if (opts.files?.length) args.push("--files", opts.files.join(","));
|
|
2402
|
-
const proc = spawn("
|
|
2402
|
+
const proc = spawn("node", args, {
|
|
2403
2403
|
cwd: PROJECT_ROOT,
|
|
2404
2404
|
stdio: ["ignore", "pipe", "pipe"],
|
|
2405
2405
|
env: { ...process.env, NO_TTY: "1", FORCE_COLOR: "0" }
|
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import { type ChildProcess, spawn } from 'node:child_process';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
|
|
4
4
|
const PROJECT_ROOT = process.cwd();
|
|
5
|
+
// CLI binary path — reuse the same entry that started this process
|
|
6
|
+
const CLI_BIN = process.argv[1] ?? 'docs-i18n';
|
|
5
7
|
|
|
6
8
|
export interface Job {
|
|
7
9
|
id: string;
|
|
@@ -64,9 +66,8 @@ export class JobManager {
|
|
|
64
66
|
};
|
|
65
67
|
this.jobs.set(id, job);
|
|
66
68
|
|
|
67
|
-
// Build CLI args — call docs-i18n translate
|
|
68
69
|
const args = [
|
|
69
|
-
|
|
70
|
+
CLI_BIN,
|
|
70
71
|
'translate',
|
|
71
72
|
'--lang', opts.lang,
|
|
72
73
|
'--version', opts.version,
|
|
@@ -78,7 +79,7 @@ export class JobManager {
|
|
|
78
79
|
if (opts.model) args.push('--model', opts.model);
|
|
79
80
|
if (opts.files?.length) args.push('--files', opts.files.join(','));
|
|
80
81
|
|
|
81
|
-
const proc = spawn('
|
|
82
|
+
const proc = spawn('node', args, {
|
|
82
83
|
cwd: PROJECT_ROOT,
|
|
83
84
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
84
85
|
env: { ...process.env, NO_TTY: '1', FORCE_COLOR: '0' },
|