gtx-cli 2.14.35 → 2.14.37
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/CHANGELOG.md +14 -0
- package/dist/bin/bin-entry.js +18 -8
- package/dist/bin/bin-entry.js.map +1 -0
- package/dist/bin/bin-main.js +43 -61
- package/dist/bin/bin-main.js.map +1 -0
- package/dist/config/generateSettings.js +2 -1
- package/dist/config/resolveConfig.js +2 -1
- package/dist/fs/config/setupConfig.js +2 -1
- package/dist/fs/matchFiles.js +2 -1
- package/dist/functions.js +2 -1
- package/dist/index.js +2 -1
- package/dist/main.js +18 -7
- package/dist/main.js.map +1 -0
- package/dist/next/parse/handleInitGT.js +2 -1
- package/dist/next/parse/wrapContent.js +2 -1
- package/dist/react/parse/wrapContent.js +2 -1
- package/dist/types/index.js +2 -1
- package/dist/utils/installPackage.js +2 -1
- package/dist/utils/packageInfo.js +2 -1
- package/dist/utils/packageJson.js +2 -1
- package/dist/utils/packageManager.js +2 -1
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.14.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`a5e6975`](https://github.com/generaltranslation/gt/commit/a5e697561776466763ee1d6cae1f4b905eed581d)]:
|
|
8
|
+
- gt@2.14.37
|
|
9
|
+
|
|
10
|
+
## 2.14.36
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`6a0e55b`](https://github.com/generaltranslation/gt/commit/6a0e55b6787b8e05f6c1fef7796e1b8b68f6d87b), [`a877a2a`](https://github.com/generaltranslation/gt/commit/a877a2a5bd5ca47b199c6caf53a6d60d96e3a300), [`347cb48`](https://github.com/generaltranslation/gt/commit/347cb4844bba2007c7942f3f0e6a2ede4a1aa73e)]:
|
|
15
|
+
- gt@2.14.36
|
|
16
|
+
|
|
3
17
|
## 2.14.35
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/bin/bin-entry.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
dotenv.config({ path:
|
|
6
|
-
dotenv.config({
|
|
7
|
-
|
|
1
|
+
import { main } from "gt";
|
|
2
|
+
import dotenv from "dotenv";
|
|
3
|
+
import { program } from "commander";
|
|
4
|
+
//#region src/bin/bin-entry.ts
|
|
5
|
+
dotenv.config({ path: ".env" });
|
|
6
|
+
dotenv.config({
|
|
7
|
+
path: ".env.local",
|
|
8
|
+
override: true
|
|
9
|
+
});
|
|
10
|
+
dotenv.config({
|
|
11
|
+
path: ".env.production",
|
|
12
|
+
override: true
|
|
13
|
+
});
|
|
8
14
|
main(program);
|
|
9
|
-
program.name(
|
|
15
|
+
program.name("gtx-cli");
|
|
10
16
|
program.parse();
|
|
17
|
+
//#endregion
|
|
18
|
+
export {};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=bin-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-entry.js","names":[],"sources":["../../src/bin/bin-entry.ts"],"sourcesContent":["// Entry point for binaries\n\nimport { main } from 'gt';\nimport dotenv from 'dotenv';\nimport { program } from 'commander';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nmain(program);\nprogram.name('gtx-cli');\nprogram.parse();\n"],"mappings":";;;;AAMA,OAAO,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,OAAO;CAAE,MAAM;CAAc,UAAU;CAAM,CAAC;AACrD,OAAO,OAAO;CAAE,MAAM;CAAmB,UAAU;CAAM,CAAC;AAE1D,KAAK,QAAQ;AACb,QAAQ,KAAK,UAAU;AACvB,QAAQ,OAAO"}
|
package/dist/bin/bin-main.js
CHANGED
|
@@ -1,67 +1,49 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const __dirname = dirname(__filename);
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { dirname, join } from "path";
|
|
5
|
+
import { chmodSync, existsSync, statSync } from "fs";
|
|
6
|
+
//#region src/bin/bin-main.ts
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
8
|
function detectPlatform() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
x64: 'gtx-cli-win32-x64.exe',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
return platformMap[platform]?.[arch] || null;
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const arch = process.arch;
|
|
11
|
+
return {
|
|
12
|
+
darwin: {
|
|
13
|
+
x64: "gtx-cli-darwin-x64",
|
|
14
|
+
arm64: "gtx-cli-darwin-arm64"
|
|
15
|
+
},
|
|
16
|
+
linux: {
|
|
17
|
+
x64: "gtx-cli-linux-x64",
|
|
18
|
+
arm64: "gtx-cli-linux-arm64"
|
|
19
|
+
},
|
|
20
|
+
win32: { x64: "gtx-cli-win32-x64.exe" }
|
|
21
|
+
}[platform]?.[arch] || null;
|
|
27
22
|
}
|
|
28
23
|
function routeToBinary() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// If we can't check/fix permissions, continue anyway
|
|
50
|
-
// The spawn might still work or give a more meaningful error
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Spawn the appropriate binary with all arguments
|
|
54
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
55
|
-
stdio: 'inherit',
|
|
56
|
-
});
|
|
57
|
-
child.on('close', (code) => {
|
|
58
|
-
// code might be null
|
|
59
|
-
process.exit(code ?? 1);
|
|
60
|
-
});
|
|
61
|
-
child.on('error', () => {
|
|
62
|
-
process.exit(1);
|
|
63
|
-
});
|
|
64
|
-
return;
|
|
24
|
+
const binaryName = detectPlatform();
|
|
25
|
+
if (!binaryName) {
|
|
26
|
+
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
const binaryPath = join(__dirname, "..", "..", "binaries", binaryName);
|
|
30
|
+
if (!existsSync(binaryPath)) {
|
|
31
|
+
console.error(`Binary not found at: ${binaryPath}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
if (process.platform !== "win32") try {
|
|
35
|
+
if (!!!(statSync(binaryPath).mode & parseInt("100", 8))) chmodSync(binaryPath, 493);
|
|
36
|
+
} catch {}
|
|
37
|
+
const child = spawn(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
38
|
+
child.on("close", (code) => {
|
|
39
|
+
process.exit(code ?? 1);
|
|
40
|
+
});
|
|
41
|
+
child.on("error", () => {
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
65
44
|
}
|
|
66
|
-
// Entry point
|
|
67
45
|
routeToBinary();
|
|
46
|
+
//#endregion
|
|
47
|
+
export {};
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=bin-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-main.js","names":[],"sources":["../../src/bin/bin-main.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Routes to proper binary based on platform\n\nimport { spawn } from 'child_process';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { existsSync, chmodSync, statSync } from 'fs';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nfunction detectPlatform() {\n const platform = process.platform;\n const arch = process.arch;\n\n // Map Node.js platform/arch to our binary names\n const platformMap: Record<string, Record<string, string>> = {\n darwin: {\n x64: 'gtx-cli-darwin-x64',\n arm64: 'gtx-cli-darwin-arm64',\n },\n linux: {\n x64: 'gtx-cli-linux-x64',\n arm64: 'gtx-cli-linux-arm64',\n },\n win32: {\n x64: 'gtx-cli-win32-x64.exe',\n },\n };\n\n return platformMap[platform]?.[arch] || null;\n}\n\nfunction routeToBinary(): void {\n const binaryName = detectPlatform();\n\n if (!binaryName) {\n console.error(`Unsupported platform: ${process.platform}-${process.arch}`);\n process.exit(1);\n }\n\n const binaryPath = join(__dirname, '..', '..', 'binaries', binaryName);\n\n if (!existsSync(binaryPath)) {\n console.error(`Binary not found at: ${binaryPath}`);\n process.exit(1);\n }\n\n // Check and fix execute permissions if needed (Unix-like systems only)\n if (process.platform !== 'win32') {\n try {\n const stats = statSync(binaryPath);\n const isExecutable = !!(stats.mode & parseInt('100', 8)); // Check owner execute bit\n\n if (!isExecutable) {\n chmodSync(binaryPath, 0o755); // Make executable\n }\n } catch {\n // If we can't check/fix permissions, continue anyway\n // The spawn might still work or give a more meaningful error\n }\n }\n\n // Spawn the appropriate binary with all arguments\n const child = spawn(binaryPath, process.argv.slice(2), {\n stdio: 'inherit',\n });\n\n child.on('close', (code) => {\n // code might be null\n process.exit(code ?? 1);\n });\n\n child.on('error', () => {\n process.exit(1);\n });\n\n return;\n}\n\n// Entry point\nrouteToBinary();\n"],"mappings":";;;;;;AAUA,MAAM,YAAY,QADC,cAAc,OAAO,KAAK,IACT,CAAC;AAErC,SAAS,iBAAiB;CACxB,MAAM,WAAW,QAAQ;CACzB,MAAM,OAAO,QAAQ;AAiBrB,QAAO;EAbL,QAAQ;GACN,KAAK;GACL,OAAO;GACR;EACD,OAAO;GACL,KAAK;GACL,OAAO;GACR;EACD,OAAO,EACL,KAAK,yBACN;EAGe,CAAC,YAAY,SAAS;;AAG1C,SAAS,gBAAsB;CAC7B,MAAM,aAAa,gBAAgB;AAEnC,KAAI,CAAC,YAAY;AACf,UAAQ,MAAM,yBAAyB,QAAQ,SAAS,GAAG,QAAQ,OAAO;AAC1E,UAAQ,KAAK,EAAE;;CAGjB,MAAM,aAAa,KAAK,WAAW,MAAM,MAAM,YAAY,WAAW;AAEtE,KAAI,CAAC,WAAW,WAAW,EAAE;AAC3B,UAAQ,MAAM,wBAAwB,aAAa;AACnD,UAAQ,KAAK,EAAE;;AAIjB,KAAI,QAAQ,aAAa,QACvB,KAAI;AAIF,MAAI,CAAC,CAFiB,EADR,SAAS,WACM,CAAC,OAAO,SAAS,OAAO,EAAE,EAGrD,WAAU,YAAY,IAAM;SAExB;CAOV,MAAM,QAAQ,MAAM,YAAY,QAAQ,KAAK,MAAM,EAAE,EAAE,EACrD,OAAO,WACR,CAAC;AAEF,OAAM,GAAG,UAAU,SAAS;AAE1B,UAAQ,KAAK,QAAQ,EAAE;GACvB;AAEF,OAAM,GAAG,eAAe;AACtB,UAAQ,KAAK,EAAE;GACf;;AAMJ,eAAe"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/config/generateSettings";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/config/resolveConfig";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/fs/config/setupConfig";
|
|
2
|
+
export {};
|
package/dist/fs/matchFiles.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/fs/matchFiles";
|
|
2
|
+
export {};
|
package/dist/functions.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/functions";
|
|
2
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt";
|
|
2
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { main } from
|
|
3
|
-
import dotenv from
|
|
4
|
-
import { program } from
|
|
5
|
-
|
|
6
|
-
dotenv.config({ path:
|
|
7
|
-
dotenv.config({
|
|
2
|
+
import { main } from "gt";
|
|
3
|
+
import dotenv from "dotenv";
|
|
4
|
+
import { program } from "commander";
|
|
5
|
+
//#region src/main.ts
|
|
6
|
+
dotenv.config({ path: ".env" });
|
|
7
|
+
dotenv.config({
|
|
8
|
+
path: ".env.local",
|
|
9
|
+
override: true
|
|
10
|
+
});
|
|
11
|
+
dotenv.config({
|
|
12
|
+
path: ".env.production",
|
|
13
|
+
override: true
|
|
14
|
+
});
|
|
8
15
|
main(program);
|
|
9
|
-
program.name(
|
|
16
|
+
program.name("gtx-cli");
|
|
10
17
|
program.parse();
|
|
18
|
+
//#endregion
|
|
19
|
+
export {};
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","names":[],"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { main } from 'gt';\nimport dotenv from 'dotenv';\nimport { program } from 'commander';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nmain(program);\nprogram.name('gtx-cli');\nprogram.parse();\n"],"mappings":";;;;;AAMA,OAAO,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,OAAO;CAAE,MAAM;CAAc,UAAU;CAAM,CAAC;AACrD,OAAO,OAAO;CAAE,MAAM;CAAmB,UAAU;CAAM,CAAC;AAE1D,KAAK,QAAQ;AACb,QAAQ,KAAK,UAAU;AACvB,QAAQ,OAAO"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/next/parse/handleInitGT";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/next/parse/wrapContent";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/react/parse/wrapContent";
|
|
2
|
+
export {};
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/types/index";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/utils/installPackage";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/utils/packageInfo";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/utils/packageJson";
|
|
2
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "gt/utils/packageManager";
|
|
2
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.37",
|
|
4
4
|
"description": "CLI tool for AI-powered i18n (wrapper for gt)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "bin/main.js",
|
|
@@ -42,20 +42,23 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"commander": "^12.1.0",
|
|
44
44
|
"dotenv": "^16.4.5",
|
|
45
|
-
"gt": "2.14.
|
|
45
|
+
"gt": "2.14.37"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.13.5",
|
|
49
|
+
"tsdown": "^0.21.10",
|
|
49
50
|
"typescript": "^5.9.2",
|
|
50
51
|
"vitest": "^3.2.4"
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|
|
53
|
-
"
|
|
54
|
+
"emit-types": "sh ../../scripts/emit-types.sh",
|
|
55
|
+
"transpile": "tsdown && pnpm run emit-types",
|
|
56
|
+
"build": "pnpm run transpile",
|
|
54
57
|
"build:clean": "sh ../../scripts/clean.sh && pnpm bin:restore && rm -rf binaries && pnpm run build",
|
|
55
58
|
"build:release": "pnpm run build:clean",
|
|
56
|
-
"build:bin": "
|
|
59
|
+
"build:bin": "pnpm run build && sh scripts/build-exe.sh all",
|
|
57
60
|
"build:bin:clean": "sh ../../scripts/clean.sh && rm -rf binaries && pnpm run build:bin",
|
|
58
|
-
"build:bin:release": "pnpm run build:bin:clean
|
|
61
|
+
"build:bin:release": "pnpm run build:bin:clean",
|
|
59
62
|
"build:bin:darwin-x64": "sh scripts/build-exe.sh darwin-x64",
|
|
60
63
|
"build:bin:darwin-arm64": "sh scripts/build-exe.sh darwin-arm64",
|
|
61
64
|
"build:bin:linux-x64": "sh scripts/build-exe.sh linux-x64",
|