locadex 0.0.2-alpha.7 → 0.1.0-alpha.10
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 +6 -77
- package/dist/cli.js.map +1 -1
- package/dist/commands/i18n.d.ts +3 -1
- package/dist/commands/i18n.d.ts.map +1 -1
- package/dist/commands/i18n.js +36 -4
- package/dist/commands/i18n.js.map +1 -1
- package/dist/commands/setup.d.ts +6 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +36 -4
- package/dist/commands/setup.js.map +1 -1
- package/dist/logging/console.d.ts +1 -1
- package/dist/logging/console.d.ts.map +1 -1
- package/dist/logging/console.js +6 -7
- package/dist/logging/console.js.map +1 -1
- package/dist/tasks/i18n.d.ts.map +1 -1
- package/dist/tasks/i18n.js +47 -34
- package/dist/tasks/i18n.js.map +1 -1
- package/dist/tasks/setup.d.ts.map +1 -1
- package/dist/tasks/setup.js +11 -16
- package/dist/tasks/setup.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +2 -3
- package/dist/telemetry.js.map +1 -1
- package/dist/types/cli.d.ts +0 -2
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/cli.js +2 -2
- package/dist/types/cli.js.map +1 -1
- package/dist/utils/claudeCode.d.ts +4 -3
- package/dist/utils/claudeCode.d.ts.map +1 -1
- package/dist/utils/claudeCode.js +26 -32
- package/dist/utils/claudeCode.js.map +1 -1
- package/dist/utils/config.d.ts +0 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +3 -12
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/dag/extractFiles.d.ts +7 -0
- package/dist/utils/dag/extractFiles.d.ts.map +1 -0
- package/dist/utils/dag/extractFiles.js +32 -0
- package/dist/utils/dag/extractFiles.js.map +1 -0
- package/dist/utils/dag/getFiles.d.ts.map +1 -0
- package/dist/utils/{getFiles.js → dag/getFiles.js} +3 -3
- package/dist/utils/dag/getFiles.js.map +1 -0
- package/dist/utils/dag/matchFiles.d.ts +2 -1
- package/dist/utils/dag/matchFiles.d.ts.map +1 -1
- package/dist/utils/dag/matchFiles.js +27 -6
- package/dist/utils/dag/matchFiles.js.map +1 -1
- package/dist/utils/locadexManager.d.ts +7 -2
- package/dist/utils/locadexManager.d.ts.map +1 -1
- package/dist/utils/locadexManager.js +38 -18
- package/dist/utils/locadexManager.js.map +1 -1
- package/dist/utils/lockfile.d.ts +18 -0
- package/dist/utils/lockfile.d.ts.map +1 -0
- package/dist/utils/lockfile.js +111 -0
- package/dist/utils/lockfile.js.map +1 -0
- package/dist/utils/packages/installPackage.d.ts +2 -0
- package/dist/utils/packages/installPackage.d.ts.map +1 -0
- package/dist/utils/packages/installPackage.js +30 -0
- package/dist/utils/packages/installPackage.js.map +1 -0
- package/dist/utils/shared.d.ts.map +1 -1
- package/dist/utils/shared.js +3 -2
- package/dist/utils/shared.js.map +1 -1
- package/dist/utils/shutdown.d.ts.map +1 -1
- package/dist/utils/shutdown.js +3 -4
- package/dist/utils/shutdown.js.map +1 -1
- package/package.json +5 -3
- package/dist/utils/getFiles.d.ts.map +0 -1
- package/dist/utils/getFiles.js.map +0 -1
- /package/dist/utils/{getFiles.d.ts → dag/getFiles.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="959468dc-cf43-5ab1-8999-d1c300fa7053")}catch(e){}}();
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
5
|
dotenv.config({ path: '.env' });
|
|
6
6
|
dotenv.config({ path: '.env.local', override: true });
|
|
@@ -10,13 +10,8 @@ import { Command } from 'commander';
|
|
|
10
10
|
import { readFileSync } from 'node:fs';
|
|
11
11
|
import { fromPackageRoot } from './utils/getPaths.js';
|
|
12
12
|
import { setupCommand } from './commands/setup.js';
|
|
13
|
-
import { withTelemetry } from './telemetry.js';
|
|
14
13
|
import { i18nCommand } from './commands/i18n.js';
|
|
15
|
-
import { displayHeader } from './logging/console.js';
|
|
16
14
|
import { main } from 'gtx-cli/index';
|
|
17
|
-
import { LocadexManager } from './utils/locadexManager.js';
|
|
18
|
-
import { logger } from './logging/logger.js';
|
|
19
|
-
import { exit } from './utils/shutdown.js';
|
|
20
15
|
const packageJson = JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'));
|
|
21
16
|
const program = new Command();
|
|
22
17
|
program
|
|
@@ -30,44 +25,11 @@ program
|
|
|
30
25
|
.option('-d, --debug', 'Debug output')
|
|
31
26
|
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
32
27
|
.option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')
|
|
33
|
-
.option('-
|
|
34
|
-
.option('-e, --extensions <extensions>', 'Comma-separated list of file extensions to match')
|
|
28
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files')
|
|
35
29
|
.option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
|
|
36
30
|
.option('-y, --bypass-prompts', 'Bypass interactive prompts')
|
|
37
31
|
.option('--no-telemetry', 'Disable telemetry')
|
|
38
|
-
.action(
|
|
39
|
-
const parentOptions = command.parent?.opts() || {};
|
|
40
|
-
const allOptions = { ...parentOptions, ...options };
|
|
41
|
-
withTelemetry({ enabled: !allOptions.noTelemetry, options: allOptions }, async () => {
|
|
42
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
43
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
44
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
45
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
46
|
-
await exit(1);
|
|
47
|
-
}
|
|
48
|
-
displayHeader();
|
|
49
|
-
LocadexManager.initialize({
|
|
50
|
-
mcpTransport: 'sse',
|
|
51
|
-
metadata: {},
|
|
52
|
-
cliOptions: allOptions,
|
|
53
|
-
options: {
|
|
54
|
-
...(allOptions.matchingFiles && {
|
|
55
|
-
matchingFiles: allOptions.matchingFiles
|
|
56
|
-
.split(',')
|
|
57
|
-
.map((file) => file.trim()),
|
|
58
|
-
}),
|
|
59
|
-
...(allOptions.matchingExtensions && {
|
|
60
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
61
|
-
.split(',')
|
|
62
|
-
.map((ext) => ext.trim()),
|
|
63
|
-
}),
|
|
64
|
-
maxConcurrency: concurrency,
|
|
65
|
-
batchSize,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
await setupCommand(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
32
|
+
.action(setupCommand);
|
|
71
33
|
program
|
|
72
34
|
.command('i18n')
|
|
73
35
|
.description('Run Locadex i18n on your project')
|
|
@@ -75,43 +37,10 @@ program
|
|
|
75
37
|
.option('-d, --debug', 'Debug output')
|
|
76
38
|
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
77
39
|
.option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')
|
|
78
|
-
.option('-m, --
|
|
79
|
-
.option('-e, --matching-extensions <extensions>', 'Comma-separated list of file extensions to match')
|
|
40
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files')
|
|
80
41
|
.option('--no-telemetry', 'Disable telemetry')
|
|
81
|
-
.action(
|
|
82
|
-
const parentOptions = command.parent?.opts() || {};
|
|
83
|
-
const allOptions = { ...parentOptions, ...options };
|
|
84
|
-
withTelemetry({ enabled: !allOptions.noTelemetry, options: allOptions }, async () => {
|
|
85
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
86
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
87
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
88
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
89
|
-
await exit(1);
|
|
90
|
-
}
|
|
91
|
-
displayHeader();
|
|
92
|
-
LocadexManager.initialize({
|
|
93
|
-
mcpTransport: 'sse',
|
|
94
|
-
metadata: {},
|
|
95
|
-
cliOptions: allOptions,
|
|
96
|
-
options: {
|
|
97
|
-
...(allOptions.matchingFiles && {
|
|
98
|
-
matchingFiles: allOptions.matchingFiles
|
|
99
|
-
.split(',')
|
|
100
|
-
.map((file) => file.trim()),
|
|
101
|
-
}),
|
|
102
|
-
...(allOptions.matchingExtensions && {
|
|
103
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
104
|
-
.split(',')
|
|
105
|
-
.map((ext) => ext.trim()),
|
|
106
|
-
}),
|
|
107
|
-
maxConcurrency: concurrency,
|
|
108
|
-
batchSize,
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
await i18nCommand();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
42
|
+
.action(i18nCommand);
|
|
114
43
|
main(program);
|
|
115
44
|
program.parse();
|
|
116
45
|
//# sourceMappingURL=cli.js.map
|
|
117
|
-
//# debugId=
|
|
46
|
+
//# debugId=959468dc-cf43-5ab1-8999-d1c300fa7053
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport dotenv from 'dotenv';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nimport './telemetry.js';\nimport { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { setupCommand } from './commands/setup.js';\nimport {
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport dotenv from 'dotenv';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nimport './telemetry.js';\nimport { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { setupCommand } from './commands/setup.js';\nimport { i18nCommand } from './commands/i18n.js';\nimport { main } from 'gtx-cli/index';\n\nconst packageJson = JSON.parse(\n readFileSync(fromPackageRoot('package.json'), 'utf8')\n);\n\nconst program = new Command();\n\nprogram\n .name('locadex')\n .description('AI agent for internationalization')\n .version(packageJson.version);\n\nprogram\n .command('start')\n .description('Run Locadex on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size', '10')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option(\n '--package-manager <manager>',\n 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)'\n )\n .option('-y, --bypass-prompts', 'Bypass interactive prompts')\n .option('--no-telemetry', 'Disable telemetry')\n .action(setupCommand);\n\nprogram\n .command('i18n')\n .description('Run Locadex i18n on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size', '10')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .action(i18nCommand);\n\nmain(program);\n\nprogram.parse();\n"],"names":[],"mappings":";;;AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;A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6B,EAC7B,kEAAkE,CACnE;KACA,MAAM,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;KAC5D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC;KACzC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC;KACrC,MAAM,CAAC,2BAA2B,EAAE,iBAAiB,EAAE,IAAI,CAAC;KAC5D,MAAM,CAAC,4BAA4B,EAAE,iCAAiC,EAAE,GAAG,CAAC;KAC5E,MAAM,CACL,6BAA6B,EAC7B,6DAA6D,CAC9D;KACA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","debug_id":"959468dc-cf43-5ab1-8999-d1c300fa7053"}
|
package/dist/commands/i18n.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,iBAkCtE"}
|
package/dist/commands/i18n.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cc9ba649-3dd8-541f-b697-dbaabc4d678a")}catch(e){}}();
|
|
3
|
+
import { logger } from '../logging/logger.js';
|
|
3
4
|
import { i18nTask } from '../tasks/i18n.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { withTelemetry } from '../telemetry.js';
|
|
6
|
+
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
|
+
import { displayHeader } from '../logging/console.js';
|
|
8
|
+
import { exit } from '../utils/shutdown.js';
|
|
9
|
+
export async function i18nCommand(options, command) {
|
|
10
|
+
const parentOptions = command.parent?.opts() || {};
|
|
11
|
+
const allOptions = { ...parentOptions, ...options };
|
|
12
|
+
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
+
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
+
const batchSize = Number(allOptions.batchSize) || 1;
|
|
15
|
+
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
+
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
+
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
+
await exit(1);
|
|
19
|
+
}
|
|
20
|
+
displayHeader(telemetryEnabled);
|
|
21
|
+
LocadexManager.initialize({
|
|
22
|
+
mcpTransport: 'sse',
|
|
23
|
+
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
|
+
metadata: {},
|
|
25
|
+
cliOptions: allOptions,
|
|
26
|
+
options: {
|
|
27
|
+
...(allOptions.matchingFiles && {
|
|
28
|
+
matchingFiles: allOptions.matchingFiles
|
|
29
|
+
.split(',')
|
|
30
|
+
.map((file) => file.trim()),
|
|
31
|
+
}),
|
|
32
|
+
maxConcurrency: concurrency,
|
|
33
|
+
batchSize,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
await i18nTask();
|
|
37
|
+
});
|
|
6
38
|
}
|
|
7
39
|
//# sourceMappingURL=i18n.js.map
|
|
8
|
-
//# debugId=
|
|
40
|
+
//# debugId=cc9ba649-3dd8-541f-b697-dbaabc4d678a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { i18nTask } from '../tasks/i18n.js';\n\nexport async function i18nCommand() {\n await i18nTask();\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { logger } from '../logging/logger.js';\nimport { i18nTask } from '../tasks/i18n.js';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport { exit } from '../utils/shutdown.js';\n\nexport async function i18nCommand(options: CliOptions, command: Command) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n const batchSize = Number(allOptions.batchSize) || 1;\n const concurrency = Number(allOptions.concurrency) || 1;\n\n if (concurrency < 1 || batchSize < 1) {\n logger.error('Batch size and concurrency must be greater than 0');\n await exit(1);\n }\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n mcpTransport: 'sse',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n maxConcurrency: concurrency,\n batchSize,\n },\n });\n await i18nTask();\n }\n );\n}\n"],"names":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E;gBACP,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI;oBAC9B,aAAa,EAAE,UAAU,CAAC,aAAa;yBACpC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,cAAc,EAAE,WAAW;gBAC3B,SAAS;aACV;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,EAAE,CAAC;IACnB,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"cc9ba649-3dd8-541f-b697-dbaabc4d678a"}
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { CliOptions } from '../types/cli.js';
|
|
3
|
+
export declare function setupCommand(options: CliOptions & {
|
|
4
|
+
packageManager?: string;
|
|
5
|
+
bypassPrompts?: boolean;
|
|
6
|
+
}, command: Command): Promise<void>;
|
|
2
7
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBAmCjB"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0234f3c4-20e5-57b1-95fc-8c874a072c67")}catch(e){}}();
|
|
3
|
+
import { logger } from '../logging/logger.js';
|
|
3
4
|
import { setupTask } from '../tasks/setup.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { withTelemetry } from '../telemetry.js';
|
|
6
|
+
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
|
+
import { displayHeader } from '../logging/console.js';
|
|
8
|
+
import { exit } from '../utils/shutdown.js';
|
|
9
|
+
export async function setupCommand(options, command) {
|
|
10
|
+
const parentOptions = command.parent?.opts() || {};
|
|
11
|
+
const allOptions = { ...parentOptions, ...options };
|
|
12
|
+
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
+
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
+
const batchSize = Number(allOptions.batchSize) || 1;
|
|
15
|
+
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
+
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
+
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
+
await exit(1);
|
|
19
|
+
}
|
|
20
|
+
displayHeader(telemetryEnabled);
|
|
21
|
+
LocadexManager.initialize({
|
|
22
|
+
mcpTransport: 'sse',
|
|
23
|
+
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
|
+
metadata: {},
|
|
25
|
+
cliOptions: allOptions,
|
|
26
|
+
options: {
|
|
27
|
+
...(allOptions.matchingFiles && {
|
|
28
|
+
matchingFiles: allOptions.matchingFiles
|
|
29
|
+
.split(',')
|
|
30
|
+
.map((file) => file.trim()),
|
|
31
|
+
}),
|
|
32
|
+
maxConcurrency: concurrency,
|
|
33
|
+
batchSize,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
37
|
+
});
|
|
6
38
|
}
|
|
7
39
|
//# sourceMappingURL=setup.js.map
|
|
8
|
-
//# debugId=
|
|
40
|
+
//# debugId=0234f3c4-20e5-57b1-95fc-8c874a072c67
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"sourceRoot":"/","sourcesContent":["import { setupTask } from '../tasks/setup.js';\n\nexport async function setupCommand(\n
|
|
1
|
+
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { logger } from '../logging/logger.js';\nimport { setupTask } from '../tasks/setup.js';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport { exit } from '../utils/shutdown.js';\n\nexport async function setupCommand(\n options: CliOptions & {\n packageManager?: string;\n bypassPrompts?: boolean;\n },\n command: Command\n) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n const batchSize = Number(allOptions.batchSize) || 1;\n const concurrency = Number(allOptions.concurrency) || 1;\n\n if (concurrency < 1 || batchSize < 1) {\n logger.error('Batch size and concurrency must be greater than 0');\n await exit(1);\n }\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n mcpTransport: 'sse',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n maxConcurrency: concurrency,\n bat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E;YAC3C,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE;gBACP,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI;oBAC9B,aAAa,EAAE,UAAU,CAAC,aAAa;yBACpC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,cAAc,EAAE,WAAW;gBAC3B,SAAS;aACV;SACF,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"0234f3c4-20e5-57b1-95fc-8c874a072c67"}
|
|
@@ -7,7 +7,7 @@ export declare function logMessage(message: string): void;
|
|
|
7
7
|
export declare function logErrorAndExit(message: string): Promise<void>;
|
|
8
8
|
export declare function startCommand(message: string): void;
|
|
9
9
|
export declare function endCommand(message: string): void;
|
|
10
|
-
export declare function displayHeader(): void;
|
|
10
|
+
export declare function displayHeader(telemetryEnabled: boolean): void;
|
|
11
11
|
export declare function createSpinner(indicator?: 'dots' | 'timer'): import("@clack/prompts").SpinnerResult;
|
|
12
12
|
export declare function createProgressBar(total: number): import("@clack/prompts").ProgressResult;
|
|
13
13
|
export declare function promptText({ message, defaultValue, validate, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"/","sources":["logging/console.ts"],"names":[],"mappings":"AAmBA,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAEtC;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AACD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,QAEvC;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AACD,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAE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ACP,YAAY,GACb,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB,cAoBA;AAED,wBAAsB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EACxD,OAAO,EACP,OAAO,EACP,QAAe,GAChB,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,gBAoBA;AAED,wBAAsB,aAAa,CAAC,EAClC,OAAO,EACP,YAAmB,EACnB,aAAqC,GACtC,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,6BAYA;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM;;;;EAE/C"}
|
package/dist/logging/console.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7da7fb4-17ed-537e-bce1-3114e4d9feb3")}catch(e){}}();
|
|
3
3
|
import { log, spinner, intro, outro, text, select, confirm, isCancel, cancel, multiselect, taskLog, progress, } from '@clack/prompts';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { getLocadexVersion } from '../utils/getPaths.js';
|
|
@@ -35,9 +35,9 @@ export function endCommand(message) {
|
|
|
35
35
|
outro(chalk.cyan(message));
|
|
36
36
|
}
|
|
37
37
|
// GT specific logging
|
|
38
|
-
export function displayHeader() {
|
|
38
|
+
export function displayHeader(telemetryEnabled) {
|
|
39
39
|
displayAsciiTitle();
|
|
40
|
-
displayInitializingText();
|
|
40
|
+
displayInitializingText(telemetryEnabled);
|
|
41
41
|
startCommand(chalk.cyan(`Locadex v${getLocadexVersion()}`));
|
|
42
42
|
}
|
|
43
43
|
function displayAsciiTitle() {
|
|
@@ -51,12 +51,11 @@ Y8, 88 88
|
|
|
51
51
|
Y8a. .a88 88
|
|
52
52
|
\`"Y88888P" 88 `));
|
|
53
53
|
}
|
|
54
|
-
function displayInitializingText() {
|
|
54
|
+
function displayInitializingText(telemetryEnabled) {
|
|
55
55
|
// eslint-disable-next-line no-console
|
|
56
56
|
console.log(`\n${chalk.bold.blue('General Translation, Inc.')}
|
|
57
57
|
${chalk.dim('https://generaltranslation.com/docs')}
|
|
58
|
-
|
|
59
|
-
${chalk.dim('Locadex uses Sentry and PostHog to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.')}
|
|
58
|
+
${telemetryEnabled ? chalk.dim('\nLocadex uses Sentry and PostHog to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.') : ''}
|
|
60
59
|
`);
|
|
61
60
|
}
|
|
62
61
|
// Spinner functionality
|
|
@@ -135,4 +134,4 @@ export function createTaskLogger(message) {
|
|
|
135
134
|
return taskLog({ title: message });
|
|
136
135
|
}
|
|
137
136
|
//# sourceMappingURL=console.js.map
|
|
138
|
-
//# debugId=
|
|
137
|
+
//# debugId=d7da7fb4-17ed-537e-bce1-3114e4d9feb3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sources":["logging/console.ts"],"sourceRoot":"/","sourcesContent":["import {\n log,\n spinner,\n intro,\n outro,\n text,\n select,\n confirm,\n isCancel,\n cancel,\n multiselect,\n taskLog,\n progress,\n} from '@clack/prompts';\nimport chalk from 'chalk';\nimport { getLocadexVersion } from '../utils/getPaths.js';\nimport { exit } from '../utils/shutdown.js';\n\n// Basic logging functions\nexport function logInfo(message: string) {\n log.info(message);\n}\nexport function logWarning(message: string) {\n log.warn(message);\n}\nexport function logError(message: string) {\n log.error(message);\n}\nexport function logSuccess(message: string) {\n log.success(message);\n}\nexport function logStep(message: string) {\n log.step(message);\n}\nexport function logMessage(message: string) {\n log.message(message, { symbol: chalk.cyan('~') });\n}\n\nexport async function logErrorAndExit(message: string) {\n log.error(message);\n await exit(1);\n}\n\n// Clack prompts\nexport function startCommand(message: string) {\n intro(chalk.cyan(message));\n}\nexport function endCommand(message: string) {\n outro(chalk.cyan(message));\n}\n\n// GT specific logging\nexport function displayHeader() {\n displayAsciiTitle();\n displayInitializingText();\n startCommand(chalk.cyan(`Locadex v${getLocadexVersion()}`));\n}\n\nfunction displayAsciiTitle() {\n // eslint-disable-next-line no-console\n console.log(\n chalk.cyan(\n `\\n ,ad8888ba, 888888888888 \n d8\"' \\`\"8b 88 \nd8' 88 \n88 88 \n88 88888 88 \nY8, 88 88 \n Y8a. .a88 88 \n \\`\"Y88888P\" 88 `\n )\n );\n}\n\nfunction displayInitializingText() {\n // eslint-disable-next-line no-console\n console.log(\n `\\n${chalk.bold.blue('General Translation, Inc.')}\n${chalk.dim('https://generaltranslation.com/docs')}\n
|
|
1
|
+
{"version":3,"file":"console.js","sources":["logging/console.ts"],"sourceRoot":"/","sourcesContent":["import {\n log,\n spinner,\n intro,\n outro,\n text,\n select,\n confirm,\n isCancel,\n cancel,\n multiselect,\n taskLog,\n progress,\n} from '@clack/prompts';\nimport chalk from 'chalk';\nimport { getLocadexVersion } from '../utils/getPaths.js';\nimport { exit } from '../utils/shutdown.js';\n\n// Basic logging functions\nexport function logInfo(message: string) {\n log.info(message);\n}\nexport function logWarning(message: string) {\n log.warn(message);\n}\nexport function logError(message: string) {\n log.error(message);\n}\nexport function logSuccess(message: string) {\n log.success(message);\n}\nexport function logStep(message: string) {\n log.step(message);\n}\nexport function logMessage(message: string) {\n log.message(message, { symbol: chalk.cyan('~') });\n}\n\nexport async function logErrorAndExit(message: string) {\n log.error(message);\n await exit(1);\n}\n\n// Clack prompts\nexport function startCommand(message: string) {\n intro(chalk.cyan(message));\n}\nexport function endCommand(message: string) {\n outro(chalk.cyan(message));\n}\n\n// GT specific logging\nexport function displayHeader(telemetryEnabled: boolean) {\n displayAsciiTitle();\n displayInitializingText(telemetryEnabled);\n startCommand(chalk.cyan(`Locadex v${getLocadexVersion()}`));\n}\n\nfunction displayAsciiTitle() {\n // eslint-disable-next-line no-console\n console.log(\n chalk.cyan(\n `\\n ,ad8888ba, 888888888888 \n d8\"' \\`\"8b 88 \nd8' 88 \n88 88 \n88 88888 88 \nY8, 88 88 \n Y8a. .a88 88 \n \\`\"Y88888P\" 88 `\n )\n );\n}\n\nfunction displayInitializingText(telemetryEnabled: boolean) {\n // eslint-disable-next-line no-console\n console.log(\n `\\n${chalk.bold.blue('General Translation, Inc.')}\n${chalk.dim('https://generaltranslation.com/docs')}\n${telemetryEnabled ? chalk.dim('\\nLocadex uses Sentry and PostHog to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.') : ''}\n`\n );\n}\n\n// Spinner functionality\nexport function createSpinner(indicator: 'dots' | 'timer' = 'timer') {\n return spinner({ indicator });\n}\n\nexport function createProgressBar(total: number) {\n return progress({ max: total });\n}\n\n// Input prompts\nexport async function promptText({\n message,\n defaultValue,\n validate,\n}: {\n message: string;\n defaultValue?: string;\n validate?: (value: string) => boolean | string;\n}) {\n const result = await text({\n message,\n placeholder: defaultValue,\n validate: validate\n ? (value) => {\n const validation = validate(value || '');\n return validation === true ? undefined : validation.toString();\n }\n : undefined,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result;\n}\n\nexport async function promptSelect<T>({\n message,\n options,\n defaultValue,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n defaultValue?: T;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await select({\n message,\n options: clackOptions as any,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as T;\n}\n\nexport async function promptMultiSelect<T extends string>({\n message,\n options,\n required = true,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n required?: boolean;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await multiselect({\n message,\n options: clackOptions as any,\n required,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as Array<T>;\n}\n\nexport async function promptConfirm({\n message,\n defaultValue = true,\n cancelMessage = 'Operation cancelled',\n}: {\n message: string;\n defaultValue?: boolean;\n cancelMessage?: string;\n}) {\n const result = await confirm({\n message,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel(cancelMessage);\n await exit(0);\n }\n\n return result;\n}\n\nexport function createTaskLogger(message: string) {\n return taskLog({ title: message });\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,GAAG,EACH,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,EACP,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE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,EAAE,CAAC;QACrB,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC9B,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,MAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,OAAO,EACP,YAAY,GAAG,IAAI,EACnB,aAAa,GAAG,qBAAqB,GAKtC;IACC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC3B,OAAO;QACP,YAAY,EAAE,YAAY;KAC3B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,aAAa,CAAC,CAAC;QACtB,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC","debug_id":"d7da7fb4-17ed-537e-bce1-3114e4d9feb3"}
|
package/dist/tasks/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"AAqBA,wBAAsB,QAAQ,kBAoS7B"}
|
package/dist/tasks/i18n.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ac943023-bde7-59d5-a4e4-81a08fa08644")}catch(e){}}();
|
|
3
3
|
import { createSpinner } from '../logging/console.js';
|
|
4
4
|
import { allMcpPrompt } from '../prompts/system.js';
|
|
5
5
|
import { exit } from '../utils/shutdown.js';
|
|
6
6
|
import { logger } from '../logging/logger.js';
|
|
7
|
-
import { createDag } from '../utils/dag/createDag.js';
|
|
8
|
-
import { findTsConfig, findWebpackConfig, findRequireConfig, } from '../utils/fs/findConfigs.js';
|
|
9
7
|
import { LocadexManager } from '../utils/locadexManager.js';
|
|
10
|
-
import { addFilesToManager, markFileAsEdited, markFileAsInProgress, } from '../utils/getFiles.js';
|
|
8
|
+
import { addFilesToManager, markFileAsEdited, markFileAsInProgress, } from '../utils/dag/getFiles.js';
|
|
11
9
|
import { outro } from '@clack/prompts';
|
|
12
10
|
import chalk from 'chalk';
|
|
13
11
|
import { appendFileSync } from 'node:fs';
|
|
@@ -15,44 +13,47 @@ import { validateInitialConfig } from '../utils/config.js';
|
|
|
15
13
|
import { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';
|
|
16
14
|
import { generateSettings } from 'gtx-cli/config/generateSettings';
|
|
17
15
|
import path from 'node:path';
|
|
18
|
-
import {
|
|
16
|
+
import { updateLockfile, cleanupLockfile } from '../utils/lockfile.js';
|
|
17
|
+
import { installClaudeCode } from '../utils/packages/installPackage.js';
|
|
18
|
+
import { extractFiles } from '../utils/dag/extractFiles.js';
|
|
19
19
|
export async function i18nTask() {
|
|
20
20
|
await validateInitialConfig();
|
|
21
|
+
logger.debugMessage('Current working directory: ' + process.cwd());
|
|
21
22
|
const gtSettings = await generateSettings({});
|
|
22
23
|
if (gtSettings.framework !== 'next-app') {
|
|
23
24
|
logger.error('Currently, locadex only supports Next.js App Router. Please use Next.js App Router.');
|
|
24
25
|
await exit(1);
|
|
25
26
|
}
|
|
27
|
+
// Install claude-code if not installed
|
|
28
|
+
await installClaudeCode();
|
|
26
29
|
// Init message
|
|
27
30
|
const spinner = createSpinner();
|
|
28
31
|
spinner.start('Initializing Locadex...');
|
|
29
32
|
const manager = LocadexManager.getInstance();
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
33
|
+
const { files, dag } = extractFiles(manager);
|
|
34
|
+
if (files.length === 0) {
|
|
35
|
+
spinner.stop('No files have changed since last run');
|
|
36
|
+
outro(chalk.green('✅ Locadex i18n complete - no changes detected!'));
|
|
37
|
+
await exit(0);
|
|
38
|
+
}
|
|
37
39
|
const filesStateFilePath = manager.getFilesStateFilePath();
|
|
38
40
|
const concurrency = manager.getMaxConcurrency();
|
|
39
41
|
const batchSize = manager.getBatchSize();
|
|
40
42
|
// Create the list of files (aka tasks) to process
|
|
41
|
-
const taskQueue =
|
|
42
|
-
const topologicalOrder = [...dag.getTopologicalOrder()];
|
|
43
|
+
const taskQueue = Array.from(files);
|
|
43
44
|
// Add files to manager
|
|
44
45
|
const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);
|
|
45
46
|
spinner.stop('Locadex initialized');
|
|
46
|
-
logger.verboseMessage(`
|
|
47
|
-
logger.message(`Using ${concurrency} concurrent agents`);
|
|
47
|
+
logger.verboseMessage(`Processing ${files.length} modified files`);
|
|
48
48
|
logger.debugMessage(`Track progress here: ${stateFilePath}`);
|
|
49
49
|
logger.debugMessage(`Order:\n${taskQueue.join('\n')}`);
|
|
50
|
+
logger.message(`Using ${concurrency} concurrent agents`);
|
|
50
51
|
logger.initializeProgressBar(taskQueue.length);
|
|
51
52
|
const fileProcessingStartTime = Date.now();
|
|
52
53
|
logger.progressBar.start(`Processing ${taskQueue.length} files...`);
|
|
53
54
|
// Main parallel processing loop
|
|
54
55
|
let processedCount = 0;
|
|
55
|
-
const
|
|
56
|
+
const agentAbortController = manager.getAgentAbortController();
|
|
56
57
|
let firstError = null;
|
|
57
58
|
// Mutex for task queue access
|
|
58
59
|
let taskQueueMutex = Promise.resolve();
|
|
@@ -68,9 +69,9 @@ export async function i18nTask() {
|
|
|
68
69
|
});
|
|
69
70
|
};
|
|
70
71
|
const processTask = async () => {
|
|
71
|
-
while (taskQueue.length > 0 && !
|
|
72
|
+
while (taskQueue.length > 0 && !agentAbortController.signal.aborted) {
|
|
72
73
|
// Check if we should abort early
|
|
73
|
-
if (
|
|
74
|
+
if (agentAbortController.signal.aborted) {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
// Get an available agent atomically
|
|
@@ -79,7 +80,7 @@ export async function i18nTask() {
|
|
|
79
80
|
// No available agents, wait a bit (but check for abort)
|
|
80
81
|
await new Promise((resolve) => {
|
|
81
82
|
const timeout = global.setTimeout(resolve, 100);
|
|
82
|
-
|
|
83
|
+
agentAbortController.signal.addEventListener('abort', () => {
|
|
83
84
|
global.clearTimeout(timeout);
|
|
84
85
|
resolve(undefined);
|
|
85
86
|
});
|
|
@@ -120,20 +121,22 @@ export async function i18nTask() {
|
|
|
120
121
|
manager.markAgentFree(agentId);
|
|
121
122
|
}
|
|
122
123
|
catch (error) {
|
|
124
|
+
// Check if this is an abort
|
|
125
|
+
if (agentAbortController.signal.aborted) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
123
128
|
// Capture the first error and signal all other agents to abort
|
|
124
129
|
if (!firstError) {
|
|
125
|
-
firstError = new Error(`
|
|
130
|
+
firstError = new Error(`Error in claude i18n process (${agentId}): ${error}`);
|
|
126
131
|
logger.debugMessage(firstError.message);
|
|
127
|
-
abortController.abort();
|
|
128
|
-
manager.cleanupAgents();
|
|
129
132
|
}
|
|
130
|
-
|
|
131
|
-
return;
|
|
133
|
+
await exit(1); // Exit this agent's processing immediately
|
|
134
|
+
return;
|
|
132
135
|
}
|
|
133
136
|
// Mark tasks as complete
|
|
134
137
|
await Promise.all(tasks.map((task) => markFileAsEdited(task, filesStateFilePath)));
|
|
135
138
|
processedCount += tasks.length;
|
|
136
|
-
logger.progressBar.advance(tasks.length, `Processed ${Number((processedCount /
|
|
139
|
+
logger.progressBar.advance(tasks.length, `Processed ${Number((processedCount / files.length) * 100).toFixed(2)}% of files`);
|
|
137
140
|
manager.stats.updateStats({
|
|
138
141
|
newProcessedFiles: tasks.length,
|
|
139
142
|
});
|
|
@@ -147,20 +150,23 @@ export async function i18nTask() {
|
|
|
147
150
|
await Promise.all(processingPromises);
|
|
148
151
|
}
|
|
149
152
|
catch (error) {
|
|
153
|
+
// Check if this is an abort
|
|
154
|
+
if (agentAbortController.signal.aborted) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
150
157
|
// This shouldn't happen since we handle errors within processTask
|
|
151
|
-
logger.debugMessage(`
|
|
158
|
+
logger.debugMessage(`Unexpected error in parallel processing: ${error}`);
|
|
152
159
|
if (!firstError) {
|
|
153
160
|
firstError = new Error(`Unexpected error in parallel processing: ${error}`);
|
|
154
161
|
}
|
|
155
162
|
}
|
|
156
|
-
logger.progressBar.stop(`Processed ${
|
|
163
|
+
logger.progressBar.stop(`Processed ${files.length} files [${Math.round((Date.now() - fileProcessingStartTime) / 1000)}s]`);
|
|
157
164
|
// TODO: uncomment
|
|
158
165
|
// // Always clean up the file list when done, regardless of success or failure
|
|
159
166
|
// logger.info(`Cleaning up file list: ${stateFilePath}`);
|
|
160
167
|
// cleanUp(stateFilePath);
|
|
161
168
|
// If there was an error, clean up and exit with code 1
|
|
162
169
|
if (firstError) {
|
|
163
|
-
manager.cleanupAgents();
|
|
164
170
|
logger.error(firstError.message);
|
|
165
171
|
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
166
172
|
await exit(1);
|
|
@@ -175,7 +181,10 @@ export async function i18nTask() {
|
|
|
175
181
|
reports.push(`## Fixed errors\n${cleanupAgent.generateReport()}`);
|
|
176
182
|
}
|
|
177
183
|
catch (error) {
|
|
178
|
-
|
|
184
|
+
// Check if this is an abort
|
|
185
|
+
if (agentAbortController.signal.aborted) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
179
188
|
logger.debugMessage(`[claude_cleanup_agent] Fixing errors failed: ${error}`);
|
|
180
189
|
manager.stats.recordTelemetry(false);
|
|
181
190
|
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
@@ -191,10 +200,14 @@ ${reports.join('\n')}`;
|
|
|
191
200
|
// cleanup
|
|
192
201
|
const formatter = await detectFormatter();
|
|
193
202
|
if (formatter) {
|
|
194
|
-
await formatFiles(
|
|
203
|
+
await formatFiles(files, formatter);
|
|
195
204
|
}
|
|
196
|
-
|
|
197
|
-
|
|
205
|
+
const lockfilePath = manager.getLockFilePath();
|
|
206
|
+
// Update lockfile with processed files
|
|
207
|
+
updateLockfile(files, lockfilePath);
|
|
208
|
+
// Clean up stale entries from lockfile
|
|
209
|
+
cleanupLockfile(files, lockfilePath);
|
|
210
|
+
logger.message(chalk.dim(`Updated lockfile with ${files.length} files`));
|
|
198
211
|
logger.info(chalk.dim(`Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
|
|
199
212
|
Total wall time: ${Math.round((Date.now() - manager.stats.getStats().startTime) / 1000)}s
|
|
200
213
|
Total files processed: ${manager.stats.getStats().processedFiles}`));
|
|
@@ -314,4 +327,4 @@ ${allMcpPrompt}
|
|
|
314
327
|
return prompt;
|
|
315
328
|
}
|
|
316
329
|
//# sourceMappingURL=i18n.js.map
|
|
317
|
-
//# debugId=
|
|
330
|
+
//# debugId=ac943023-bde7-59d5-a4e4-81a08fa08644
|