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 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
@@ -1,10 +1,20 @@
1
- // Entry point for binaries
2
- import { main } from 'gt';
3
- import dotenv from 'dotenv';
4
- import { program } from 'commander';
5
- dotenv.config({ path: '.env' });
6
- dotenv.config({ path: '.env.local', override: true });
7
- dotenv.config({ path: '.env.production', override: true });
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('gtx-cli');
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"}
@@ -1,67 +1,49 @@
1
1
  #!/usr/bin/env node
2
- // Routes to proper binary based on platform
3
- import { spawn } from 'child_process';
4
- import { fileURLToPath } from 'url';
5
- import { dirname, join } from 'path';
6
- import { existsSync, chmodSync, statSync } from 'fs';
7
- const __filename = fileURLToPath(import.meta.url);
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
- const platform = process.platform;
11
- const arch = process.arch;
12
- // Map Node.js platform/arch to our binary names
13
- const platformMap = {
14
- darwin: {
15
- x64: 'gtx-cli-darwin-x64',
16
- arm64: 'gtx-cli-darwin-arm64',
17
- },
18
- linux: {
19
- x64: 'gtx-cli-linux-x64',
20
- arm64: 'gtx-cli-linux-arm64',
21
- },
22
- win32: {
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
- const binaryName = detectPlatform();
30
- if (!binaryName) {
31
- console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
32
- process.exit(1);
33
- }
34
- const binaryPath = join(__dirname, '..', '..', 'binaries', binaryName);
35
- if (!existsSync(binaryPath)) {
36
- console.error(`Binary not found at: ${binaryPath}`);
37
- process.exit(1);
38
- }
39
- // Check and fix execute permissions if needed (Unix-like systems only)
40
- if (process.platform !== 'win32') {
41
- try {
42
- const stats = statSync(binaryPath);
43
- const isExecutable = !!(stats.mode & parseInt('100', 8)); // Check owner execute bit
44
- if (!isExecutable) {
45
- chmodSync(binaryPath, 0o755); // Make executable
46
- }
47
- }
48
- catch {
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 'gt/config/generateSettings';
1
+ export * from "gt/config/generateSettings";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/config/resolveConfig';
1
+ export * from "gt/config/resolveConfig";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/fs/config/setupConfig';
1
+ export * from "gt/fs/config/setupConfig";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/fs/matchFiles';
1
+ export * from "gt/fs/matchFiles";
2
+ export {};
package/dist/functions.js CHANGED
@@ -1 +1,2 @@
1
- export * from 'gt/functions';
1
+ export * from "gt/functions";
2
+ export {};
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- export * from 'gt';
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 'gt';
3
- import dotenv from 'dotenv';
4
- import { program } from 'commander';
5
- dotenv.config({ path: '.env' });
6
- dotenv.config({ path: '.env.local', override: true });
7
- dotenv.config({ path: '.env.production', override: true });
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('gtx-cli');
16
+ program.name("gtx-cli");
10
17
  program.parse();
18
+ //#endregion
19
+ export {};
20
+
21
+ //# sourceMappingURL=main.js.map
@@ -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 'gt/next/parse/handleInitGT';
1
+ export * from "gt/next/parse/handleInitGT";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/next/parse/wrapContent';
1
+ export * from "gt/next/parse/wrapContent";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/react/parse/wrapContent';
1
+ export * from "gt/react/parse/wrapContent";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/types/index';
1
+ export * from "gt/types/index";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/utils/installPackage';
1
+ export * from "gt/utils/installPackage";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/utils/packageInfo';
1
+ export * from "gt/utils/packageInfo";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/utils/packageJson';
1
+ export * from "gt/utils/packageJson";
2
+ export {};
@@ -1 +1,2 @@
1
- export * from 'gt/utils/packageManager';
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.35",
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.35"
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
- "build": "tsc",
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": "tsc && sh scripts/build-exe.sh all",
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 && pnpm run build:bin",
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",