locadex 0.0.2-alpha.1 → 0.0.2-alpha.4
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/.locadex-mcp-stdio.json +9 -0
- package/.locadex-mcp.json +2 -3
- package/LICENSE.md +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +44 -9
- package/dist/cli.js.map +1 -1
- package/dist/commands/i18n.d.ts +2 -1
- package/dist/commands/i18n.d.ts.map +1 -1
- package/dist/commands/i18n.js +255 -140
- package/dist/commands/i18n.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +141 -86
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -68
- package/dist/index.js.map +1 -1
- package/dist/{utils/logging.d.ts → logging/console.d.ts} +9 -12
- package/dist/logging/console.d.ts.map +1 -0
- package/dist/logging/console.js +137 -0
- package/dist/logging/console.js.map +1 -0
- package/dist/logging/logger.d.ts +44 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +142 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/mcp/debugger.d.ts +3 -0
- package/dist/mcp/debugger.d.ts.map +1 -0
- package/dist/mcp/debugger.js +37 -0
- package/dist/mcp/debugger.js.map +1 -0
- package/dist/mcp/getDocs.d.ts.map +1 -0
- package/dist/mcp/getDocs.js +56 -0
- package/dist/mcp/getDocs.js.map +1 -0
- package/dist/mcp/getGuide.d.ts +5 -0
- package/dist/mcp/getGuide.d.ts.map +1 -0
- package/dist/mcp/getGuide.js +17 -0
- package/dist/mcp/getGuide.js.map +1 -0
- package/dist/{tools → mcp/tools}/docs.d.ts +3 -0
- package/dist/mcp/tools/docs.d.ts.map +1 -0
- package/dist/mcp/tools/docs.js +86 -0
- package/dist/mcp/tools/docs.js.map +1 -0
- package/dist/mcp/tools/guides.d.ts +11 -0
- package/dist/mcp/tools/guides.d.ts.map +1 -0
- package/dist/mcp/tools/guides.js +118 -0
- package/dist/mcp/tools/guides.js.map +1 -0
- package/dist/mcp-sse.d.ts +3 -0
- package/dist/mcp-sse.d.ts.map +1 -0
- package/dist/mcp-sse.js +95 -0
- package/dist/mcp-sse.js.map +1 -0
- package/dist/mcp.d.ts +3 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +34 -0
- package/dist/mcp.js.map +1 -0
- package/dist/prompts/system.d.ts +4 -0
- package/dist/prompts/system.d.ts.map +1 -0
- package/dist/prompts/system.js +17 -0
- package/dist/prompts/system.js.map +1 -0
- package/dist/telemetry.d.ts +11 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +104 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types/claude-sdk.d.ts +39 -0
- package/dist/types/claude-sdk.d.ts.map +1 -0
- package/dist/types/claude-sdk.js +5 -0
- package/dist/types/claude-sdk.js.map +1 -0
- package/dist/types/cli.d.ts +7 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +5 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/utils/agentManager.d.ts +34 -0
- package/dist/utils/agentManager.d.ts.map +1 -0
- package/dist/utils/agentManager.js +123 -0
- package/dist/utils/agentManager.js.map +1 -0
- package/dist/utils/claudeCode.d.ts +14 -6
- package/dist/utils/claudeCode.d.ts.map +1 -1
- package/dist/utils/claudeCode.js +170 -102
- package/dist/utils/claudeCode.js.map +1 -1
- package/dist/utils/dag/createDag.d.ts +24 -0
- package/dist/utils/dag/createDag.d.ts.map +1 -0
- package/dist/utils/dag/createDag.js +181 -0
- package/dist/utils/dag/createDag.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +3 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +36 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/fs/findConfigs.d.ts +11 -0
- package/dist/utils/fs/findConfigs.d.ts.map +1 -0
- package/dist/utils/fs/findConfigs.js +63 -0
- package/dist/utils/fs/findConfigs.js.map +1 -0
- package/dist/utils/fs/getFiles.d.ts +2 -0
- package/dist/utils/fs/getFiles.d.ts.map +1 -0
- package/dist/utils/fs/getFiles.js +8 -0
- package/dist/utils/fs/getFiles.js.map +1 -0
- package/dist/utils/fs/writeFiles.d.ts +2 -0
- package/dist/utils/fs/writeFiles.d.ts.map +1 -0
- package/dist/utils/fs/writeFiles.js +19 -0
- package/dist/utils/fs/writeFiles.js.map +1 -0
- package/dist/utils/getFiles.d.ts +30 -0
- package/dist/utils/getFiles.d.ts.map +1 -0
- package/dist/utils/getFiles.js +152 -0
- package/dist/utils/getFiles.js.map +1 -0
- package/dist/utils/getPaths.d.ts +1 -0
- package/dist/utils/getPaths.d.ts.map +1 -1
- package/dist/utils/getPaths.js +19 -3
- package/dist/utils/getPaths.js.map +1 -1
- package/dist/utils/mcpConfig.d.ts.map +1 -1
- package/dist/utils/mcpConfig.js +5 -2
- package/dist/utils/mcpConfig.js.map +1 -1
- package/dist/utils/shared.d.ts +4 -0
- package/dist/utils/shared.d.ts.map +1 -0
- package/dist/utils/shared.js +26 -0
- package/dist/utils/shared.js.map +1 -0
- package/dist/utils/stats.d.ts +25 -0
- package/dist/utils/stats.d.ts.map +1 -0
- package/dist/utils/stats.js +40 -0
- package/dist/utils/stats.js.map +1 -0
- package/dist/utils/validateConfig.d.ts +2 -0
- package/dist/utils/validateConfig.d.ts.map +1 -0
- package/dist/utils/validateConfig.js +12 -0
- package/dist/utils/validateConfig.js.map +1 -0
- package/guides/next/advanced/complicated-mapping-expressions.md +200 -0
- package/guides/next/advanced/interpolated-strings.md +162 -0
- package/guides/next/advanced/migrating.md +86 -0
- package/guides/next/advanced/ternary-operators.md +217 -0
- package/guides/next/advanced/var-outside-client-component.md +446 -0
- package/guides/next/advanced/var-outside-client-server-component.md +550 -0
- package/guides/next/advanced/var-outside-server-component.md +545 -0
- package/guides/next/basic/branches.md +310 -0
- package/guides/next/basic/client-side-components.md +221 -0
- package/guides/next/basic/jsx.md +268 -0
- package/guides/next/basic/server-side-components.md +165 -0
- package/guides/next/basic/strings.md +144 -0
- package/guides/next/basic/variables.md +161 -0
- package/guides/next/important/functions.md +37 -0
- package/package.json +27 -13
- package/dist/resources/docs.d.ts +0 -4
- package/dist/resources/docs.d.ts.map +0 -1
- package/dist/resources/docs.js +0 -176
- package/dist/resources/docs.js.map +0 -1
- package/dist/tools/docs.d.ts.map +0 -1
- package/dist/tools/docs.js +0 -140
- package/dist/tools/docs.js.map +0 -1
- package/dist/utils/getDocs.d.ts.map +0 -1
- package/dist/utils/getDocs.js +0 -113
- package/dist/utils/getDocs.js.map +0 -1
- package/dist/utils/logging.d.ts.map +0 -1
- package/dist/utils/logging.js +0 -226
- package/dist/utils/logging.js.map +0 -1
- /package/dist/{utils → mcp}/getDocs.d.ts +0 -0
package/.locadex-mcp.json
CHANGED
package/LICENSE.md
CHANGED
package/dist/cli.d.ts
CHANGED
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"/","sources":["cli.ts"],"names":[],"mappings":";AAOA,OAAO,gBAAgB,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
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]="de41ed32-096f-5018-bae8-c28bdded6930")}catch(e){}}();
|
|
2
4
|
import dotenv from 'dotenv';
|
|
3
|
-
dotenv.config();
|
|
5
|
+
dotenv.config({ path: '.env' });
|
|
6
|
+
dotenv.config({ path: '.env.local', override: true });
|
|
7
|
+
dotenv.config({ path: '.env.production', override: true });
|
|
8
|
+
import './telemetry.js';
|
|
4
9
|
import { Command } from 'commander';
|
|
5
10
|
import { readFileSync } from 'node:fs';
|
|
6
11
|
import { fromPackageRoot } from './utils/getPaths.js';
|
|
7
12
|
import { setupCommand } from './commands/setup.js';
|
|
13
|
+
import { withTelemetry } from './telemetry.js';
|
|
14
|
+
import { logger } from './logging/logger.js';
|
|
8
15
|
import { i18nCommand } from './commands/i18n.js';
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
import { displayHeader } from './logging/console.js';
|
|
17
|
+
import { main } from 'gtx-cli/index';
|
|
18
|
+
const packageJson = JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'));
|
|
19
|
+
const program = new Command();
|
|
11
20
|
program
|
|
12
21
|
.name('locadex')
|
|
13
22
|
.description('AI agent for internationalization')
|
|
14
23
|
.version(packageJson.version);
|
|
15
24
|
program
|
|
16
|
-
.command('
|
|
17
|
-
.description('
|
|
18
|
-
.
|
|
25
|
+
.command('start')
|
|
26
|
+
.description('Run Locadex on your project')
|
|
27
|
+
.option('-v, --verbose', 'Verbose output')
|
|
28
|
+
.option('-d, --debug', 'Debug output')
|
|
29
|
+
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
30
|
+
.option('--no-telemetry', 'Disable telemetry')
|
|
31
|
+
.action((options, command) => {
|
|
32
|
+
const parentOptions = command.parent?.opts() || {};
|
|
33
|
+
const allOptions = { ...parentOptions, ...options };
|
|
34
|
+
withTelemetry({ enabled: !allOptions.noTelemetry, options: allOptions }, () => {
|
|
35
|
+
logger.initialize(allOptions);
|
|
36
|
+
displayHeader();
|
|
37
|
+
setupCommand(Number(allOptions.batchSize) || 1);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
19
40
|
program
|
|
20
41
|
.command('i18n')
|
|
21
|
-
.description('Run
|
|
22
|
-
.
|
|
42
|
+
.description('Run Locadex i18n on your project')
|
|
43
|
+
.option('-v, --verbose', 'Verbose output')
|
|
44
|
+
.option('-d, --debug', 'Debug output')
|
|
45
|
+
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
46
|
+
.option('--no-telemetry', 'Disable telemetry')
|
|
47
|
+
.action((options, command) => {
|
|
48
|
+
const parentOptions = command.parent?.opts() || {};
|
|
49
|
+
const allOptions = { ...parentOptions, ...options };
|
|
50
|
+
withTelemetry({ enabled: !allOptions.noTelemetry, options: allOptions }, () => {
|
|
51
|
+
logger.initialize(allOptions);
|
|
52
|
+
displayHeader();
|
|
53
|
+
i18nCommand(Number(allOptions.batchSize) || 1);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
main(program);
|
|
23
57
|
program.parse();
|
|
24
|
-
//# sourceMappingURL=cli.js.map
|
|
58
|
+
//# sourceMappingURL=cli.js.map
|
|
59
|
+
//# debugId=de41ed32-096f-5018-bae8-c28bdded6930
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\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 { CliOptions } from './types/cli.js';\nimport { withTelemetry } from './telemetry.js';\nimport { logger } from './logging/logger.js';\nimport { i18nCommand } from './commands/i18n.js';\nimport { displayHeader } from './logging/console.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('--no-telemetry', 'Disable telemetry')\n .action((options: CliOptions, command: Command) => {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n withTelemetry(\n { enabled: !allOptions.noTelemetry, options: allOptions },\n () => {\n logger.initialize(allOptions);\n displayHeader();\n setupCommand(Number(allOptions.batchSize) || 1);\n }\n );\n });\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('--no-telemetry', 'Disable telemetry')\n .action((options: CliOptions, command: Command) => {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n withTelemetry(\n { enabled: !allOptions.noTelemetry, options: allOptions },\n () => {\n logger.initialize(allOptions);\n displayHeader();\n i18nCommand(Number(allOptions.batchSize) || 1);\n }\n );\n });\n\nmain(program);\n\nprogram.parse();\n"],"names":[],"mappings":";;;AACA,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,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AAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,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,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,CAAC,OAAmB,EAAE,OAAgB,EAAE,EAAE;IAChD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,aAAa,CACX,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,EACzD,GAAG,EAAE;QACH,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9B,aAAa,EAAE,CAAC;QAChB,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","debug_id":"de41ed32-096f-5018-bae8-c28bdded6930"}
|
package/dist/commands/i18n.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAgC1D,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,iBAwK5E"}
|
package/dist/commands/i18n.js
CHANGED
|
@@ -1,145 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { intro, outro, text, select, spinner } from '@clack/prompts';
|
|
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]="24e0dc6c-383b-537d-98d1-ca9226e5afa3")}catch(e){}}();
|
|
3
|
+
import { createSpinner } from '../logging/console.js';
|
|
4
|
+
import { allMcpPrompt } from '../prompts/system.js';
|
|
5
|
+
import { logger } from '../logging/logger.js';
|
|
6
|
+
import { createDag } from '../utils/dag/createDag.js';
|
|
7
|
+
import { findTsConfig, findWebpackConfig, findRequireConfig, } from '../utils/fs/findConfigs.js';
|
|
8
|
+
import { LocadexManager } from '../utils/agentManager.js';
|
|
9
|
+
import { addFilesToManager, markFileAsEdited, markFileAsInProgress, } from '../utils/getFiles.js';
|
|
10
|
+
import { outro } from '@clack/prompts';
|
|
38
11
|
import chalk from 'chalk';
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
switch (_b.label) {
|
|
50
|
-
case 0:
|
|
51
|
-
intro(chalk.blue('🌍 Locadex i18n'));
|
|
52
|
-
_b.label = 1;
|
|
53
|
-
case 1:
|
|
54
|
-
_b.trys.push([1, 12, , 13]);
|
|
55
|
-
configPath = join(process.cwd(), '.locadex.json');
|
|
56
|
-
if (!existsSync(configPath)) {
|
|
57
|
-
outro(chalk.red('❌ Locadex not configured. Run `npx locadex setup` first.'));
|
|
58
|
-
return [2 /*return*/];
|
|
59
|
-
}
|
|
60
|
-
config = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
61
|
-
if (!config.setupComplete) {
|
|
62
|
-
outro(chalk.red('❌ Setup incomplete. Please run `npx locadex setup` again.'));
|
|
63
|
-
return [2 /*return*/];
|
|
64
|
-
}
|
|
65
|
-
return [4 /*yield*/, select({
|
|
66
|
-
message: 'What would you like to do?',
|
|
67
|
-
options: [
|
|
68
|
-
{ value: 'extract', label: 'Extract text for translation' },
|
|
69
|
-
{ value: 'translate', label: 'Generate translations' },
|
|
70
|
-
{ value: 'audit', label: 'Audit existing translations' },
|
|
71
|
-
{ value: 'refactor', label: 'Refactor hardcoded strings' },
|
|
72
|
-
{ value: 'custom', label: 'Custom i18n task' },
|
|
73
|
-
],
|
|
74
|
-
})];
|
|
75
|
-
case 2:
|
|
76
|
-
task = _b.sent();
|
|
77
|
-
prompt_1 = '';
|
|
78
|
-
_a = task;
|
|
79
|
-
switch (_a) {
|
|
80
|
-
case 'extract': return [3 /*break*/, 3];
|
|
81
|
-
case 'translate': return [3 /*break*/, 4];
|
|
82
|
-
case 'audit': return [3 /*break*/, 6];
|
|
83
|
-
case 'refactor': return [3 /*break*/, 7];
|
|
84
|
-
case 'custom': return [3 /*break*/, 8];
|
|
85
|
-
}
|
|
86
|
-
return [3 /*break*/, 10];
|
|
87
|
-
case 3:
|
|
88
|
-
prompt_1 =
|
|
89
|
-
'Scan the codebase and extract all user-facing text that needs translation. Create appropriate translation keys and organize them logically.';
|
|
90
|
-
return [3 /*break*/, 10];
|
|
91
|
-
case 4: return [4 /*yield*/, text({
|
|
92
|
-
message: 'Target language (e.g., "es", "fr", "de"):',
|
|
93
|
-
placeholder: 'es',
|
|
94
|
-
})];
|
|
95
|
-
case 5:
|
|
96
|
-
targetLang = _b.sent();
|
|
97
|
-
prompt_1 = "Generate translations for the target language: ".concat(typeof targetLang === 'string' ? targetLang : 'es', ". Maintain context and ensure culturally appropriate translations.");
|
|
98
|
-
return [3 /*break*/, 10];
|
|
99
|
-
case 6:
|
|
100
|
-
prompt_1 =
|
|
101
|
-
'Audit existing translations for completeness, consistency, and quality. Identify missing keys and potential improvements.';
|
|
102
|
-
return [3 /*break*/, 10];
|
|
103
|
-
case 7:
|
|
104
|
-
prompt_1 =
|
|
105
|
-
'Find hardcoded strings in the codebase and refactor them to use the i18n system. Maintain functionality while making text translatable.';
|
|
106
|
-
return [3 /*break*/, 10];
|
|
107
|
-
case 8: return [4 /*yield*/, text({
|
|
108
|
-
message: 'Describe your i18n task:',
|
|
109
|
-
placeholder: 'I need help with...',
|
|
110
|
-
})];
|
|
111
|
-
case 9:
|
|
112
|
-
customPrompt = _b.sent();
|
|
113
|
-
prompt_1 = typeof customPrompt === 'string' ? customPrompt : '';
|
|
114
|
-
return [3 /*break*/, 10];
|
|
115
|
-
case 10:
|
|
116
|
-
s = spinner();
|
|
117
|
-
s.start('Processing i18n task...');
|
|
118
|
-
claudeRunner = new ClaudeCodeRunner({
|
|
119
|
-
apiKey: config.apiKey,
|
|
120
|
-
});
|
|
121
|
-
mcpConfigPath = fromPackageRoot('.locadex-mcp.json');
|
|
122
|
-
return [4 /*yield*/, claudeRunner.run({
|
|
123
|
-
// systemPrompt: I18N_SYSTEM_PROMPT,
|
|
124
|
-
prompt: prompt_1,
|
|
125
|
-
mcpConfig: mcpConfigPath,
|
|
126
|
-
allowedTools: ['mcp__*'],
|
|
127
|
-
})];
|
|
128
|
-
case 11:
|
|
129
|
-
result = _b.sent();
|
|
130
|
-
s.stop('Task complete');
|
|
131
|
-
logInfo('\n' + chalk.green('📋 Result:'));
|
|
132
|
-
logInfo(result);
|
|
133
|
-
outro(chalk.green('✅ i18n task completed!'));
|
|
134
|
-
return [3 /*break*/, 13];
|
|
135
|
-
case 12:
|
|
136
|
-
error_1 = _b.sent();
|
|
137
|
-
outro(chalk.red("\u274C Task failed: ".concat(error_1 instanceof Error ? error_1.message : String(error_1))));
|
|
138
|
-
process.exit(1);
|
|
139
|
-
return [3 /*break*/, 13];
|
|
140
|
-
case 13: return [2 /*return*/];
|
|
12
|
+
import { readdirSync, statSync } from 'node:fs';
|
|
13
|
+
import { EXCLUDED_DIRS } from '../utils/shared.js';
|
|
14
|
+
import { validateInitialConfig } from '../utils/validateConfig.js';
|
|
15
|
+
import { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';
|
|
16
|
+
function getCurrentDirectories() {
|
|
17
|
+
try {
|
|
18
|
+
return readdirSync(process.cwd())
|
|
19
|
+
.filter((item) => {
|
|
20
|
+
try {
|
|
21
|
+
return statSync(item).isDirectory();
|
|
141
22
|
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
.map((dir) => `./${dir}`)
|
|
28
|
+
.filter((dir) => {
|
|
29
|
+
return !EXCLUDED_DIRS.includes(dir);
|
|
142
30
|
});
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export async function i18nCommand(batchSize, manager) {
|
|
37
|
+
validateInitialConfig();
|
|
38
|
+
// Init message
|
|
39
|
+
const spinner = createSpinner();
|
|
40
|
+
spinner.start('Initializing Locadex...');
|
|
41
|
+
const startTime = Date.now();
|
|
42
|
+
const dag = createDag(getCurrentDirectories(), {
|
|
43
|
+
tsConfig: findTsConfig(),
|
|
44
|
+
webpackConfig: findWebpackConfig(),
|
|
45
|
+
requireConfig: findRequireConfig(),
|
|
143
46
|
});
|
|
47
|
+
// If no manager is provided, create a new one
|
|
48
|
+
if (!manager) {
|
|
49
|
+
manager = new LocadexManager({
|
|
50
|
+
mcpTransport: 'sse',
|
|
51
|
+
metadata: {
|
|
52
|
+
batchSize: batchSize,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
process.on('beforeExit', () => manager.cleanup());
|
|
56
|
+
}
|
|
57
|
+
const agent = manager.createAgent();
|
|
58
|
+
const filesStateFilePath = manager.getFilesStateFilePath();
|
|
59
|
+
// Track session id
|
|
60
|
+
let sessionId = undefined;
|
|
61
|
+
// Create the list of files (aka tasks) to process
|
|
62
|
+
const taskQueue = [...dag.getTopologicalOrder()];
|
|
63
|
+
const allFiles = [...dag.getTopologicalOrder()];
|
|
64
|
+
// Add files to manager
|
|
65
|
+
const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);
|
|
66
|
+
spinner.stop('Locadex initialized');
|
|
67
|
+
logger.verboseMessage(`Number of files to process: ${dag.getTopologicalOrder().length}`);
|
|
68
|
+
logger.debugMessage(`Track progress here: ${stateFilePath}`);
|
|
69
|
+
logger.initializeProgressBar(taskQueue.length);
|
|
70
|
+
logger.progressBar.start('Processing files...');
|
|
71
|
+
// Main loop
|
|
72
|
+
let hasError = false;
|
|
73
|
+
while (taskQueue.length > 0) {
|
|
74
|
+
// Get the next task
|
|
75
|
+
const tasks = taskQueue.splice(0, batchSize);
|
|
76
|
+
if (tasks.length === 0) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
// Mark task as in progress
|
|
80
|
+
tasks.forEach((task) => markFileAsInProgress(task, filesStateFilePath));
|
|
81
|
+
// Construct prompt
|
|
82
|
+
const dependencies = Object.fromEntries(tasks.map((task) => [
|
|
83
|
+
task,
|
|
84
|
+
Array.from(new Set(dag.getDependencies(task))),
|
|
85
|
+
]));
|
|
86
|
+
const dependents = Object.fromEntries(tasks.map((task) => [task, Array.from(new Set(dag.getDependents(task)))]));
|
|
87
|
+
const prompt = getPrompt({
|
|
88
|
+
targetFile: tasks,
|
|
89
|
+
dependencyFiles: dependencies,
|
|
90
|
+
dependentFiles: dependents,
|
|
91
|
+
});
|
|
92
|
+
// Claude call
|
|
93
|
+
try {
|
|
94
|
+
await agent.run({
|
|
95
|
+
prompt,
|
|
96
|
+
sessionId,
|
|
97
|
+
}, { spinner });
|
|
98
|
+
if (!sessionId) {
|
|
99
|
+
sessionId = agent.getSessionId();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
hasError = true;
|
|
104
|
+
logger.debugMessage(`[i18n] Error in claude i18n process: ${error}`);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
// Mark task as complete
|
|
108
|
+
tasks.forEach((task) => markFileAsEdited(task, filesStateFilePath));
|
|
109
|
+
logger.progressBar.advance(tasks.length, `Processed ${Number(((allFiles.length - taskQueue.length) / allFiles.length) * 100).toFixed(2)}% of files`);
|
|
110
|
+
manager.stats.updateStats({
|
|
111
|
+
newProcessedFiles: tasks.length,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
logger.progressBar.stop(`Processed ${allFiles.length} files`);
|
|
115
|
+
// TODO: uncomment
|
|
116
|
+
// // Always clean up the file list when done, regardless of success or failure
|
|
117
|
+
// logger.info(`Cleaning up file list: ${stateFilePath}`);
|
|
118
|
+
// cleanUp(stateFilePath);
|
|
119
|
+
// If there was an error, exit with code 1
|
|
120
|
+
if (hasError) {
|
|
121
|
+
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
// Fix prompt
|
|
125
|
+
logger.initializeSpinner();
|
|
126
|
+
logger.spinner.start('Fixing errors...');
|
|
127
|
+
const fixPrompt = getFixPrompt();
|
|
128
|
+
try {
|
|
129
|
+
await agent.run({ prompt: fixPrompt, sessionId }, { spinner });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
logger.debugMessage(`[i18n] Fixing errors failed: ${error}`);
|
|
133
|
+
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
logger.spinner.stop('Fixed errors');
|
|
137
|
+
// Generate report
|
|
138
|
+
logger.initializeSpinner();
|
|
139
|
+
logger.spinner.start('Generating report...');
|
|
140
|
+
const reportPrompt = getReportPrompt();
|
|
141
|
+
try {
|
|
142
|
+
await agent.run({
|
|
143
|
+
prompt: reportPrompt,
|
|
144
|
+
sessionId,
|
|
145
|
+
}, { spinner });
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
logger.debugMessage(`[i18n] Error in claude report generation: ${error}`);
|
|
149
|
+
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
logger.spinner.stop('Report generated');
|
|
153
|
+
// cleanup
|
|
154
|
+
const formatter = await detectFormatter();
|
|
155
|
+
if (formatter) {
|
|
156
|
+
await formatFiles(allFiles, formatter);
|
|
157
|
+
}
|
|
158
|
+
logger.info(chalk.dim(`Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
|
|
159
|
+
Total API duration: ${Math.round(manager.stats.getStats().totalApiDuration / 1000)}s
|
|
160
|
+
Total wall duration: ${Math.round((Date.now() - startTime) / 1000)}s
|
|
161
|
+
Total files processed: ${manager.stats.getStats().processedFiles}`));
|
|
162
|
+
outro(chalk.green('✅ Locadex i18n complete!'));
|
|
163
|
+
process.exit(0);
|
|
164
|
+
}
|
|
165
|
+
function getPrompt({ targetFile, dependencyFiles, dependentFiles, }) {
|
|
166
|
+
const prompt = `# Task: Internationalize the target file(s) using gt-next.
|
|
167
|
+
|
|
168
|
+
## INSTRUCTIONS
|
|
169
|
+
|
|
170
|
+
- You are given a list of target files and their corresponding dependency/dependent files.
|
|
171
|
+
- The project is already setup for internationalization. Do not try to setup the project again for i18n.
|
|
172
|
+
|
|
173
|
+
## Workflow:
|
|
174
|
+
1. **Gather context** Read the target files closely (you should not have to read the dependency/dependent files).
|
|
175
|
+
2. **Evaluate if i18n is necessary** Evaluate if the target files need to be internationalized using gt-next
|
|
176
|
+
- If the target files have no relevant content, are already internationalized, or contain build-time code (e.g. nextjs plugins) they should never be internationalized.
|
|
177
|
+
**IMPORTANT**: IF NONE OF THE TARGET FILES NEED TO BE INTERNATIONALIZED, YOUR TASK IS COMPLETE AND YOU MAY RETURN.
|
|
178
|
+
3. **Identify the tools to use** Given the contents of the files, ask yourself which tools and guides you need to use to get the necessary knowledge to internationalize the target files. Here are some helpful questions to evaluate for tool selection:
|
|
179
|
+
- 3.a. Does this file contain a component? If so, is it a server-side component or a client-side component?
|
|
180
|
+
- 3.b. Is the content that needs to be i18ned being used in this same file, or is it being used in another file?
|
|
181
|
+
- 3.c. Is there any string interpolation that needs to be i18ned?
|
|
182
|
+
- 3.d. Is there any conditional logic or rendering that needs to be i18ned?
|
|
183
|
+
- 3.e. Is the content that needs to be i18ned HTML/JSX or a string?
|
|
184
|
+
4. **Internationalize** You now have the necessary knowledge. Internationalize the files using the information from the tools provided to you.
|
|
185
|
+
- 4.a. Do not worry about running tsc. We will do that later.
|
|
186
|
+
|
|
187
|
+
## RULES:
|
|
188
|
+
- ALWAYS use the <T> component to internationalize HTML/JSX content.
|
|
189
|
+
- ALWAYS use getGT() or useGT() and getDict() or useDict() to internationalize string content.
|
|
190
|
+
- When possible, avoid using getDict() or useDict(); getGT() and useGT() are preferred.
|
|
191
|
+
- DO NOT internationalize non-user facing content or content that is functional, such as ids, class names, error strings, logical strings, etc.
|
|
192
|
+
- Do not add i18n middleware to the app.
|
|
193
|
+
- When adding 'useGT()' or 'useDict()' to a client component, you must add 'use client' to the top of the file.
|
|
194
|
+
- Always adhere to the guides provided via the 'mcp__locadex__' tools.
|
|
195
|
+
- These guides provide additional knowledge about how to internationalize the content.
|
|
196
|
+
- Minimize the footprint of your changes.
|
|
197
|
+
- Focus on internationalizing the content of the target files.
|
|
198
|
+
- NEVER move internationalized content to a different file. All content MUST remain in the same file where it came from.
|
|
199
|
+
- NEVER CREATE OR REMOVE ANY FILES (especially .bak files)
|
|
200
|
+
- Internationalize all user facing content in the target files.
|
|
201
|
+
- NEVER EDIT FILES THAT ARE NOT GIVEN TO YOU.
|
|
202
|
+
|
|
203
|
+
## TARGET FILE INFORMATION
|
|
204
|
+
${targetFile.map((file, index) => `
|
|
205
|
+
TARGET FILE ${index + 1}:
|
|
206
|
+
${file}
|
|
207
|
+
|
|
208
|
+
DEPENDENCY FILES (files imported by target file ${index + 1}):
|
|
209
|
+
${dependencyFiles[file].length > 0 ? ` ${dependencyFiles[file].join(', ')}` : 'none'}
|
|
210
|
+
|
|
211
|
+
DEPENDENT FILES (files that import target file ${index + 1}):
|
|
212
|
+
${dependentFiles[file].length > 0 ? ` ${dependentFiles[file].join(', ')}` : 'none'}
|
|
213
|
+
`)}
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## MCP TOOLS
|
|
218
|
+
|
|
219
|
+
${allMcpPrompt}
|
|
220
|
+
`;
|
|
221
|
+
return prompt;
|
|
222
|
+
}
|
|
223
|
+
// check (dry run and ts check) should be at the end
|
|
224
|
+
function getFixPrompt() {
|
|
225
|
+
const prompt = `# Task: Fix implementation errors in the project.
|
|
226
|
+
|
|
227
|
+
## INSTRUCTIONS
|
|
228
|
+
|
|
229
|
+
Previously, you helped me internationalize a set of files in this project.
|
|
230
|
+
Your new task is as follows:
|
|
231
|
+
|
|
232
|
+
1. Run the gt-next validator.
|
|
233
|
+
2. Fix all errors relevant to the gt-next implementation code.
|
|
234
|
+
3. Whenever you are finished with your changes, run the gt-next validator.
|
|
235
|
+
4. Repeat steps 1-3 until there are no more errors, or until you believe that you have fixed all errors.
|
|
236
|
+
5. If the project is setup with linting, lint the project and fix all errors.
|
|
237
|
+
|
|
238
|
+
## RULES:
|
|
239
|
+
- DO NOT modify any files that are not relevant to the gt-next implementation code.
|
|
240
|
+
- ONLY fix errors that are relevant to the gt-next implementation code and your current or previous implementation.
|
|
241
|
+
- Resolve unused imports from 'gt-next'.
|
|
242
|
+
- In particular, if a file contains user-facing content that should be internationalized and is not, you should internationalize it.
|
|
243
|
+
- Resolve missing imports from 'gt-next'. If a file is missing an import from 'gt-next', add it.
|
|
244
|
+
|
|
245
|
+
To run the gt-next validator, run the following command:
|
|
246
|
+
'npx locadex translate --dry-run'
|
|
247
|
+
|
|
248
|
+
## MCP TOOLS
|
|
249
|
+
${allMcpPrompt}`;
|
|
250
|
+
return prompt;
|
|
251
|
+
}
|
|
252
|
+
function getReportPrompt() {
|
|
253
|
+
const prompt = `Your new task is as follows:
|
|
254
|
+
- Please add a markdown file called 'locadex-report.md' to the root of the project.
|
|
255
|
+
- The report should include a summary of the changes you made to the project.
|
|
256
|
+
- A list of items the user needs to complete to finish the internationalization process (adding env vars, etc.).`;
|
|
257
|
+
return prompt;
|
|
144
258
|
}
|
|
145
|
-
//# sourceMappingURL=i18n.js.map
|
|
259
|
+
//# sourceMappingURL=i18n.js.map
|
|
260
|
+
//# debugId=24e0dc6c-383b-537d-98d1-ca9226e5afa3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/commands/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAS9B,MAAM,UAAgB,WAAW;;;;;;oBAC/B,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;;;;oBAI7B,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE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K,CAAC,CAAC,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAK,CAAC,CAAE,CAC3E,CACF,CAAC;oBACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;CAEnB"}
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { createProgressBar, createSpinner } from '../logging/console.js';\nimport { allMcpPrompt } from '../prompts/system.js';\n\nimport { logger } from '../logging/logger.js';\nimport { createDag } from '../utils/dag/createDag.js';\nimport {\n findTsConfig,\n findWebpackConfig,\n findRequireConfig,\n} from '../utils/fs/findConfigs.js';\nimport { LocadexManager } from '../utils/agentManager.js';\nimport {\n addFilesToManager,\n markFileAsEdited,\n markFileAsInProgress,\n} from '../utils/getFiles.js';\nimport { outro } from '@clack/prompts';\nimport chalk from 'chalk';\nimport { readdirSync, statSync } from 'node:fs';\nimport { EXCLUDED_DIRS } from '../utils/shared.js';\nimport { validateInitialConfig } from '../utils/validateConfig.js';\nimport { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';\n\nfunction getCurrentDirectories(): string[] {\n try {\n return readdirSync(process.cwd())\n .filter((item) => {\n try {\n return statSync(item).isDirectory();\n } catch {\n return false;\n }\n })\n .map((dir) => `./${dir}`)\n .filter((dir) => {\n return !EXCLUDED_DIRS.includes(dir);\n });\n } catch {\n return [];\n }\n}\n\nexport async function i18nCommand(batchSize: number, manager?: LocadexManager) {\n validateInitialConfig();\n\n // Init message\n const spinner = createSpinner();\n spinner.start('Initializing Locadex...');\n const startTime = Date.now();\n\n const dag = createDag(getCurrentDirectories(), {\n tsConfig: findTsConfig(),\n webpackConfig: findWebpackConfig(),\n requireConfig: findRequireConfig(),\n });\n\n // If no manager is provided, create a new one\n if (!manager) {\n manager = new LocadexManager({\n mcpTransport: 'sse',\n metadata: {\n batchSize: batchSize,\n },\n });\n process.on('beforeExit', () => manager!.cleanup());\n }\n\n const agent = manager.createAgent();\n const filesStateFilePath = manager.getFilesStateFilePath();\n\n // Track session id\n let sessionId: string | undefined = undefined;\n\n // Create the list of files (aka tasks) to process\n const taskQueue = [...dag.getTopologicalOrder()];\n\n const allFiles = [...dag.getTopologicalOrder()];\n\n // Add files to manager\n const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);\n spinner.stop('Locadex initialized');\n\n logger.verboseMessage(\n `Number of files to process: ${dag.getTopologicalOrder().length}`\n );\n logger.debugMessage(`Track progress here: ${stateFilePath}`);\n\n logger.initializeProgressBar(taskQueue.length);\n logger.progressBar.start('Processing files...');\n // Main loop\n let hasError = false;\n while (taskQueue.length > 0) {\n // Get the next task\n const tasks = taskQueue.splice(0, batchSize);\n if (tasks.length === 0) {\n break;\n }\n\n // Mark task as in progress\n tasks.forEach((task) => markFileAsInProgress(task, filesStateFilePath));\n\n // Construct prompt\n const dependencies = Object.fromEntries(\n tasks.map((task) => [\n task,\n Array.from(new Set(dag.getDependencies(task))),\n ])\n );\n const dependents = Object.fromEntries(\n tasks.map((task) => [task, Array.from(new Set(dag.getDependents(task)))])\n );\n const prompt = getPrompt({\n targetFile: tasks,\n dependencyFiles: dependencies,\n dependentFiles: dependents,\n });\n\n // Claude call\n try {\n await agent.run(\n {\n prompt,\n sessionId,\n },\n { spinner }\n );\n if (!sessionId) {\n sessionId = agent.getSessionId();\n }\n } catch (error) {\n hasError = true;\n logger.debugMessage(`[i18n] Error in claude i18n process: ${error}`);\n break;\n }\n\n // Mark task as complete\n tasks.forEach((task) => markFileAsEdited(task, filesStateFilePath));\n logger.progressBar.advance(\n tasks.length,\n `Processed ${Number(((allFiles.length - taskQueue.length) / allFiles.length) * 100).toFixed(2)}% of files`\n );\n manager.stats.updateStats({\n newProcessedFiles: tasks.length,\n });\n }\n\n logger.progressBar.stop(`Processed ${allFiles.length} files`);\n\n // TODO: uncomment\n // // Always clean up the file list when done, regardless of success or failure\n // logger.info(`Cleaning up file list: ${stateFilePath}`);\n // cleanUp(stateFilePath);\n\n // If there was an error, exit with code 1\n if (hasError) {\n outro(chalk.red('❌ Locadex i18n failed!'));\n process.exit(1);\n }\n\n // Fix prompt\n logger.initializeSpinner();\n logger.spinner.start('Fixing errors...');\n const fixPrompt = getFixPrompt();\n try {\n await agent.run({ prompt: fixPrompt, sessionId }, { spinner });\n } catch (error) {\n logger.debugMessage(`[i18n] Fixing errors failed: ${error}`);\n outro(chalk.red('❌ Locadex i18n failed!'));\n process.exit(1);\n }\n logger.spinner.stop('Fixed errors');\n\n // Generate report\n logger.initializeSpinner();\n logger.spinner.start('Generating report...');\n const reportPrompt = getReportPrompt();\n try {\n await agent.run(\n {\n prompt: reportPrompt,\n sessionId,\n },\n { spinner }\n );\n } catch (error) {\n logger.debugMessage(`[i18n] Error in claude report generation: ${error}`);\n outro(chalk.red('❌ Locadex i18n failed!'));\n process.exit(1);\n }\n logger.spinner.stop('Report generated');\n\n // cleanup\n\n const formatter = await detectFormatter();\n\n if (formatter) {\n await formatFiles(allFiles, formatter);\n }\n\n logger.info(\n chalk.dim(\n `Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}\nTotal API duration: ${Math.round(manager.stats.getStats().totalApiDuration / 1000)}s\nTotal wall duration: ${Math.round((Date.now() - startTime) / 1000)}s\nTotal files processed: ${manager.stats.getStats().processedFiles}`\n )\n );\n\n outro(chalk.green('✅ Locadex i18n complete!'));\n process.exit(0);\n}\n\nfunction getPrompt({\n targetFile,\n dependencyFiles,\n dependentFiles,\n}: {\n targetFile: string[];\n dependencyFiles: Record<string, string[]>;\n dependentFiles: Record<string, string[]>;\n}) {\n const prompt = `# Task: Internationalize the target file(s) using gt-next.\n\n## INSTRUCTIONS\n\n- You are given a list of target files and their corresponding dependency/dependent files.\n- The project is already setup for internationalization. Do not try to setup the project again for i18n.\n\n## Workflow:\n1. **Gather context** Read the target files closely (you should not have to read the dependency/dependent files).\n2. **Evaluate if i18n is necessary** Evaluate if the target files need to be internationalized using gt-next \n - If the target files have no relevant content, are already internationalized, or contain build-time code (e.g. nextjs plugins) they should never be internationalized.\n**IMPORTANT**: IF NONE OF THE TARGET FILES NEED TO BE INTERNATIONALIZED, YOUR TASK IS COMPLETE AND YOU MAY RETURN.\n3. **Identify the tools to use** Given the contents of the files, ask yourself which tools and guides you need to use to get the necessary knowledge to internationalize the target files. Here are some helpful questions to evaluate for tool selection:\n - 3.a. Does this file contain a component? If so, is it a server-side component or a client-side component?\n - 3.b. Is the content that needs to be i18ned being used in this same file, or is it being used in another file?\n - 3.c. Is there any string interpolation that needs to be i18ned?\n - 3.d. Is there any conditional logic or rendering that needs to be i18ned?\n - 3.e. Is the content that needs to be i18ned HTML/JSX or a string?\n4. **Internationalize** You now have the necessary knowledge. Internationalize the files using the information from the tools provided to you.\n - 4.a. Do not worry about running tsc. We will do that later.\n\n## RULES:\n- ALWAYS use the <T> component to internationalize HTML/JSX content.\n- ALWAYS use getGT() or useGT() and getDict() or useDict() to internationalize string content.\n - When possible, avoid using getDict() or useDict(); getGT() and useGT() are preferred.\n- DO NOT internationalize non-user facing content or content that is functional, such as ids, class names, error strings, logical strings, etc.\n- Do not add i18n middleware to the app.\n- When adding 'useGT()' or 'useDict()' to a client component, you must add 'use client' to the top of the file.\n- Always adhere to the guides provided via the 'mcp__locadex__' tools.\n - These guides provide additional knowledge about how to internationalize the content.\n- Minimize the footprint of your changes.\n- Focus on internationalizing the content of the target files.\n- NEVER move internationalized content to a different file. All content MUST remain in the same file where it came from.\n- NEVER CREATE OR REMOVE ANY FILES (especially .bak files)\n- Internationalize all user facing content in the target files. \n- NEVER EDIT FILES THAT ARE NOT GIVEN TO YOU.\n\n## TARGET FILE INFORMATION\n${targetFile.map(\n (file, index) => `\nTARGET FILE ${index + 1}:\n${file}\n\nDEPENDENCY FILES (files imported by target file ${index + 1}):\n${dependencyFiles[file].length > 0 ? ` ${dependencyFiles[file].join(', ')}` : 'none'}\n\nDEPENDENT FILES (files that import target file ${index + 1}):\n${dependentFiles[file].length > 0 ? ` ${dependentFiles[file].join(', ')}` : 'none'}\n`\n)}\n\n---\n\n## MCP TOOLS\n\n${allMcpPrompt}\n`;\n\n return prompt;\n}\n\n// check (dry run and ts check) should be at the end\n\nfunction getFixPrompt() {\n const prompt = `# Task: Fix implementation errors in the project.\n\n## INSTRUCTIONS\n\nPreviously, you helped me internationalize a set of files in this project.\nYour new task is as follows:\n\n1. Run the gt-next validator.\n2. Fix all errors relevant to the gt-next implementation code.\n3. Whenever you are finished with your changes, run the gt-next validator.\n4. Repeat steps 1-3 until there are no more errors, or until you believe that you have fixed all errors.\n5. If the project is setup with linting, lint the project and fix all errors.\n\n## RULES:\n- DO NOT modify any files that are not relevant to the gt-next implementation code.\n- ONLY fix errors that are relevant to the gt-next implementation code and your current or previous implementation.\n- Resolve unused imports from 'gt-next'. \n - In particular, if a file contains user-facing content that should be internationalized and is not, you should internationalize it.\n- Resolve missing imports from 'gt-next'. If a file is missing an import from 'gt-next', add it.\n\nTo run the gt-next validator, run the following command:\n'npx locadex translate --dry-run'\n\n## MCP TOOLS\n${allMcpPrompt}`;\n\n return prompt;\n}\n\nfunction getReportPrompt() {\n const prompt = `Your new task is as follows:\n- Please add a markdown file called 'locadex-report.md' to the root of the project.\n- The report should include a summary of the changes you made to the project.\n- A list of items the user needs to complete to finish the internationalization process (adding env vars, etc.).`;\n\n return prompt;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,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d-98d1-ca9226e5afa3"}
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function setupCommand(): Promise<void>;
|
|
1
|
+
export declare function setupCommand(batchSize: number): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAqBA,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,iBAoHnD"}
|