@scoutello/i18n-magic 0.39.2 → 0.41.0
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/mcp-server.js +59 -2
- package/dist/mcp-server.js.map +1 -1
- package/package.json +2 -1
- package/src/mcp-server.ts +68 -2
package/dist/mcp-server.js
CHANGED
|
@@ -5,6 +5,53 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { addTranslationKey } from "./lib/utils.js";
|
|
7
7
|
import { loadConfig } from "./lib/utils.js";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import fs from "fs";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
// Get __dirname equivalent in ES modules
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
// Helper function to find project root by looking for i18n-magic.js
|
|
15
|
+
function findProjectRoot(startDir) {
|
|
16
|
+
let currentDir = startDir;
|
|
17
|
+
const root = path.parse(currentDir).root;
|
|
18
|
+
while (currentDir !== root) {
|
|
19
|
+
const configPath = path.join(currentDir, "i18n-magic.js");
|
|
20
|
+
if (fs.existsSync(configPath)) {
|
|
21
|
+
return currentDir;
|
|
22
|
+
}
|
|
23
|
+
currentDir = path.dirname(currentDir);
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
// Helper function to resolve project root
|
|
28
|
+
function resolveProjectRoot() {
|
|
29
|
+
// 1. Check for --project-root CLI argument
|
|
30
|
+
const args = process.argv.slice(2);
|
|
31
|
+
const projectRootIndex = args.indexOf("--project-root");
|
|
32
|
+
if (projectRootIndex !== -1 && args[projectRootIndex + 1]) {
|
|
33
|
+
const projectRoot = args[projectRootIndex + 1];
|
|
34
|
+
console.error(`[i18n-magic MCP] Using project root from --project-root: ${projectRoot}`);
|
|
35
|
+
return path.resolve(projectRoot);
|
|
36
|
+
}
|
|
37
|
+
// 2. Check for I18N_MCP_PROJECT_ROOT environment variable
|
|
38
|
+
if (process.env.I18N_MCP_PROJECT_ROOT) {
|
|
39
|
+
const projectRoot = process.env.I18N_MCP_PROJECT_ROOT;
|
|
40
|
+
console.error(`[i18n-magic MCP] Using project root from I18N_MCP_PROJECT_ROOT: ${projectRoot}`);
|
|
41
|
+
return path.resolve(projectRoot);
|
|
42
|
+
}
|
|
43
|
+
// 3. Try to auto-detect project root from script location
|
|
44
|
+
// When installed in node_modules, traverse up to find i18n-magic.js
|
|
45
|
+
const autoDetected = findProjectRoot(__dirname);
|
|
46
|
+
if (autoDetected) {
|
|
47
|
+
console.error(`[i18n-magic MCP] Auto-detected project root: ${autoDetected}`);
|
|
48
|
+
return autoDetected;
|
|
49
|
+
}
|
|
50
|
+
// 4. Fall back to current working directory
|
|
51
|
+
const cwd = process.cwd();
|
|
52
|
+
console.error(`[i18n-magic MCP] Using current working directory as project root: ${cwd}`);
|
|
53
|
+
return cwd;
|
|
54
|
+
}
|
|
8
55
|
// Zod schema for the add_translation_key tool parameters
|
|
9
56
|
const AddTranslationKeySchema = z.object({
|
|
10
57
|
key: z
|
|
@@ -130,8 +177,18 @@ class I18nMagicServer {
|
|
|
130
177
|
});
|
|
131
178
|
}
|
|
132
179
|
async run() {
|
|
133
|
-
//
|
|
134
|
-
|
|
180
|
+
// Resolve and change to the project root directory
|
|
181
|
+
const projectRoot = resolveProjectRoot();
|
|
182
|
+
// Change to the project directory to ensure config and files are found
|
|
183
|
+
try {
|
|
184
|
+
process.chdir(projectRoot);
|
|
185
|
+
console.error(`[i18n-magic MCP] Changed working directory to: ${process.cwd()}`);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.error(`[i18n-magic MCP] Failed to change to project root: ${error}`);
|
|
189
|
+
throw new Error(`Cannot access project directory: ${projectRoot}`);
|
|
190
|
+
}
|
|
191
|
+
// Load config immediately at startup
|
|
135
192
|
await this.ensureConfig();
|
|
136
193
|
const transport = new StdioServerTransport();
|
|
137
194
|
await this.server.connect(transport);
|
package/dist/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,yCAAyC;AACzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AAE1C,oEAAoE;AACpE,SAAS,eAAe,CAAC,QA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|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
|
|
2
3
|
"name": "@scoutello/i18n-magic",
|
|
3
|
-
"version": "0.
|
|
4
|
+
"version": "0.41.0",
|
|
4
5
|
"private": false,
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"description": "Intelligent CLI toolkit that automates internationalization workflows with AI-powered translations for JavaScript/TypeScript projects",
|
package/src/mcp-server.ts
CHANGED
|
@@ -8,6 +8,61 @@ import { z } from "zod"
|
|
|
8
8
|
import { addTranslationKey } from "./lib/utils.js"
|
|
9
9
|
import { loadConfig } from "./lib/utils.js"
|
|
10
10
|
import type { Configuration } from "./lib/types.js"
|
|
11
|
+
import path from "path"
|
|
12
|
+
import fs from "fs"
|
|
13
|
+
import { fileURLToPath } from "url"
|
|
14
|
+
|
|
15
|
+
// Get __dirname equivalent in ES modules
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
17
|
+
const __dirname = path.dirname(__filename)
|
|
18
|
+
|
|
19
|
+
// Helper function to find project root by looking for i18n-magic.js
|
|
20
|
+
function findProjectRoot(startDir: string): string | null {
|
|
21
|
+
let currentDir = startDir
|
|
22
|
+
const root = path.parse(currentDir).root
|
|
23
|
+
|
|
24
|
+
while (currentDir !== root) {
|
|
25
|
+
const configPath = path.join(currentDir, "i18n-magic.js")
|
|
26
|
+
if (fs.existsSync(configPath)) {
|
|
27
|
+
return currentDir
|
|
28
|
+
}
|
|
29
|
+
currentDir = path.dirname(currentDir)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Helper function to resolve project root
|
|
36
|
+
function resolveProjectRoot(): string {
|
|
37
|
+
// 1. Check for --project-root CLI argument
|
|
38
|
+
const args = process.argv.slice(2)
|
|
39
|
+
const projectRootIndex = args.indexOf("--project-root")
|
|
40
|
+
if (projectRootIndex !== -1 && args[projectRootIndex + 1]) {
|
|
41
|
+
const projectRoot = args[projectRootIndex + 1]
|
|
42
|
+
console.error(`[i18n-magic MCP] Using project root from --project-root: ${projectRoot}`)
|
|
43
|
+
return path.resolve(projectRoot)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 2. Check for I18N_MCP_PROJECT_ROOT environment variable
|
|
47
|
+
if (process.env.I18N_MCP_PROJECT_ROOT) {
|
|
48
|
+
const projectRoot = process.env.I18N_MCP_PROJECT_ROOT
|
|
49
|
+
console.error(`[i18n-magic MCP] Using project root from I18N_MCP_PROJECT_ROOT: ${projectRoot}`)
|
|
50
|
+
return path.resolve(projectRoot)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 3. Try to auto-detect project root from script location
|
|
54
|
+
// When installed in node_modules, traverse up to find i18n-magic.js
|
|
55
|
+
const autoDetected = findProjectRoot(__dirname)
|
|
56
|
+
if (autoDetected) {
|
|
57
|
+
console.error(`[i18n-magic MCP] Auto-detected project root: ${autoDetected}`)
|
|
58
|
+
return autoDetected
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 4. Fall back to current working directory
|
|
62
|
+
const cwd = process.cwd()
|
|
63
|
+
console.error(`[i18n-magic MCP] Using current working directory as project root: ${cwd}`)
|
|
64
|
+
return cwd
|
|
65
|
+
}
|
|
11
66
|
|
|
12
67
|
// Zod schema for the add_translation_key tool parameters
|
|
13
68
|
const AddTranslationKeySchema = z.object({
|
|
@@ -168,8 +223,19 @@ class I18nMagicServer {
|
|
|
168
223
|
}
|
|
169
224
|
|
|
170
225
|
async run() {
|
|
171
|
-
//
|
|
172
|
-
|
|
226
|
+
// Resolve and change to the project root directory
|
|
227
|
+
const projectRoot = resolveProjectRoot()
|
|
228
|
+
|
|
229
|
+
// Change to the project directory to ensure config and files are found
|
|
230
|
+
try {
|
|
231
|
+
process.chdir(projectRoot)
|
|
232
|
+
console.error(`[i18n-magic MCP] Changed working directory to: ${process.cwd()}`)
|
|
233
|
+
} catch (error) {
|
|
234
|
+
console.error(`[i18n-magic MCP] Failed to change to project root: ${error}`)
|
|
235
|
+
throw new Error(`Cannot access project directory: ${projectRoot}`)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Load config immediately at startup
|
|
173
239
|
await this.ensureConfig()
|
|
174
240
|
|
|
175
241
|
const transport = new StdioServerTransport()
|