locadex 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +4 -75
- 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 +40 -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 +40 -4
- package/dist/commands/setup.js.map +1 -1
- package/package.json +3 -3
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]="8a32894c-2fdc-5cbf-b3ca-9766816204df")}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
|
|
@@ -35,40 +30,7 @@ program
|
|
|
35
30
|
.option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
|
|
36
31
|
.option('-y, --bypass-prompts', 'Bypass interactive prompts')
|
|
37
32
|
.option('--no-telemetry', 'Disable telemetry')
|
|
38
|
-
.action(
|
|
39
|
-
const parentOptions = command.parent?.opts() || {};
|
|
40
|
-
const allOptions = { ...parentOptions, ...options };
|
|
41
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
42
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
43
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
44
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
45
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
46
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
47
|
-
await exit(1);
|
|
48
|
-
}
|
|
49
|
-
displayHeader(telemetryEnabled);
|
|
50
|
-
LocadexManager.initialize({
|
|
51
|
-
mcpTransport: 'sse',
|
|
52
|
-
metadata: {},
|
|
53
|
-
cliOptions: allOptions,
|
|
54
|
-
options: {
|
|
55
|
-
...(allOptions.matchingFiles && {
|
|
56
|
-
matchingFiles: allOptions.matchingFiles
|
|
57
|
-
.split(',')
|
|
58
|
-
.map((file) => file.trim()),
|
|
59
|
-
}),
|
|
60
|
-
...(allOptions.matchingExtensions && {
|
|
61
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
62
|
-
.split(',')
|
|
63
|
-
.map((ext) => ext.trim()),
|
|
64
|
-
}),
|
|
65
|
-
maxConcurrency: concurrency,
|
|
66
|
-
batchSize,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
await setupCommand(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
33
|
+
.action(setupCommand);
|
|
72
34
|
program
|
|
73
35
|
.command('i18n')
|
|
74
36
|
.description('Run Locadex i18n on your project')
|
|
@@ -79,41 +41,8 @@ program
|
|
|
79
41
|
.option('-f, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files')
|
|
80
42
|
.option('-e, --extensions <extensions>', 'Comma-separated list of file extensions to match')
|
|
81
43
|
.option('--no-telemetry', 'Disable telemetry')
|
|
82
|
-
.action(
|
|
83
|
-
const parentOptions = command.parent?.opts() || {};
|
|
84
|
-
const allOptions = { ...parentOptions, ...options };
|
|
85
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
86
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
87
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
88
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
89
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
90
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
91
|
-
await exit(1);
|
|
92
|
-
}
|
|
93
|
-
displayHeader(telemetryEnabled);
|
|
94
|
-
LocadexManager.initialize({
|
|
95
|
-
mcpTransport: 'sse',
|
|
96
|
-
metadata: {},
|
|
97
|
-
cliOptions: allOptions,
|
|
98
|
-
options: {
|
|
99
|
-
...(allOptions.matchingFiles && {
|
|
100
|
-
matchingFiles: allOptions.matchingFiles
|
|
101
|
-
.split(',')
|
|
102
|
-
.map((file) => file.trim()),
|
|
103
|
-
}),
|
|
104
|
-
...(allOptions.matchingExtensions && {
|
|
105
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
106
|
-
.split(',')
|
|
107
|
-
.map((ext) => ext.trim()),
|
|
108
|
-
}),
|
|
109
|
-
maxConcurrency: concurrency,
|
|
110
|
-
batchSize,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
await i18nCommand();
|
|
114
|
-
});
|
|
115
|
-
});
|
|
44
|
+
.action(i18nCommand);
|
|
116
45
|
main(program);
|
|
117
46
|
program.parse();
|
|
118
47
|
//# sourceMappingURL=cli.js.map
|
|
119
|
-
//# debugId=
|
|
48
|
+
//# debugId=8a32894c-2fdc-5cbf-b3ca-9766816204df
|
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 '-f, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option(\n '-e, --extensions <extensions>',\n 'Comma-separated list of file extensions to match'\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 '-f, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option(\n '-e, --extensions <extensions>',\n 'Comma-separated list of file extensions to match'\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;AAE5B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAChC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3D,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,MAAM,WAAW,GAAG,IAAI,CA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C7C,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","debug_id":"8a32894c-2fdc-5cbf-b3ca-9766816204df"}
|
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,iBAsCtE"}
|
package/dist/commands/i18n.js
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
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]="0c9ca03e-3524-51f9-829a-4fa2f955f3d7")}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
|
+
metadata: {},
|
|
24
|
+
cliOptions: allOptions,
|
|
25
|
+
options: {
|
|
26
|
+
...(allOptions.matchingFiles && {
|
|
27
|
+
matchingFiles: allOptions.matchingFiles
|
|
28
|
+
.split(',')
|
|
29
|
+
.map((file) => file.trim()),
|
|
30
|
+
}),
|
|
31
|
+
...(allOptions.matchingExtensions && {
|
|
32
|
+
matchingExtensions: allOptions.matchingExtensions
|
|
33
|
+
.split(',')
|
|
34
|
+
.map((ext) => ext.trim()),
|
|
35
|
+
}),
|
|
36
|
+
maxConcurrency: concurrency,
|
|
37
|
+
batchSize,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
await i18nTask();
|
|
41
|
+
});
|
|
6
42
|
}
|
|
7
43
|
//# sourceMappingURL=i18n.js.map
|
|
8
|
-
//# debugId=
|
|
44
|
+
//# debugId=0c9ca03e-3524-51f9-829a-4fa2f955f3d7
|
|
@@ -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 metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n ...(allOptions.matchingExtensions && {\n matchingExtensions: allOptions.matchingExtensions\n .split(',')\n .map((ext) => ext.trim()),\n }),\n maxConcurrency: concurrency,\n batchSize,\n },\n });\n await i18nTask();\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmB,EAAE,OAAgB;IACrE,MAAM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;aACV;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,EAAE,CAAC;IACnB,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"0c9ca03e-3524-51f9-829a-4fa2f955f3d7"}
|
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,iBAuCjB"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
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]="f55fa730-9352-5e2c-8913-7a3a42ef5cb8")}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
|
+
metadata: {},
|
|
24
|
+
cliOptions: allOptions,
|
|
25
|
+
options: {
|
|
26
|
+
...(allOptions.matchingFiles && {
|
|
27
|
+
matchingFiles: allOptions.matchingFiles
|
|
28
|
+
.split(',')
|
|
29
|
+
.map((file) => file.trim()),
|
|
30
|
+
}),
|
|
31
|
+
...(allOptions.matchingExtensions && {
|
|
32
|
+
matchingExtensions: allOptions.matchingExtensions
|
|
33
|
+
.split(',')
|
|
34
|
+
.map((ext) => ext.trim()),
|
|
35
|
+
}),
|
|
36
|
+
maxConcurrency: concurrency,
|
|
37
|
+
batchSize,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
41
|
+
});
|
|
6
42
|
}
|
|
7
43
|
//# sourceMappingURL=setup.js.map
|
|
8
|
-
//# debugId=
|
|
44
|
+
//# debugId=f55fa730-9352-5e2c-8913-7a3a42ef5cb8
|
|
@@ -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 metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n ...(allOptions.matchingExtensions && {\n matchingExtensions: allOptions.matchingExtensions\n .split(',')\n .map((ext) => ext.trim()),\n }),\n maxConcurrency: concurrency,\n batchSize,\n },\n });\n await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,M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,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,kBAAkB,IAAI;oBACnC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;yBAC9C,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;iBAC5B,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":"f55fa730-9352-5e2c-8913-7a3a42ef5cb8"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "locadex",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "An AI agent for internationalization",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
21
21
|
"@sentry/cli": "^2.46.0",
|
|
22
22
|
"@sentry/node": "^9.26.0",
|
|
23
|
-
"chalk": "^4.1
|
|
23
|
+
"chalk": "^5.4.1",
|
|
24
24
|
"commander": "^12.1.0",
|
|
25
25
|
"dependency-tree": "^11.1.1",
|
|
26
26
|
"dotenv": "^16.4.5",
|
|
27
27
|
"express": "^5.1.0",
|
|
28
|
-
"gtx-cli": "^1.2.24-alpha.
|
|
28
|
+
"gtx-cli": "^1.2.24-alpha.4",
|
|
29
29
|
"posthog-node": "^4.18.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|