gtx-cli 2.1.2 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 2.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#536](https://github.com/generaltranslation/gt/pull/536) [`468b0b7`](https://github.com/generaltranslation/gt/commit/468b0b7c660fd1ab9e8c2611a26ade63ba268e80) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Added locale selection based on region
8
+ Added compile time hashing
9
+ Added es lint plugin for gt-next (in alpha)
10
+ Fix CLI validation (used to error for {<JSX/>} inside <T>)
11
+ - Updated dependencies [[`468b0b7`](https://github.com/generaltranslation/gt/commit/468b0b7c660fd1ab9e8c2611a26ade63ba268e80)]:
12
+ - generaltranslation@7.4.0
13
+
14
+ ## 2.1.3
15
+
16
+ ### Patch Changes
17
+
18
+ - [#564](https://github.com/generaltranslation/gt/pull/564) [`7251fc5`](https://github.com/generaltranslation/gt/commit/7251fc5d2474ad71b2da9ae5b71e37aed8199bce) Thanks [@brian-lou](https://github.com/brian-lou)! - Fix CLI validation (used to error for {<JSX/>} inside <T>)
19
+
3
20
  ## 2.1.2
4
21
 
5
22
  ### Patch Changes
@@ -1,4 +1,7 @@
1
1
  import * as t from '@babel/types';
2
+ import generateModule from '@babel/generator';
3
+ // Handle CommonJS/ESM interop
4
+ const generate = generateModule.default || generateModule;
2
5
  const MEANINGFUL_REGEX = /[\p{L}\p{N}]/u;
3
6
  /**
4
7
  * Checks if a node is meaningful. Does not recurse into children.
@@ -44,23 +47,10 @@ export function isStaticExpression(expr) {
44
47
  if (t.isTemplateLiteral(expr) && expr.expressions.length === 0) {
45
48
  return { isStatic: true, value: expr.quasis[0].value.raw };
46
49
  }
47
- // Handle binary expressions (string concatenation)
50
+ // Binary expressions are not static
48
51
  if (t.isBinaryExpression(expr)) {
49
- // Only handle string concatenation
50
- if (expr.operator !== '+') {
51
- return { isStatic: false };
52
- }
53
- // Type guard to ensure we only process Expression types
54
- if (t.isExpression(expr.left) && t.isExpression(expr.right)) {
55
- const left = isStaticExpression(expr.left);
56
- const right = isStaticExpression(expr.right);
57
- if (left.isStatic &&
58
- right.isStatic &&
59
- left.value !== undefined &&
60
- right.value !== undefined) {
61
- return { isStatic: true, value: left.value + right.value };
62
- }
63
- }
52
+ // Not a static expression
53
+ return { isStatic: false };
64
54
  }
65
55
  // Handle parenthesized expressions
66
56
  if (t.isParenthesizedExpression(expr)) {
@@ -25,6 +25,9 @@ export function buildJSXTree(importAliases, node, unwrappedExpressions, updates,
25
25
  return null;
26
26
  }
27
27
  const expr = node.expression;
28
+ if (t.isJSXElement(expr)) {
29
+ return buildJSXTree(importAliases, expr, unwrappedExpressions, updates, errors, warnings, file, insideT);
30
+ }
28
31
  const staticAnalysis = isStaticExpression(expr);
29
32
  if (staticAnalysis.isStatic && staticAnalysis.value !== undefined) {
30
33
  // Preserve the exact whitespace for static string expressions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtx-cli",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "files": [
@@ -87,7 +87,7 @@
87
87
  "esbuild": "^0.25.4",
88
88
  "fast-glob": "^3.3.3",
89
89
  "form-data": "^4.0.4",
90
- "generaltranslation": "^7.3.0",
90
+ "generaltranslation": "^7.4.0",
91
91
  "json-pointer": "^0.6.2",
92
92
  "jsonpath-plus": "^10.3.0",
93
93
  "jsonpointer": "^5.0.1",