gt 2.26.11 → 2.26.12

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,11 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 2.26.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2600](https://github.com/generaltranslation/gt/pull/2600) [`ae3fac1`](https://github.com/generaltranslation/gt/commit/ae3fac17d59ff74c5a0c5886fcdd1f671e59746a) Thanks [@eoinest](https://github.com/eoinest)! - `gt --version`, `gt -V`, and `gt -v` now print the CLI version instead of failing with "unknown option".
8
+
3
9
  ## 2.26.11
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Registers `-V, --version` (commander's default) plus a hidden `-v` alias
4
+ * on the root program. Each prints the CLI version to stdout and exits 0.
5
+ */
6
+ export declare function registerVersionOption(program: Command): Command;
@@ -0,0 +1,17 @@
1
+ import { getCLIVersion } from "../utils/packageJson.js";
2
+ import { Option } from "commander";
3
+ //#region src/cli/version.ts
4
+ /**
5
+ * Registers `-V, --version` (commander's default) plus a hidden `-v` alias
6
+ * on the root program. Each prints the CLI version to stdout and exits 0.
7
+ */
8
+ function registerVersionOption(program) {
9
+ program.version(getCLIVersion(), "-V, --version", "Output the CLI version");
10
+ program.addOption(new Option("-v").hideHelp());
11
+ program.on("option:v", () => program.emit("option:version"));
12
+ return program;
13
+ }
14
+ //#endregion
15
+ export { registerVersionOption };
16
+
17
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","names":[],"sources":["../../src/cli/version.ts"],"sourcesContent":["import type { EventEmitter } from 'node:events';\nimport { Command, Option } from 'commander';\nimport { getCLIVersion } from '../utils/packageJson.js';\n\n/**\n * Registers `-V, --version` (commander's default) plus a hidden `-v` alias\n * on the root program. Each prints the CLI version to stdout and exits 0.\n */\nexport function registerVersionOption(program: Command): Command {\n program.version(getCLIVersion(), '-V, --version', 'Output the CLI version');\n program.addOption(new Option('-v').hideHelp());\n // Reuse commander's version handler so `-v` respects configureOutput() and\n // exitOverride() exactly like `--version`.\n // Command extends EventEmitter at runtime, but its typings omit emit().\n program.on('option:v', () =>\n (program as Command & EventEmitter).emit('option:version')\n );\n return program;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,sBAAsB,SAA2B;AAC/D,SAAQ,QAAQ,eAAe,EAAE,iBAAiB,yBAAyB;AAC3E,SAAQ,UAAU,IAAI,OAAO,KAAK,CAAC,UAAU,CAAC;AAI9C,SAAQ,GAAG,kBACR,QAAmC,KAAK,iBAAiB,CAC3D;AACD,QAAO"}
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "2.26.11";
1
+ export declare const PACKAGE_VERSION = "2.26.12";
@@ -1,5 +1,5 @@
1
1
  //#region src/generated/version.ts
2
- const PACKAGE_VERSION = "2.26.11";
2
+ const PACKAGE_VERSION = "2.26.12";
3
3
  //#endregion
4
4
  export { PACKAGE_VERSION };
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":[],"sources":["../../src/generated/version.ts"],"sourcesContent":["// This file is auto-generated. Do not edit manually.\nexport const PACKAGE_VERSION = '2.26.11';\n"],"mappings":";AACA,MAAa,kBAAkB"}
1
+ {"version":3,"file":"version.js","names":[],"sources":["../../src/generated/version.ts"],"sourcesContent":["// This file is auto-generated. Do not edit manually.\nexport const PACKAGE_VERSION = '2.26.12';\n"],"mappings":";AACA,MAAa,kBAAkB"}
package/dist/index.js CHANGED
@@ -7,9 +7,11 @@ import { NextCLI } from "./cli/next.js";
7
7
  import { PythonCLI } from "./cli/python.js";
8
8
  import { NodeCLI } from "./cli/node.js";
9
9
  import { VueCLI } from "./cli/vue.js";
10
+ import { registerVersionOption } from "./cli/version.js";
10
11
  //#region src/index.ts
11
12
  function main(program) {
12
13
  program.name("gt");
14
+ registerVersionOption(program);
13
15
  logger.setConsoleOutput("stderr");
14
16
  const { library, additionalModules, directlyDeclaresVue } = determineLibraryForCLI();
15
17
  let cli;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { BaseCLI } from './cli/base.js';\nimport { NextCLI } from './cli/next.js';\nimport { ReactCLI } from './cli/react.js';\nimport { PythonCLI } from './cli/python.js';\nimport { determineLibraryForCLI } from './fs/determineFramework/index.js';\nimport { Command } from 'commander';\nimport { NodeCLI } from './cli/node.js';\nimport { Libraries, isPythonLibrary } from './types/libraries.js';\nimport { VueCLI } from './cli/vue.js';\nimport { logger } from './console/logger.js';\n\nexport function main(program: Command) {\n program.name('gt');\n\n // Framework detection can log before the command is known, so keep startup\n // diagnostics off stdout; the first BaseCLI preAction hook then selects the\n // command's own routing.\n logger.setConsoleOutput('stderr');\n const { library, additionalModules, directlyDeclaresVue } =\n determineLibraryForCLI();\n let cli: BaseCLI;\n if (library === Libraries.GT_NEXT) {\n cli = new NextCLI(program, library, additionalModules);\n } else if (\n library === Libraries.GT_REACT ||\n library === Libraries.GT_REACT_NATIVE ||\n library === Libraries.GT_TANSTACK_START\n ) {\n cli = new ReactCLI(program, library, additionalModules);\n } else if (library === Libraries.GT_NODE) {\n cli = new NodeCLI(program, library, additionalModules);\n } else if (library === Libraries.GT_VUE) {\n cli = new VueCLI(program, additionalModules);\n } else if (isPythonLibrary(library)) {\n cli = new PythonCLI(program, library, additionalModules);\n } else if (\n directlyDeclaresVue &&\n (library === 'next-intl' || library === 'i18next')\n ) {\n cli = new VueCLI(program, additionalModules, library);\n } else {\n cli = new BaseCLI(program, library, additionalModules);\n }\n cli.init();\n cli.execute();\n}\n\nexport { BaseCLI };\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,KAAK,SAAkB;AACrC,SAAQ,KAAK,KAAK;AAKlB,QAAO,iBAAiB,SAAS;CACjC,MAAM,EAAE,SAAS,mBAAmB,wBAClC,wBAAwB;CAC1B,IAAI;AACJ,KAAI,YAAA,UACF,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAEtD,YAAA,cACA,YAAA,qBACA,YAAA,oBAEA,OAAM,IAAI,SAAS,SAAS,SAAS,kBAAkB;UAC9C,YAAA,UACT,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAC7C,YAAA,SACT,OAAM,IAAI,OAAO,SAAS,kBAAkB;UACnC,gBAAgB,QAAQ,CACjC,OAAM,IAAI,UAAU,SAAS,SAAS,kBAAkB;UAExD,wBACC,YAAY,eAAe,YAAY,WAExC,OAAM,IAAI,OAAO,SAAS,mBAAmB,QAAQ;KAErD,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;AAExD,KAAI,MAAM;AACV,KAAI,SAAS"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { BaseCLI } from './cli/base.js';\nimport { NextCLI } from './cli/next.js';\nimport { ReactCLI } from './cli/react.js';\nimport { PythonCLI } from './cli/python.js';\nimport { determineLibraryForCLI } from './fs/determineFramework/index.js';\nimport { Command } from 'commander';\nimport { NodeCLI } from './cli/node.js';\nimport { Libraries, isPythonLibrary } from './types/libraries.js';\nimport { VueCLI } from './cli/vue.js';\nimport { logger } from './console/logger.js';\nimport { registerVersionOption } from './cli/version.js';\n\nexport function main(program: Command) {\n program.name('gt');\n registerVersionOption(program);\n\n // Framework detection can log before the command is known, so keep startup\n // diagnostics off stdout; the first BaseCLI preAction hook then selects the\n // command's own routing.\n logger.setConsoleOutput('stderr');\n const { library, additionalModules, directlyDeclaresVue } =\n determineLibraryForCLI();\n let cli: BaseCLI;\n if (library === Libraries.GT_NEXT) {\n cli = new NextCLI(program, library, additionalModules);\n } else if (\n library === Libraries.GT_REACT ||\n library === Libraries.GT_REACT_NATIVE ||\n library === Libraries.GT_TANSTACK_START\n ) {\n cli = new ReactCLI(program, library, additionalModules);\n } else if (library === Libraries.GT_NODE) {\n cli = new NodeCLI(program, library, additionalModules);\n } else if (library === Libraries.GT_VUE) {\n cli = new VueCLI(program, additionalModules);\n } else if (isPythonLibrary(library)) {\n cli = new PythonCLI(program, library, additionalModules);\n } else if (\n directlyDeclaresVue &&\n (library === 'next-intl' || library === 'i18next')\n ) {\n cli = new VueCLI(program, additionalModules, library);\n } else {\n cli = new BaseCLI(program, library, additionalModules);\n }\n cli.init();\n cli.execute();\n}\n\nexport { BaseCLI };\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,KAAK,SAAkB;AACrC,SAAQ,KAAK,KAAK;AAClB,uBAAsB,QAAQ;AAK9B,QAAO,iBAAiB,SAAS;CACjC,MAAM,EAAE,SAAS,mBAAmB,wBAClC,wBAAwB;CAC1B,IAAI;AACJ,KAAI,YAAA,UACF,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAEtD,YAAA,cACA,YAAA,qBACA,YAAA,oBAEA,OAAM,IAAI,SAAS,SAAS,SAAS,kBAAkB;UAC9C,YAAA,UACT,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAC7C,YAAA,SACT,OAAM,IAAI,OAAO,SAAS,kBAAkB;UACnC,gBAAgB,QAAQ,CACjC,OAAM,IAAI,UAAU,SAAS,SAAS,kBAAkB;UAExD,wBACC,YAAY,eAAe,YAAY,WAExC,OAAM,IAAI,OAAO,SAAS,mBAAmB,QAAQ;KAErD,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;AAExD,KAAI,MAAM;AACV,KAAI,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt",
3
- "version": "2.26.11",
3
+ "version": "2.26.12",
4
4
  "main": "dist/index.js",
5
5
  "bin": "bin/main.js",
6
6
  "files": [
@@ -116,12 +116,12 @@
116
116
  "unified": "^11.0.5",
117
117
  "unist-util-visit": "^5.0.0",
118
118
  "yaml": "^2.8.0",
119
- "@generaltranslation/icu": "0.1.2",
120
119
  "@generaltranslation/format": "0.1.9",
120
+ "@generaltranslation/icu": "0.1.2",
121
121
  "@generaltranslation/python-extractor": "0.2.63",
122
+ "@generaltranslation/supported-locales": "2.1.44",
122
123
  "@generaltranslation/vue-extractor": "0.1.22",
123
124
  "generaltranslation": "9.5.8",
124
- "@generaltranslation/supported-locales": "2.1.44",
125
125
  "gt-remark": "1.0.12"
126
126
  },
127
127
  "devDependencies": {