ai-localize-scanner 2.0.7 → 3.0.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/CHANGELOG.md +16 -0
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
# ai-localize-scanner
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- bug fixes
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- ai-localize-config@3.0.0
|
|
13
|
+
- ai-localize-shared@3.0.0
|
|
14
|
+
|
|
3
15
|
## 2.0.7
|
|
4
16
|
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **`@babel/traverse` CJS/ESM interop** — Added runtime shim `(_traverse as any).default ?? _traverse` in `ast-scanner.ts` so the bundled CLI no longer throws `(0 , import_traverse.default) is not a function` when running `ai-localize scan`.
|
|
20
|
+
|
|
5
21
|
### Minor Changes
|
|
6
22
|
|
|
7
23
|
- **CSS/utility class filtering in `AstScanner`**:
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ var parser = __toESM(require("@babel/parser"));
|
|
|
43
43
|
var import_traverse = __toESM(require("@babel/traverse"));
|
|
44
44
|
var t = __toESM(require("@babel/types"));
|
|
45
45
|
var import_ai_localize_shared = require("ai-localize-shared");
|
|
46
|
+
var traverse = import_traverse.default.default ?? import_traverse.default;
|
|
46
47
|
var BUILTIN_TRANSLATION_IMPORT_SOURCES = /* @__PURE__ */ new Set([
|
|
47
48
|
"react-i18next",
|
|
48
49
|
"i18next",
|
|
@@ -338,7 +339,7 @@ var AstScanner = class {
|
|
|
338
339
|
return this.regexFallbackScan();
|
|
339
340
|
}
|
|
340
341
|
this.collectTranslationImports(ast);
|
|
341
|
-
(
|
|
342
|
+
traverse(ast, {
|
|
342
343
|
// ── JSX text nodes: <h1>Welcome</h1> ───────────────────────────────────
|
|
343
344
|
JSXText: (nodePath) => {
|
|
344
345
|
const text = (0, import_ai_localize_shared.normalizeText)(nodePath.node.value);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ast-scanner.ts
|
|
2
2
|
import * as parser from "@babel/parser";
|
|
3
|
-
import
|
|
3
|
+
import _traverse from "@babel/traverse";
|
|
4
4
|
import * as t from "@babel/types";
|
|
5
5
|
import {
|
|
6
6
|
isHumanReadableText,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
TEXT_ATTRIBUTE_NAMES,
|
|
10
10
|
generateKeyByStyle
|
|
11
11
|
} from "ai-localize-shared";
|
|
12
|
+
var traverse = _traverse.default ?? _traverse;
|
|
12
13
|
var BUILTIN_TRANSLATION_IMPORT_SOURCES = /* @__PURE__ */ new Set([
|
|
13
14
|
"react-i18next",
|
|
14
15
|
"i18next",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-localize-scanner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "AST-based hardcoded text scanner for frontend applications",
|
|
5
5
|
"author": "ai-localize-core contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@babel/traverse": "^7.23.9",
|
|
52
52
|
"@babel/types": "^7.23.9",
|
|
53
53
|
"glob": "^10.3.10",
|
|
54
|
-
"ai-localize-shared": "
|
|
55
|
-
"ai-localize-config": "
|
|
54
|
+
"ai-localize-shared": "3.0.0",
|
|
55
|
+
"ai-localize-config": "3.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/babel__traverse": "^7.20.5",
|