i18next-cli 1.75.0 → 1.75.1
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/dist/cjs/cli.js +1 -1
- package/dist/cjs/extractor/core/ast-visitors.js +6 -4
- package/dist/cjs/extractor/parsers/expression-resolver.js +57 -24
- package/dist/esm/cli.js +1 -1
- package/dist/esm/extractor/core/ast-visitors.js +7 -5
- package/dist/esm/extractor/parsers/expression-resolver.js +57 -25
- package/package.json +1 -1
- package/types/extractor/core/ast-visitors.d.ts.map +1 -1
- package/types/extractor/parsers/expression-resolver.d.ts +9 -0
- package/types/extractor/parsers/expression-resolver.d.ts.map +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -37,7 +37,7 @@ const program = new commander.Command();
|
|
|
37
37
|
program
|
|
38
38
|
.name('i18next-cli')
|
|
39
39
|
.description('A unified, high-performance i18next CLI.')
|
|
40
|
-
.version('1.75.
|
|
40
|
+
.version('1.75.1') // This string is replaced with the actual version at build time by rollup
|
|
41
41
|
.addHelpText('after', '\nUsing an AI coding agent? Install the i18next-localization skill: npx skills add i18next/i18next-cli\n');
|
|
42
42
|
// new: global config override option
|
|
43
43
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
@@ -172,8 +172,10 @@ class ASTVisitors {
|
|
|
172
172
|
this.expressionResolver.captureFunctionDeclaration(node);
|
|
173
173
|
break;
|
|
174
174
|
case 'ImportDeclaration':
|
|
175
|
+
case 'ExportNamedDeclaration':
|
|
175
176
|
// `import { X as Y }` → ExpressionResolver.sharedImportAliases, resolved
|
|
176
|
-
// once the pre-scan has seen every file
|
|
177
|
+
// once the pre-scan has seen every file; `import * as Types` / `export * as Types`
|
|
178
|
+
// → namespace names.
|
|
177
179
|
this.expressionResolver.captureImportDeclaration(node);
|
|
178
180
|
break;
|
|
179
181
|
}
|
|
@@ -824,8 +826,8 @@ class ASTVisitors {
|
|
|
824
826
|
let members;
|
|
825
827
|
if (tsType.type === 'TsTypeLiteral')
|
|
826
828
|
members = tsType.members;
|
|
827
|
-
else if (tsType.type === 'TsTypeReference' && tsType
|
|
828
|
-
members = this.expressionResolver.getObjectTypeMembersRaw(tsType
|
|
829
|
+
else if (tsType.type === 'TsTypeReference' && expressionResolver.typeRefName(tsType)) {
|
|
830
|
+
members = this.expressionResolver.getObjectTypeMembersRaw(expressionResolver.typeRefName(tsType));
|
|
829
831
|
}
|
|
830
832
|
if (!Array.isArray(members))
|
|
831
833
|
return [];
|
|
@@ -877,7 +879,7 @@ class ASTVisitors {
|
|
|
877
879
|
(innerCallee.property.value === 'keys' || innerCallee.property.value === 'values')) {
|
|
878
880
|
const isKeys = innerCallee.property.value === 'keys';
|
|
879
881
|
// The single argument to Object.keys/values must be a known identifier
|
|
880
|
-
const mapArg = obj.arguments?.[0]?.expression;
|
|
882
|
+
const mapArg = this.expressionResolver.unwrapNamespace(obj.arguments?.[0]?.expression);
|
|
881
883
|
if (mapArg?.type === 'Identifier') {
|
|
882
884
|
const mapEntry = this.expressionResolver.getObjectMap(mapArg.value);
|
|
883
885
|
if (mapEntry) {
|
|
@@ -61,6 +61,9 @@ const memberByKey = (members, key) => {
|
|
|
61
61
|
}
|
|
62
62
|
return index.get(key);
|
|
63
63
|
};
|
|
64
|
+
// `Color` / `Types.Color` / `NS.Inner.Color` -> 'Color'. Declarations are looked up by their
|
|
65
|
+
// own name, so a qualified name resolves by its last part, whatever namespace holds it.
|
|
66
|
+
const typeRefName = (type) => type?.typeName?.type === 'Identifier' ? type.typeName.value : type?.typeName?.type === 'TsQualifiedName' ? type.typeName.right?.value : undefined;
|
|
64
67
|
// `T['a']` / `T[200]` -> 'a' / '200'
|
|
65
68
|
const indexedKey = (type) => type?.indexType?.type === 'TsLiteralType' ? literalKey(type.indexType.literal) : undefined;
|
|
66
69
|
// Whether replacing `prev` by `next` only adds to it.
|
|
@@ -100,6 +103,9 @@ class ExpressionResolver {
|
|
|
100
103
|
// Shared (cross-file) table for string-array constants (e.g. `as const` arrays).
|
|
101
104
|
// Persists across resetFileSymbols() so exported arrays are visible to importers.
|
|
102
105
|
sharedVariableTable = new Map();
|
|
106
|
+
// Shared (cross-file) table for as-const object maps, `export const LABELS = { … } as const`,
|
|
107
|
+
// so `LABELS.save` and `Object.keys(LABELS)` resolve in importing files.
|
|
108
|
+
sharedObjectMapTable = new Map();
|
|
103
109
|
// Shared (cross-file) table for type aliases — populated alongside typeAliasTable.
|
|
104
110
|
// Persists across resetFileSymbols() so exported type aliases are visible to importers.
|
|
105
111
|
sharedTypeAliasTable = new Map();
|
|
@@ -129,6 +135,9 @@ class ExpressionResolver {
|
|
|
129
135
|
// Every other table is keyed by the *declared* name, so without this a type
|
|
130
136
|
// referenced through an alias resolves to nothing.
|
|
131
137
|
sharedImportAliases = new Map();
|
|
138
|
+
// Shared (cross-file) namespace names: `import * as Types`, `export * as Types`. Their
|
|
139
|
+
// members are declared under their own names, so `Types.COLORS` resolves as `COLORS`.
|
|
140
|
+
sharedNamespaceNames = new Set();
|
|
132
141
|
// Type parameters of generic object types, e.g. `type Base<T> = { type: T }`.
|
|
133
142
|
objectTypeParams = new Map();
|
|
134
143
|
// Values bound to type parameters while a generic type is being resolved.
|
|
@@ -327,6 +336,7 @@ class ExpressionResolver {
|
|
|
327
336
|
// If at least one property was resolvable, record the partial map.
|
|
328
337
|
if (Object.keys(map).length > 0) {
|
|
329
338
|
this.variableTable.set(name, map);
|
|
339
|
+
this.sharedObjectMapTable.set(name, map);
|
|
330
340
|
return;
|
|
331
341
|
}
|
|
332
342
|
}
|
|
@@ -432,6 +442,11 @@ class ExpressionResolver {
|
|
|
432
442
|
captureImportDeclaration(node) {
|
|
433
443
|
try {
|
|
434
444
|
for (const spec of node?.specifiers ?? []) {
|
|
445
|
+
// `import * as Types from …` / `export * as Types from …`
|
|
446
|
+
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value)
|
|
447
|
+
this.sharedNamespaceNames.add(spec.local.value);
|
|
448
|
+
if (spec?.type === 'ExportNamespaceSpecifier' && spec.name?.value)
|
|
449
|
+
this.sharedNamespaceNames.add(spec.name.value);
|
|
435
450
|
if (spec?.type !== 'ImportSpecifier')
|
|
436
451
|
continue;
|
|
437
452
|
const local = spec.local?.value;
|
|
@@ -444,6 +459,25 @@ class ExpressionResolver {
|
|
|
444
459
|
// noop
|
|
445
460
|
}
|
|
446
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* `Types.COLORS` → `COLORS` when `Types` is a namespace import (also one renamed by
|
|
464
|
+
* `import { Types as T }` from a barrel); any other expression is returned as is.
|
|
465
|
+
*/
|
|
466
|
+
unwrapNamespace(expr) {
|
|
467
|
+
if (expr?.type !== 'MemberExpression' || expr.object?.type !== 'Identifier' || expr.property?.type !== 'Identifier')
|
|
468
|
+
return expr;
|
|
469
|
+
const ns = expr.object.value;
|
|
470
|
+
if (!this.sharedNamespaceNames.has(this.sharedImportAliases.get(ns) ?? ns))
|
|
471
|
+
return expr;
|
|
472
|
+
return { type: 'Identifier', value: expr.property.value, span: expr.span };
|
|
473
|
+
}
|
|
474
|
+
// The variable a `typeof` names: `typeof LABELS`, or `typeof Types.LABELS` through a namespace import
|
|
475
|
+
typeQueryName(exprName) {
|
|
476
|
+
if (exprName?.type === 'TsQualifiedName') {
|
|
477
|
+
return this.unwrapNamespace({ type: 'MemberExpression', object: exprName.left, property: exprName.right })?.value;
|
|
478
|
+
}
|
|
479
|
+
return exprName?.value ?? exprName?.name;
|
|
480
|
+
}
|
|
447
481
|
/**
|
|
448
482
|
* Mirror every declaration captured under its declared name onto the local
|
|
449
483
|
* names it was imported as. Must run after the pre-scan pass has seen all
|
|
@@ -457,6 +491,7 @@ class ExpressionResolver {
|
|
|
457
491
|
this.sharedTypeAliasTable,
|
|
458
492
|
this.sharedEnumTable,
|
|
459
493
|
this.sharedVariableTable,
|
|
494
|
+
this.sharedObjectMapTable,
|
|
460
495
|
this.sharedFunctionReturnTable,
|
|
461
496
|
this.sharedFunctionReturnMembers,
|
|
462
497
|
this.objectTypeTable,
|
|
@@ -532,13 +567,14 @@ class ExpressionResolver {
|
|
|
532
567
|
* function returning one (`getAnimal()`).
|
|
533
568
|
*/
|
|
534
569
|
objectMembersOf(expr) {
|
|
535
|
-
expr = astUtils.unwrapParens(expr);
|
|
570
|
+
expr = this.unwrapNamespace(astUtils.unwrapParens(expr));
|
|
536
571
|
if (expr?.type === 'OptionalChainingExpression')
|
|
537
572
|
return this.objectMembersOf(expr.base);
|
|
538
573
|
if (expr?.type === 'Identifier')
|
|
539
574
|
return this.temporaryObjectVariables.get(expr.value) ?? this.objectVariables.get(expr.value);
|
|
540
|
-
|
|
541
|
-
|
|
575
|
+
const callee = this.unwrapNamespace(expr?.callee);
|
|
576
|
+
if (expr?.type === 'CallExpression' && callee?.type === 'Identifier')
|
|
577
|
+
return this.sharedFunctionReturnMembers.get(callee.value);
|
|
542
578
|
// `deepObject.Foo.Bar` → the members nested under `Foo.Bar`
|
|
543
579
|
if (expr?.type === 'MemberExpression') {
|
|
544
580
|
const prop = expr.property;
|
|
@@ -622,8 +658,8 @@ class ExpressionResolver {
|
|
|
622
658
|
}
|
|
623
659
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
624
660
|
}
|
|
625
|
-
|
|
626
|
-
|
|
661
|
+
const name = tsType.type === 'TsTypeReference' ? typeRefName(tsType) : undefined;
|
|
662
|
+
if (name) {
|
|
627
663
|
// `Base<'DUCK'>` → instantiate the generic type's members with the argument
|
|
628
664
|
const args = tsType.typeParams?.params;
|
|
629
665
|
const params = this.objectTypeParams.get(name);
|
|
@@ -677,7 +713,7 @@ class ExpressionResolver {
|
|
|
677
713
|
obj = obj.typeAnnotation;
|
|
678
714
|
if (obj?.type === 'TsIndexedAccessType')
|
|
679
715
|
obj = this.indexedAccessTarget(obj);
|
|
680
|
-
const name = obj?.type === 'TsTypeReference' && !obj.typeParams
|
|
716
|
+
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? typeRefName(obj) : undefined;
|
|
681
717
|
const members = obj?.type === 'TsTypeLiteral'
|
|
682
718
|
? obj.members
|
|
683
719
|
: name && !this.objectTypeParams.has(name) ? this.objectTypeMembersRaw.get(name) : undefined;
|
|
@@ -724,7 +760,7 @@ class ExpressionResolver {
|
|
|
724
760
|
* inline literal (`([1, 2, 3, 4] as const).map(…)`) or a typed member (`props.colors`).
|
|
725
761
|
*/
|
|
726
762
|
arrayValuesOf(expr) {
|
|
727
|
-
expr = unwrapExpr(expr);
|
|
763
|
+
expr = this.unwrapNamespace(unwrapExpr(expr));
|
|
728
764
|
if (expr?.type === 'Identifier')
|
|
729
765
|
return this.getVariableValues(expr.value);
|
|
730
766
|
if (expr?.type === 'ArrayExpression')
|
|
@@ -742,7 +778,7 @@ class ExpressionResolver {
|
|
|
742
778
|
* typed member (`props.items`).
|
|
743
779
|
*/
|
|
744
780
|
arrayMembersOf(expr) {
|
|
745
|
-
expr = unwrapExpr(expr);
|
|
781
|
+
expr = this.unwrapNamespace(unwrapExpr(expr));
|
|
746
782
|
if (expr?.type === 'Identifier')
|
|
747
783
|
return this.arrayElementMembers.get(expr.value);
|
|
748
784
|
if (expr?.type === 'ArrayExpression')
|
|
@@ -944,10 +980,7 @@ class ExpressionResolver {
|
|
|
944
980
|
const v = this.variableTable.get(name);
|
|
945
981
|
if (v && !Array.isArray(v) && typeof v === 'object')
|
|
946
982
|
return v;
|
|
947
|
-
|
|
948
|
-
if (ev)
|
|
949
|
-
return ev;
|
|
950
|
-
return undefined;
|
|
983
|
+
return this.sharedObjectMapTable.get(name) ?? this.sharedEnumTable.get(name);
|
|
951
984
|
}
|
|
952
985
|
/**
|
|
953
986
|
* Capture a TypeScript enum declaration so members can be resolved later.
|
|
@@ -1028,7 +1061,8 @@ class ExpressionResolver {
|
|
|
1028
1061
|
*/
|
|
1029
1062
|
resolvePossibleStringValuesFromExpression(expression, returnEmptyStrings = false) {
|
|
1030
1063
|
// `t(('key'))` / `t(cond ? 'a' : ('b'))`: parens are just a wrapper node (#295).
|
|
1031
|
-
|
|
1064
|
+
// `Types.COLORS` with `import * as Types` → `COLORS`
|
|
1065
|
+
expression = this.unwrapNamespace(astUtils.unwrapParens(expression));
|
|
1032
1066
|
// `pet.category?.kind` → `pet.category.kind`
|
|
1033
1067
|
if (expression.type === 'OptionalChainingExpression') {
|
|
1034
1068
|
return this.resolvePossibleStringValuesFromExpression(expression.base, returnEmptyStrings);
|
|
@@ -1113,7 +1147,7 @@ class ExpressionResolver {
|
|
|
1113
1147
|
// MemberExpression: try to resolve object identifier to an object map in the symbol table
|
|
1114
1148
|
if (expression.type === 'MemberExpression') {
|
|
1115
1149
|
try {
|
|
1116
|
-
const obj = expression.object;
|
|
1150
|
+
const obj = this.unwrapNamespace(expression.object);
|
|
1117
1151
|
const prop = expression.property;
|
|
1118
1152
|
const propName = prop.type === 'Identifier'
|
|
1119
1153
|
? prop.value
|
|
@@ -1128,7 +1162,7 @@ class ExpressionResolver {
|
|
|
1128
1162
|
// only handle simple identifier base + simple property (Identifier or computed StringLiteral)
|
|
1129
1163
|
if (obj.type === 'Identifier') {
|
|
1130
1164
|
const baseVar = this.variableTable.get(obj.value);
|
|
1131
|
-
const baseShared = this.sharedEnumTable.get(obj.value);
|
|
1165
|
+
const baseShared = this.sharedObjectMapTable.get(obj.value) ?? this.sharedEnumTable.get(obj.value);
|
|
1132
1166
|
const base = baseVar ?? baseShared;
|
|
1133
1167
|
if (base && typeof base !== 'string' && !Array.isArray(base)) {
|
|
1134
1168
|
if (propName && base[propName] !== undefined) {
|
|
@@ -1165,7 +1199,7 @@ class ExpressionResolver {
|
|
|
1165
1199
|
// the shared cross-file table populated during pre-scan.
|
|
1166
1200
|
if (expression.type === 'CallExpression') {
|
|
1167
1201
|
try {
|
|
1168
|
-
const callee = expression.callee;
|
|
1202
|
+
const callee = this.unwrapNamespace(expression.callee);
|
|
1169
1203
|
if (callee?.type === 'Identifier') {
|
|
1170
1204
|
const v = this.variableTable.get(callee.value);
|
|
1171
1205
|
if (Array.isArray(v) && v.length > 0)
|
|
@@ -1298,9 +1332,7 @@ class ExpressionResolver {
|
|
|
1298
1332
|
// where `type ChangeType = 'all' | 'next' | 'this'` was captured earlier.
|
|
1299
1333
|
// Also handles `declare const d: SomeEnum` where SomeEnum is a TS enum with string values.
|
|
1300
1334
|
if (type.type === 'TsTypeReference') {
|
|
1301
|
-
const typeName = type
|
|
1302
|
-
? type.typeName.value
|
|
1303
|
-
: undefined;
|
|
1335
|
+
const typeName = typeRefName(type);
|
|
1304
1336
|
if (typeName) {
|
|
1305
1337
|
// Inside a generic type: the parameter's argument, default or constraint
|
|
1306
1338
|
const bound = this.typeParamBindings.get(typeName);
|
|
@@ -1338,7 +1370,7 @@ class ExpressionResolver {
|
|
|
1338
1370
|
// SWC: TsTypeQuery.exprName is TsEntityName (Identifier | TsQualifiedName)
|
|
1339
1371
|
const exprName = objType.exprName ?? objType.expr ?? objType.entityName;
|
|
1340
1372
|
// access .value (Identifier) or fall back to .name for alternate SWC builds
|
|
1341
|
-
const varName = exprName
|
|
1373
|
+
const varName = this.typeQueryName(exprName);
|
|
1342
1374
|
if (varName) {
|
|
1343
1375
|
const vals = this.getVariableValues(varName);
|
|
1344
1376
|
if (vals && vals.length > 0)
|
|
@@ -1373,17 +1405,17 @@ class ExpressionResolver {
|
|
|
1373
1405
|
// Object.keys(MAP).forEach(k => t(MAP[k]))
|
|
1374
1406
|
if (type.type === 'TsTypeOperator') {
|
|
1375
1407
|
try {
|
|
1376
|
-
const op = type.
|
|
1408
|
+
const op = type.op;
|
|
1377
1409
|
if (op === 'keyof') {
|
|
1378
1410
|
let inner = type.typeAnnotation;
|
|
1379
1411
|
while (inner?.type === 'TsParenthesizedType')
|
|
1380
1412
|
inner = inner.typeAnnotation;
|
|
1381
1413
|
if (inner?.type === 'TsTypeQuery' || inner?.type === 'TSTypeQuery') {
|
|
1382
1414
|
const exprName = inner.exprName ?? inner.expr ?? inner.entityName;
|
|
1383
|
-
const varName = exprName
|
|
1415
|
+
const varName = this.typeQueryName(exprName);
|
|
1384
1416
|
if (varName) {
|
|
1385
|
-
// Look up in variableTable (local) or
|
|
1386
|
-
const v = this.variableTable.get(varName) ?? this.
|
|
1417
|
+
// Look up in variableTable (local) or sharedObjectMapTable (cross-file) for object maps
|
|
1418
|
+
const v = this.variableTable.get(varName) ?? this.sharedObjectMapTable.get(varName);
|
|
1387
1419
|
if (v && !Array.isArray(v) && typeof v === 'object') {
|
|
1388
1420
|
return Object.keys(v);
|
|
1389
1421
|
}
|
|
@@ -1450,3 +1482,4 @@ class ExpressionResolver {
|
|
|
1450
1482
|
|
|
1451
1483
|
exports.ExpressionResolver = ExpressionResolver;
|
|
1452
1484
|
exports.nestedMembers = nestedMembers;
|
|
1485
|
+
exports.typeRefName = typeRefName;
|
package/dist/esm/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ const program = new Command();
|
|
|
31
31
|
program
|
|
32
32
|
.name('i18next-cli')
|
|
33
33
|
.description('A unified, high-performance i18next CLI.')
|
|
34
|
-
.version('1.75.
|
|
34
|
+
.version('1.75.1') // This string is replaced with the actual version at build time by rollup
|
|
35
35
|
.addHelpText('after', '\nUsing an AI coding agent? Install the i18next-localization skill: npx skills add i18next/i18next-cli\n');
|
|
36
36
|
// new: global config override option
|
|
37
37
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScopeManager } from '../parsers/scope-manager.js';
|
|
2
|
-
import { ExpressionResolver, nestedMembers } from '../parsers/expression-resolver.js';
|
|
2
|
+
import { ExpressionResolver, nestedMembers, typeRefName } from '../parsers/expression-resolver.js';
|
|
3
3
|
import { CallExpressionHandler } from '../parsers/call-expression-handler.js';
|
|
4
4
|
import { JSXHandler } from '../parsers/jsx-handler.js';
|
|
5
5
|
import { unwrapParens } from '../parsers/ast-utils.js';
|
|
@@ -170,8 +170,10 @@ class ASTVisitors {
|
|
|
170
170
|
this.expressionResolver.captureFunctionDeclaration(node);
|
|
171
171
|
break;
|
|
172
172
|
case 'ImportDeclaration':
|
|
173
|
+
case 'ExportNamedDeclaration':
|
|
173
174
|
// `import { X as Y }` → ExpressionResolver.sharedImportAliases, resolved
|
|
174
|
-
// once the pre-scan has seen every file
|
|
175
|
+
// once the pre-scan has seen every file; `import * as Types` / `export * as Types`
|
|
176
|
+
// → namespace names.
|
|
175
177
|
this.expressionResolver.captureImportDeclaration(node);
|
|
176
178
|
break;
|
|
177
179
|
}
|
|
@@ -822,8 +824,8 @@ class ASTVisitors {
|
|
|
822
824
|
let members;
|
|
823
825
|
if (tsType.type === 'TsTypeLiteral')
|
|
824
826
|
members = tsType.members;
|
|
825
|
-
else if (tsType.type === 'TsTypeReference' && tsType
|
|
826
|
-
members = this.expressionResolver.getObjectTypeMembersRaw(tsType
|
|
827
|
+
else if (tsType.type === 'TsTypeReference' && typeRefName(tsType)) {
|
|
828
|
+
members = this.expressionResolver.getObjectTypeMembersRaw(typeRefName(tsType));
|
|
827
829
|
}
|
|
828
830
|
if (!Array.isArray(members))
|
|
829
831
|
return [];
|
|
@@ -875,7 +877,7 @@ class ASTVisitors {
|
|
|
875
877
|
(innerCallee.property.value === 'keys' || innerCallee.property.value === 'values')) {
|
|
876
878
|
const isKeys = innerCallee.property.value === 'keys';
|
|
877
879
|
// The single argument to Object.keys/values must be a known identifier
|
|
878
|
-
const mapArg = obj.arguments?.[0]?.expression;
|
|
880
|
+
const mapArg = this.expressionResolver.unwrapNamespace(obj.arguments?.[0]?.expression);
|
|
879
881
|
if (mapArg?.type === 'Identifier') {
|
|
880
882
|
const mapEntry = this.expressionResolver.getObjectMap(mapArg.value);
|
|
881
883
|
if (mapEntry) {
|
|
@@ -59,6 +59,9 @@ const memberByKey = (members, key) => {
|
|
|
59
59
|
}
|
|
60
60
|
return index.get(key);
|
|
61
61
|
};
|
|
62
|
+
// `Color` / `Types.Color` / `NS.Inner.Color` -> 'Color'. Declarations are looked up by their
|
|
63
|
+
// own name, so a qualified name resolves by its last part, whatever namespace holds it.
|
|
64
|
+
const typeRefName = (type) => type?.typeName?.type === 'Identifier' ? type.typeName.value : type?.typeName?.type === 'TsQualifiedName' ? type.typeName.right?.value : undefined;
|
|
62
65
|
// `T['a']` / `T[200]` -> 'a' / '200'
|
|
63
66
|
const indexedKey = (type) => type?.indexType?.type === 'TsLiteralType' ? literalKey(type.indexType.literal) : undefined;
|
|
64
67
|
// Whether replacing `prev` by `next` only adds to it.
|
|
@@ -98,6 +101,9 @@ class ExpressionResolver {
|
|
|
98
101
|
// Shared (cross-file) table for string-array constants (e.g. `as const` arrays).
|
|
99
102
|
// Persists across resetFileSymbols() so exported arrays are visible to importers.
|
|
100
103
|
sharedVariableTable = new Map();
|
|
104
|
+
// Shared (cross-file) table for as-const object maps, `export const LABELS = { … } as const`,
|
|
105
|
+
// so `LABELS.save` and `Object.keys(LABELS)` resolve in importing files.
|
|
106
|
+
sharedObjectMapTable = new Map();
|
|
101
107
|
// Shared (cross-file) table for type aliases — populated alongside typeAliasTable.
|
|
102
108
|
// Persists across resetFileSymbols() so exported type aliases are visible to importers.
|
|
103
109
|
sharedTypeAliasTable = new Map();
|
|
@@ -127,6 +133,9 @@ class ExpressionResolver {
|
|
|
127
133
|
// Every other table is keyed by the *declared* name, so without this a type
|
|
128
134
|
// referenced through an alias resolves to nothing.
|
|
129
135
|
sharedImportAliases = new Map();
|
|
136
|
+
// Shared (cross-file) namespace names: `import * as Types`, `export * as Types`. Their
|
|
137
|
+
// members are declared under their own names, so `Types.COLORS` resolves as `COLORS`.
|
|
138
|
+
sharedNamespaceNames = new Set();
|
|
130
139
|
// Type parameters of generic object types, e.g. `type Base<T> = { type: T }`.
|
|
131
140
|
objectTypeParams = new Map();
|
|
132
141
|
// Values bound to type parameters while a generic type is being resolved.
|
|
@@ -325,6 +334,7 @@ class ExpressionResolver {
|
|
|
325
334
|
// If at least one property was resolvable, record the partial map.
|
|
326
335
|
if (Object.keys(map).length > 0) {
|
|
327
336
|
this.variableTable.set(name, map);
|
|
337
|
+
this.sharedObjectMapTable.set(name, map);
|
|
328
338
|
return;
|
|
329
339
|
}
|
|
330
340
|
}
|
|
@@ -430,6 +440,11 @@ class ExpressionResolver {
|
|
|
430
440
|
captureImportDeclaration(node) {
|
|
431
441
|
try {
|
|
432
442
|
for (const spec of node?.specifiers ?? []) {
|
|
443
|
+
// `import * as Types from …` / `export * as Types from …`
|
|
444
|
+
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value)
|
|
445
|
+
this.sharedNamespaceNames.add(spec.local.value);
|
|
446
|
+
if (spec?.type === 'ExportNamespaceSpecifier' && spec.name?.value)
|
|
447
|
+
this.sharedNamespaceNames.add(spec.name.value);
|
|
433
448
|
if (spec?.type !== 'ImportSpecifier')
|
|
434
449
|
continue;
|
|
435
450
|
const local = spec.local?.value;
|
|
@@ -442,6 +457,25 @@ class ExpressionResolver {
|
|
|
442
457
|
// noop
|
|
443
458
|
}
|
|
444
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* `Types.COLORS` → `COLORS` when `Types` is a namespace import (also one renamed by
|
|
462
|
+
* `import { Types as T }` from a barrel); any other expression is returned as is.
|
|
463
|
+
*/
|
|
464
|
+
unwrapNamespace(expr) {
|
|
465
|
+
if (expr?.type !== 'MemberExpression' || expr.object?.type !== 'Identifier' || expr.property?.type !== 'Identifier')
|
|
466
|
+
return expr;
|
|
467
|
+
const ns = expr.object.value;
|
|
468
|
+
if (!this.sharedNamespaceNames.has(this.sharedImportAliases.get(ns) ?? ns))
|
|
469
|
+
return expr;
|
|
470
|
+
return { type: 'Identifier', value: expr.property.value, span: expr.span };
|
|
471
|
+
}
|
|
472
|
+
// The variable a `typeof` names: `typeof LABELS`, or `typeof Types.LABELS` through a namespace import
|
|
473
|
+
typeQueryName(exprName) {
|
|
474
|
+
if (exprName?.type === 'TsQualifiedName') {
|
|
475
|
+
return this.unwrapNamespace({ type: 'MemberExpression', object: exprName.left, property: exprName.right })?.value;
|
|
476
|
+
}
|
|
477
|
+
return exprName?.value ?? exprName?.name;
|
|
478
|
+
}
|
|
445
479
|
/**
|
|
446
480
|
* Mirror every declaration captured under its declared name onto the local
|
|
447
481
|
* names it was imported as. Must run after the pre-scan pass has seen all
|
|
@@ -455,6 +489,7 @@ class ExpressionResolver {
|
|
|
455
489
|
this.sharedTypeAliasTable,
|
|
456
490
|
this.sharedEnumTable,
|
|
457
491
|
this.sharedVariableTable,
|
|
492
|
+
this.sharedObjectMapTable,
|
|
458
493
|
this.sharedFunctionReturnTable,
|
|
459
494
|
this.sharedFunctionReturnMembers,
|
|
460
495
|
this.objectTypeTable,
|
|
@@ -530,13 +565,14 @@ class ExpressionResolver {
|
|
|
530
565
|
* function returning one (`getAnimal()`).
|
|
531
566
|
*/
|
|
532
567
|
objectMembersOf(expr) {
|
|
533
|
-
expr = unwrapParens(expr);
|
|
568
|
+
expr = this.unwrapNamespace(unwrapParens(expr));
|
|
534
569
|
if (expr?.type === 'OptionalChainingExpression')
|
|
535
570
|
return this.objectMembersOf(expr.base);
|
|
536
571
|
if (expr?.type === 'Identifier')
|
|
537
572
|
return this.temporaryObjectVariables.get(expr.value) ?? this.objectVariables.get(expr.value);
|
|
538
|
-
|
|
539
|
-
|
|
573
|
+
const callee = this.unwrapNamespace(expr?.callee);
|
|
574
|
+
if (expr?.type === 'CallExpression' && callee?.type === 'Identifier')
|
|
575
|
+
return this.sharedFunctionReturnMembers.get(callee.value);
|
|
540
576
|
// `deepObject.Foo.Bar` → the members nested under `Foo.Bar`
|
|
541
577
|
if (expr?.type === 'MemberExpression') {
|
|
542
578
|
const prop = expr.property;
|
|
@@ -620,8 +656,8 @@ class ExpressionResolver {
|
|
|
620
656
|
}
|
|
621
657
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
622
658
|
}
|
|
623
|
-
|
|
624
|
-
|
|
659
|
+
const name = tsType.type === 'TsTypeReference' ? typeRefName(tsType) : undefined;
|
|
660
|
+
if (name) {
|
|
625
661
|
// `Base<'DUCK'>` → instantiate the generic type's members with the argument
|
|
626
662
|
const args = tsType.typeParams?.params;
|
|
627
663
|
const params = this.objectTypeParams.get(name);
|
|
@@ -675,7 +711,7 @@ class ExpressionResolver {
|
|
|
675
711
|
obj = obj.typeAnnotation;
|
|
676
712
|
if (obj?.type === 'TsIndexedAccessType')
|
|
677
713
|
obj = this.indexedAccessTarget(obj);
|
|
678
|
-
const name = obj?.type === 'TsTypeReference' && !obj.typeParams
|
|
714
|
+
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? typeRefName(obj) : undefined;
|
|
679
715
|
const members = obj?.type === 'TsTypeLiteral'
|
|
680
716
|
? obj.members
|
|
681
717
|
: name && !this.objectTypeParams.has(name) ? this.objectTypeMembersRaw.get(name) : undefined;
|
|
@@ -722,7 +758,7 @@ class ExpressionResolver {
|
|
|
722
758
|
* inline literal (`([1, 2, 3, 4] as const).map(…)`) or a typed member (`props.colors`).
|
|
723
759
|
*/
|
|
724
760
|
arrayValuesOf(expr) {
|
|
725
|
-
expr = unwrapExpr(expr);
|
|
761
|
+
expr = this.unwrapNamespace(unwrapExpr(expr));
|
|
726
762
|
if (expr?.type === 'Identifier')
|
|
727
763
|
return this.getVariableValues(expr.value);
|
|
728
764
|
if (expr?.type === 'ArrayExpression')
|
|
@@ -740,7 +776,7 @@ class ExpressionResolver {
|
|
|
740
776
|
* typed member (`props.items`).
|
|
741
777
|
*/
|
|
742
778
|
arrayMembersOf(expr) {
|
|
743
|
-
expr = unwrapExpr(expr);
|
|
779
|
+
expr = this.unwrapNamespace(unwrapExpr(expr));
|
|
744
780
|
if (expr?.type === 'Identifier')
|
|
745
781
|
return this.arrayElementMembers.get(expr.value);
|
|
746
782
|
if (expr?.type === 'ArrayExpression')
|
|
@@ -942,10 +978,7 @@ class ExpressionResolver {
|
|
|
942
978
|
const v = this.variableTable.get(name);
|
|
943
979
|
if (v && !Array.isArray(v) && typeof v === 'object')
|
|
944
980
|
return v;
|
|
945
|
-
|
|
946
|
-
if (ev)
|
|
947
|
-
return ev;
|
|
948
|
-
return undefined;
|
|
981
|
+
return this.sharedObjectMapTable.get(name) ?? this.sharedEnumTable.get(name);
|
|
949
982
|
}
|
|
950
983
|
/**
|
|
951
984
|
* Capture a TypeScript enum declaration so members can be resolved later.
|
|
@@ -1026,7 +1059,8 @@ class ExpressionResolver {
|
|
|
1026
1059
|
*/
|
|
1027
1060
|
resolvePossibleStringValuesFromExpression(expression, returnEmptyStrings = false) {
|
|
1028
1061
|
// `t(('key'))` / `t(cond ? 'a' : ('b'))`: parens are just a wrapper node (#295).
|
|
1029
|
-
|
|
1062
|
+
// `Types.COLORS` with `import * as Types` → `COLORS`
|
|
1063
|
+
expression = this.unwrapNamespace(unwrapParens(expression));
|
|
1030
1064
|
// `pet.category?.kind` → `pet.category.kind`
|
|
1031
1065
|
if (expression.type === 'OptionalChainingExpression') {
|
|
1032
1066
|
return this.resolvePossibleStringValuesFromExpression(expression.base, returnEmptyStrings);
|
|
@@ -1111,7 +1145,7 @@ class ExpressionResolver {
|
|
|
1111
1145
|
// MemberExpression: try to resolve object identifier to an object map in the symbol table
|
|
1112
1146
|
if (expression.type === 'MemberExpression') {
|
|
1113
1147
|
try {
|
|
1114
|
-
const obj = expression.object;
|
|
1148
|
+
const obj = this.unwrapNamespace(expression.object);
|
|
1115
1149
|
const prop = expression.property;
|
|
1116
1150
|
const propName = prop.type === 'Identifier'
|
|
1117
1151
|
? prop.value
|
|
@@ -1126,7 +1160,7 @@ class ExpressionResolver {
|
|
|
1126
1160
|
// only handle simple identifier base + simple property (Identifier or computed StringLiteral)
|
|
1127
1161
|
if (obj.type === 'Identifier') {
|
|
1128
1162
|
const baseVar = this.variableTable.get(obj.value);
|
|
1129
|
-
const baseShared = this.sharedEnumTable.get(obj.value);
|
|
1163
|
+
const baseShared = this.sharedObjectMapTable.get(obj.value) ?? this.sharedEnumTable.get(obj.value);
|
|
1130
1164
|
const base = baseVar ?? baseShared;
|
|
1131
1165
|
if (base && typeof base !== 'string' && !Array.isArray(base)) {
|
|
1132
1166
|
if (propName && base[propName] !== undefined) {
|
|
@@ -1163,7 +1197,7 @@ class ExpressionResolver {
|
|
|
1163
1197
|
// the shared cross-file table populated during pre-scan.
|
|
1164
1198
|
if (expression.type === 'CallExpression') {
|
|
1165
1199
|
try {
|
|
1166
|
-
const callee = expression.callee;
|
|
1200
|
+
const callee = this.unwrapNamespace(expression.callee);
|
|
1167
1201
|
if (callee?.type === 'Identifier') {
|
|
1168
1202
|
const v = this.variableTable.get(callee.value);
|
|
1169
1203
|
if (Array.isArray(v) && v.length > 0)
|
|
@@ -1296,9 +1330,7 @@ class ExpressionResolver {
|
|
|
1296
1330
|
// where `type ChangeType = 'all' | 'next' | 'this'` was captured earlier.
|
|
1297
1331
|
// Also handles `declare const d: SomeEnum` where SomeEnum is a TS enum with string values.
|
|
1298
1332
|
if (type.type === 'TsTypeReference') {
|
|
1299
|
-
const typeName = type
|
|
1300
|
-
? type.typeName.value
|
|
1301
|
-
: undefined;
|
|
1333
|
+
const typeName = typeRefName(type);
|
|
1302
1334
|
if (typeName) {
|
|
1303
1335
|
// Inside a generic type: the parameter's argument, default or constraint
|
|
1304
1336
|
const bound = this.typeParamBindings.get(typeName);
|
|
@@ -1336,7 +1368,7 @@ class ExpressionResolver {
|
|
|
1336
1368
|
// SWC: TsTypeQuery.exprName is TsEntityName (Identifier | TsQualifiedName)
|
|
1337
1369
|
const exprName = objType.exprName ?? objType.expr ?? objType.entityName;
|
|
1338
1370
|
// access .value (Identifier) or fall back to .name for alternate SWC builds
|
|
1339
|
-
const varName = exprName
|
|
1371
|
+
const varName = this.typeQueryName(exprName);
|
|
1340
1372
|
if (varName) {
|
|
1341
1373
|
const vals = this.getVariableValues(varName);
|
|
1342
1374
|
if (vals && vals.length > 0)
|
|
@@ -1371,17 +1403,17 @@ class ExpressionResolver {
|
|
|
1371
1403
|
// Object.keys(MAP).forEach(k => t(MAP[k]))
|
|
1372
1404
|
if (type.type === 'TsTypeOperator') {
|
|
1373
1405
|
try {
|
|
1374
|
-
const op = type.
|
|
1406
|
+
const op = type.op;
|
|
1375
1407
|
if (op === 'keyof') {
|
|
1376
1408
|
let inner = type.typeAnnotation;
|
|
1377
1409
|
while (inner?.type === 'TsParenthesizedType')
|
|
1378
1410
|
inner = inner.typeAnnotation;
|
|
1379
1411
|
if (inner?.type === 'TsTypeQuery' || inner?.type === 'TSTypeQuery') {
|
|
1380
1412
|
const exprName = inner.exprName ?? inner.expr ?? inner.entityName;
|
|
1381
|
-
const varName = exprName
|
|
1413
|
+
const varName = this.typeQueryName(exprName);
|
|
1382
1414
|
if (varName) {
|
|
1383
|
-
// Look up in variableTable (local) or
|
|
1384
|
-
const v = this.variableTable.get(varName) ?? this.
|
|
1415
|
+
// Look up in variableTable (local) or sharedObjectMapTable (cross-file) for object maps
|
|
1416
|
+
const v = this.variableTable.get(varName) ?? this.sharedObjectMapTable.get(varName);
|
|
1385
1417
|
if (v && !Array.isArray(v) && typeof v === 'object') {
|
|
1386
1418
|
return Object.keys(v);
|
|
1387
1419
|
}
|
|
@@ -1446,4 +1478,4 @@ class ExpressionResolver {
|
|
|
1446
1478
|
}
|
|
1447
1479
|
}
|
|
1448
1480
|
|
|
1449
|
-
export { ExpressionResolver, nestedMembers };
|
|
1481
|
+
export { ExpressionResolver, nestedMembers, typeRefName };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-visitors.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/ast-visitors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3H,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ast-visitors.d.ts","sourceRoot":"","sources":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;IACI,KAAK,CAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAUjC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,IAAI;IA+bZ;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAiH1B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB,mFAAmF;IACnF,OAAO,CAAC,oBAAoB;IAoB5B;;;;;;;;OAQG;IACH,OAAO,CAAC,gCAAgC;IAiDxC;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IA+CxB;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B;IA8ClC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAqB5B;;;;;;;;OAQG;IACI,eAAe,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5D;;OAEG;IACI,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxD;;;;;;OAMG;IACI,cAAc,IAAK,MAAM;IAIhC;;OAEG;IACI,cAAc,IAAK,MAAM;CAGjC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Expression } from '@swc/core';
|
|
2
2
|
import type { ASTVisitorHooks } from '../../types.js';
|
|
3
3
|
export declare const nestedMembers: (members: Record<string, string[]> | undefined, name: string) => Record<string, string[]> | undefined;
|
|
4
|
+
export declare const typeRefName: (type: any) => string | undefined;
|
|
4
5
|
export declare class ExpressionResolver {
|
|
5
6
|
private hooks;
|
|
6
7
|
private variableTable;
|
|
7
8
|
private sharedEnumTable;
|
|
8
9
|
private typeAliasTable;
|
|
9
10
|
private sharedVariableTable;
|
|
11
|
+
private sharedObjectMapTable;
|
|
10
12
|
private sharedTypeAliasTable;
|
|
11
13
|
private sharedFunctionReturnTable;
|
|
12
14
|
private temporaryVariables;
|
|
@@ -15,6 +17,7 @@ export declare class ExpressionResolver {
|
|
|
15
17
|
private temporaryObjectVariables;
|
|
16
18
|
private arrayElementMembers;
|
|
17
19
|
private sharedImportAliases;
|
|
20
|
+
private sharedNamespaceNames;
|
|
18
21
|
private objectTypeParams;
|
|
19
22
|
private typeParamBindings;
|
|
20
23
|
private sharedFunctionReturnMembers;
|
|
@@ -73,6 +76,12 @@ export declare class ExpressionResolver {
|
|
|
73
76
|
* where `imported` is null for a non-renaming import (nothing to record then).
|
|
74
77
|
*/
|
|
75
78
|
captureImportDeclaration(node: any): void;
|
|
79
|
+
/**
|
|
80
|
+
* `Types.COLORS` → `COLORS` when `Types` is a namespace import (also one renamed by
|
|
81
|
+
* `import { Types as T }` from a barrel); any other expression is returned as is.
|
|
82
|
+
*/
|
|
83
|
+
unwrapNamespace(expr: any): any;
|
|
84
|
+
private typeQueryName;
|
|
76
85
|
/**
|
|
77
86
|
* Mirror every declaration captured under its declared name onto the local
|
|
78
87
|
* names it was imported as. Must run after the pre-scan pass has seen all
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-resolver.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/expression-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkD,MAAM,WAAW,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AA0BrD,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAetH,CAAA;
|
|
1
|
+
{"version":3,"file":"expression-resolver.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/expression-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkD,MAAM,WAAW,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AA0BrD,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE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