i18next-cli 1.75.1 → 1.75.2
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 +2 -2
- package/dist/cjs/extractor/core/ast-visitors.js +3 -2
- package/dist/cjs/extractor/core/key-finder.js +8 -6
- package/dist/cjs/extractor/parsers/expression-resolver.js +155 -22
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/localize/localize.js +1 -1
- package/dist/esm/cli.js +2 -2
- package/dist/esm/extractor/core/ast-visitors.js +4 -3
- package/dist/esm/extractor/core/key-finder.js +2 -0
- package/dist/esm/extractor/parsers/expression-resolver.js +156 -22
- package/dist/esm/index.js +1 -1
- package/dist/esm/localize/localize.js +1 -1
- package/package.json +1 -1
- package/types/extractor/core/ast-visitors.d.ts.map +1 -1
- package/types/extractor/core/key-finder.d.ts.map +1 -1
- package/types/extractor/parsers/expression-resolver.d.ts +17 -1
- package/types/extractor/parsers/expression-resolver.d.ts.map +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -9,8 +9,8 @@ var node_util = require('node:util');
|
|
|
9
9
|
var config = require('./config.js');
|
|
10
10
|
var heuristicConfig = require('./heuristic-config.js');
|
|
11
11
|
var extractor = require('./extractor/core/extractor.js');
|
|
12
|
-
require('node:module');
|
|
13
12
|
require('node:path');
|
|
13
|
+
require('node:module');
|
|
14
14
|
var nestedObject = require('./utils/nested-object.js');
|
|
15
15
|
require('node:fs/promises');
|
|
16
16
|
require('jiti');
|
|
@@ -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.2') // 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)');
|
|
@@ -826,8 +826,8 @@ class ASTVisitors {
|
|
|
826
826
|
let members;
|
|
827
827
|
if (tsType.type === 'TsTypeLiteral')
|
|
828
828
|
members = tsType.members;
|
|
829
|
-
else if (tsType.type === 'TsTypeReference' && expressionResolver.typeRefName(tsType)) {
|
|
830
|
-
members = this.expressionResolver.getObjectTypeMembersRaw(expressionResolver.typeRefName(tsType));
|
|
829
|
+
else if (tsType.type === 'TsTypeReference' && this.expressionResolver.typeRefName(tsType)) {
|
|
830
|
+
members = this.expressionResolver.getObjectTypeMembersRaw(this.expressionResolver.typeRefName(tsType));
|
|
831
831
|
}
|
|
832
832
|
if (!Array.isArray(members))
|
|
833
833
|
return [];
|
|
@@ -1053,6 +1053,7 @@ class ASTVisitors {
|
|
|
1053
1053
|
setCurrentFile(file, code) {
|
|
1054
1054
|
this.currentFile = file;
|
|
1055
1055
|
this.currentCode = code;
|
|
1056
|
+
this.expressionResolver.setCurrentFile(file);
|
|
1056
1057
|
}
|
|
1057
1058
|
/**
|
|
1058
1059
|
* Returns the currently set file path.
|
|
@@ -6,6 +6,7 @@ var logger = require('../../utils/logger.js');
|
|
|
6
6
|
var pluginManager = require('../plugin-manager.js');
|
|
7
7
|
var astVisitors = require('./ast-visitors.js');
|
|
8
8
|
var expressionResolver = require('../parsers/expression-resolver.js');
|
|
9
|
+
var config = require('../../config.js');
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Main function for finding translation keys across all source files in a project.
|
|
@@ -35,10 +36,10 @@ var expressionResolver = require('../parsers/expression-resolver.js');
|
|
|
35
36
|
* console.log(`Found ${keys.size} unique translation keys`)
|
|
36
37
|
* ```
|
|
37
38
|
*/
|
|
38
|
-
async function findKeys(config, logger$1 = new logger.ConsoleLogger(), fileErrors) {
|
|
39
|
-
const { plugins: pluginsOrUndefined, ...otherConfig } = config;
|
|
39
|
+
async function findKeys(config$1, logger$1 = new logger.ConsoleLogger(), fileErrors) {
|
|
40
|
+
const { plugins: pluginsOrUndefined, ...otherConfig } = config$1;
|
|
40
41
|
const plugins = pluginsOrUndefined || [];
|
|
41
|
-
const sourceFiles = await processSourceFiles(config);
|
|
42
|
+
const sourceFiles = await processSourceFiles(config$1);
|
|
42
43
|
const allKeys = new Map();
|
|
43
44
|
// 1. Create the base context with config and logger.
|
|
44
45
|
const pluginContext = pluginManager.createPluginContext(allKeys, plugins, otherConfig, logger$1);
|
|
@@ -57,7 +58,7 @@ async function findKeys(config, logger$1 = new logger.ConsoleLogger(), fileError
|
|
|
57
58
|
resolvePossibleKeyStringValues: (expression) => {
|
|
58
59
|
return plugins.flatMap(plugin => {
|
|
59
60
|
try {
|
|
60
|
-
return plugin.extractKeysFromExpression?.(expression, config, logger$1) ?? [];
|
|
61
|
+
return plugin.extractKeysFromExpression?.(expression, config$1, logger$1) ?? [];
|
|
61
62
|
}
|
|
62
63
|
catch (err) {
|
|
63
64
|
logger$1.warn(`Plugin ${plugin.name} extractKeysFromExpression failed:`, err);
|
|
@@ -68,7 +69,7 @@ async function findKeys(config, logger$1 = new logger.ConsoleLogger(), fileError
|
|
|
68
69
|
resolvePossibleContextStringValues: (expression) => {
|
|
69
70
|
return plugins.flatMap(plugin => {
|
|
70
71
|
try {
|
|
71
|
-
return plugin.extractContextFromExpression?.(expression, config, logger$1) ?? [];
|
|
72
|
+
return plugin.extractContextFromExpression?.(expression, config$1, logger$1) ?? [];
|
|
72
73
|
}
|
|
73
74
|
catch (err) {
|
|
74
75
|
logger$1.warn(`Plugin ${plugin.name} extractContextFromExpression failed:`, err);
|
|
@@ -80,7 +81,8 @@ async function findKeys(config, logger$1 = new logger.ConsoleLogger(), fileError
|
|
|
80
81
|
// 3. Create the visitor instance, passing it the context.
|
|
81
82
|
// Use a shared ExpressionResolver so captured enums/objects in one file are available when resolving MemberExpressions
|
|
82
83
|
const sharedExpressionResolver = new expressionResolver.ExpressionResolver(hooks);
|
|
83
|
-
sharedExpressionResolver.maxMemberDepth = config.extract.maxTypeDepth ?? 5;
|
|
84
|
+
sharedExpressionResolver.maxMemberDepth = config$1.extract.maxTypeDepth ?? 5;
|
|
85
|
+
sharedExpressionResolver.pathAliases = await config.getTsConfigAliases();
|
|
84
86
|
const astVisitors$1 = new astVisitors.ASTVisitors(otherConfig, pluginContext, logger$1, hooks, sharedExpressionResolver);
|
|
85
87
|
// 4. "Wire up" the visitor's scope method to the context.
|
|
86
88
|
// This avoids a circular dependency while giving plugins access to the scope.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var node_path = require('node:path');
|
|
3
4
|
var astUtils = require('./ast-utils.js');
|
|
4
5
|
|
|
5
6
|
// Whether `next` holds everything `prev` does: every value of a list, every
|
|
@@ -61,9 +62,45 @@ const memberByKey = (members, key) => {
|
|
|
61
62
|
}
|
|
62
63
|
return index.get(key);
|
|
63
64
|
};
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// `/src/api/github-api.ts`, `.d.ts`, or an import of `./github-api.js` -> `/src/api/github-api`
|
|
66
|
+
const moduleKey = (path) => path.replace(/(\.d)?\.[cm]?[jt]sx?$/, '');
|
|
67
|
+
/**
|
|
68
|
+
* A cross-file table keyed by declared name. Every entry is also kept under the module that
|
|
69
|
+
* declares it (`/src/api/github-api#components`), and a lookup made while a file is being read
|
|
70
|
+
* first tries where that file gets the name from: the module it imported it from, then its own
|
|
71
|
+
* declaration. The bare name, held by whichever file declared it last, is the fallback, so two
|
|
72
|
+
* generated clients that both declare `components` no longer overwrite each other (#306).
|
|
73
|
+
*/
|
|
74
|
+
class ModuleTable extends Map {
|
|
75
|
+
scope;
|
|
76
|
+
constructor(scope) {
|
|
77
|
+
super();
|
|
78
|
+
this.scope = scope;
|
|
79
|
+
}
|
|
80
|
+
get(name) {
|
|
81
|
+
for (const key of this.scope.keysOf(name)) {
|
|
82
|
+
const value = super.get(key);
|
|
83
|
+
if (value !== undefined)
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
return super.get(name);
|
|
87
|
+
}
|
|
88
|
+
has(name) {
|
|
89
|
+
return this.scope.keysOf(name).some(key => super.has(key)) || super.has(name);
|
|
90
|
+
}
|
|
91
|
+
set(name, value) {
|
|
92
|
+
const key = this.scope.declaringKey(name);
|
|
93
|
+
if (key)
|
|
94
|
+
super.set(key, value);
|
|
95
|
+
return super.set(name, value);
|
|
96
|
+
}
|
|
97
|
+
delete(name) {
|
|
98
|
+
const key = this.scope.declaringKey(name);
|
|
99
|
+
if (key)
|
|
100
|
+
super.delete(key);
|
|
101
|
+
return super.delete(name);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
67
104
|
// `T['a']` / `T[200]` -> 'a' / '200'
|
|
68
105
|
const indexedKey = (type) => type?.indexType?.type === 'TsLiteralType' ? literalKey(type.indexType.literal) : undefined;
|
|
69
106
|
// Whether replacing `prev` by `next` only adds to it.
|
|
@@ -96,33 +133,33 @@ class ExpressionResolver {
|
|
|
96
133
|
// - Record<string, string> (object of static string properties)
|
|
97
134
|
variableTable = new Map();
|
|
98
135
|
// Shared (cross-file) table for enums / exported object maps that should persist
|
|
99
|
-
sharedEnumTable = new
|
|
136
|
+
sharedEnumTable = new ModuleTable(this);
|
|
100
137
|
// Per-file table for type aliases: Maps typeName -> string[]
|
|
101
138
|
// e.g. `type ChangeType = 'all' | 'next' | 'this'` -> { ChangeType: ['all', 'next', 'this'] }
|
|
102
139
|
typeAliasTable = new Map();
|
|
103
140
|
// Shared (cross-file) table for string-array constants (e.g. `as const` arrays).
|
|
104
141
|
// Persists across resetFileSymbols() so exported arrays are visible to importers.
|
|
105
|
-
sharedVariableTable = new
|
|
142
|
+
sharedVariableTable = new ModuleTable(this);
|
|
106
143
|
// Shared (cross-file) table for as-const object maps, `export const LABELS = { … } as const`,
|
|
107
144
|
// so `LABELS.save` and `Object.keys(LABELS)` resolve in importing files.
|
|
108
|
-
sharedObjectMapTable = new
|
|
145
|
+
sharedObjectMapTable = new ModuleTable(this);
|
|
109
146
|
// Shared (cross-file) table for type aliases — populated alongside typeAliasTable.
|
|
110
147
|
// Persists across resetFileSymbols() so exported type aliases are visible to importers.
|
|
111
|
-
sharedTypeAliasTable = new
|
|
148
|
+
sharedTypeAliasTable = new ModuleTable(this);
|
|
112
149
|
// Shared (cross-file) table for function return-value sets. Populated from
|
|
113
150
|
// both explicit return-type annotations and body-inferred return values so
|
|
114
151
|
// that `t(fn())` / `const x = fn(); t(\`...${x}...\`)` work across files.
|
|
115
152
|
// Persists across resetFileSymbols() just like the other shared tables.
|
|
116
|
-
sharedFunctionReturnTable = new
|
|
153
|
+
sharedFunctionReturnTable = new ModuleTable(this);
|
|
117
154
|
// Temporary per-scope variable overrides, used to inject .map() / .forEach()
|
|
118
155
|
// callback parameters while the callback body is being walked.
|
|
119
156
|
temporaryVariables = new Map();
|
|
120
157
|
// Shared (cross-file) table for object-shaped types: interfaces and object
|
|
121
158
|
// type aliases. Maps typeName -> { memberName: possible string values }.
|
|
122
159
|
// e.g. `interface IProps { size: ChangeType }` -> { IProps: { size: ['all','next'] } }
|
|
123
|
-
objectTypeTable = new
|
|
160
|
+
objectTypeTable = new ModuleTable(this);
|
|
124
161
|
// Raw TS member nodes of local interfaces / object type aliases, keyed by type name.
|
|
125
|
-
objectTypeMembersRaw = new
|
|
162
|
+
objectTypeMembersRaw = new ModuleTable(this);
|
|
126
163
|
// Temporary per-scope bindings for identifiers holding an object-shaped type,
|
|
127
164
|
// e.g. `function f(props: IProps)` -> { props: { size: ['all','next'] } }.
|
|
128
165
|
temporaryObjectVariables = new Map();
|
|
@@ -139,12 +176,12 @@ class ExpressionResolver {
|
|
|
139
176
|
// members are declared under their own names, so `Types.COLORS` resolves as `COLORS`.
|
|
140
177
|
sharedNamespaceNames = new Set();
|
|
141
178
|
// Type parameters of generic object types, e.g. `type Base<T> = { type: T }`.
|
|
142
|
-
objectTypeParams = new
|
|
179
|
+
objectTypeParams = new ModuleTable(this);
|
|
143
180
|
// Values bound to type parameters while a generic type is being resolved.
|
|
144
181
|
typeParamBindings = new Map();
|
|
145
182
|
// Shared (cross-file) member maps of functions returning an object type,
|
|
146
183
|
// e.g. `const getAnimal = (): Animal => …` -> { getAnimal: { type: ['DUCK', 'DOG'] } }
|
|
147
|
-
sharedFunctionReturnMembers = new
|
|
184
|
+
sharedFunctionReturnMembers = new ModuleTable(this);
|
|
148
185
|
// Per-file identifiers holding an object type, from their annotation or from the
|
|
149
186
|
// function they were initialised by: `const animal = getAnimal()` -> { animal: { type: [...] } }
|
|
150
187
|
objectVariables = new Map();
|
|
@@ -159,9 +196,88 @@ class ExpressionResolver {
|
|
|
159
196
|
// this many levels below a declared or indexed type, so recursive types stay small
|
|
160
197
|
// (`extract.maxTypeDepth`).
|
|
161
198
|
maxMemberDepth = 5;
|
|
199
|
+
// The module being read (its path without extension), and where each module gets its
|
|
200
|
+
// names from (see ModuleTable)
|
|
201
|
+
currentModule;
|
|
202
|
+
knownModules = new Set();
|
|
203
|
+
// module -> local name -> { from: the import's resolved path, name: the declared name }
|
|
204
|
+
fileImports = new Map();
|
|
205
|
+
// module -> namespace import's local name -> the import's resolved path
|
|
206
|
+
fileNamespaces = new Map();
|
|
207
|
+
// tsconfig `paths`, `@api` -> `/abs/src/api`
|
|
208
|
+
pathAliases = {};
|
|
162
209
|
constructor(hooks) {
|
|
163
210
|
this.hooks = hooks;
|
|
164
211
|
}
|
|
212
|
+
setCurrentFile(file) {
|
|
213
|
+
this.currentModule = moduleKey(node_path.resolve(file));
|
|
214
|
+
this.knownModules.add(this.currentModule);
|
|
215
|
+
}
|
|
216
|
+
// `./api/github-api` / `@api/github-api` imported in the current file -> its path, or undefined
|
|
217
|
+
// for a package or anything else that isn't a file of this project
|
|
218
|
+
importPath(source) {
|
|
219
|
+
if (!this.currentModule)
|
|
220
|
+
return undefined;
|
|
221
|
+
if (source.startsWith('.'))
|
|
222
|
+
return moduleKey(node_path.resolve(node_path.dirname(this.currentModule), source));
|
|
223
|
+
for (const [alias, path] of Object.entries(this.pathAliases)) {
|
|
224
|
+
if (source === alias || source.startsWith(`${alias}/`))
|
|
225
|
+
return moduleKey(node_path.resolve(path, `.${source.slice(alias.length)}`));
|
|
226
|
+
}
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
// The scanned module an import path points to: the file itself or its `index`
|
|
230
|
+
moduleOf(path) {
|
|
231
|
+
return [path, `${path}/index`].find(m => this.knownModules.has(m));
|
|
232
|
+
}
|
|
233
|
+
// ModuleTable: the keys `name` read in the current file may be stored under, most specific first
|
|
234
|
+
keysOf(name) {
|
|
235
|
+
if (name.includes('#'))
|
|
236
|
+
return [name];
|
|
237
|
+
if (!this.currentModule)
|
|
238
|
+
return [];
|
|
239
|
+
const keys = [];
|
|
240
|
+
const imported = this.fileImports.get(this.currentModule)?.get(name);
|
|
241
|
+
const module = imported && this.moduleOf(imported.from);
|
|
242
|
+
if (module)
|
|
243
|
+
keys.push(`${module}#${imported.name}`);
|
|
244
|
+
keys.push(`${this.currentModule}#${name}`);
|
|
245
|
+
return keys;
|
|
246
|
+
}
|
|
247
|
+
// ModuleTable: the key a declaration made in the current file is also stored under
|
|
248
|
+
declaringKey(name) {
|
|
249
|
+
return this.currentModule && !name.includes('#') ? `${this.currentModule}#${name}` : undefined;
|
|
250
|
+
}
|
|
251
|
+
// Replays run after every file was read: run each in the file it was recorded in
|
|
252
|
+
inCurrentFile(fn) {
|
|
253
|
+
const module = this.currentModule;
|
|
254
|
+
return () => {
|
|
255
|
+
const saved = this.currentModule;
|
|
256
|
+
this.currentModule = module;
|
|
257
|
+
try {
|
|
258
|
+
fn();
|
|
259
|
+
}
|
|
260
|
+
finally {
|
|
261
|
+
this.currentModule = saved;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* `Color` / `Types.Color` / `NS.Inner.Color` -> 'Color'. Declarations are looked up by their
|
|
267
|
+
* own name, so a qualified name resolves by its last part, whatever namespace holds it, and
|
|
268
|
+
* through a namespace import of a module (`GH.components`) by that module's declaration.
|
|
269
|
+
*/
|
|
270
|
+
typeRefName(type) {
|
|
271
|
+
const typeName = type?.typeName;
|
|
272
|
+
if (typeName?.type === 'Identifier')
|
|
273
|
+
return typeName.value;
|
|
274
|
+
if (typeName?.type !== 'TsQualifiedName')
|
|
275
|
+
return undefined;
|
|
276
|
+
const name = typeName.right?.value;
|
|
277
|
+
const from = typeName.left?.type === 'Identifier' && this.currentModule ? this.fileNamespaces.get(this.currentModule)?.get(typeName.left.value) : undefined;
|
|
278
|
+
const module = from && this.moduleOf(from);
|
|
279
|
+
return module && name ? `${module}#${name}` : name;
|
|
280
|
+
}
|
|
165
281
|
/**
|
|
166
282
|
* Clear per-file captured variables. Enums / shared maps are kept.
|
|
167
283
|
*/
|
|
@@ -181,6 +297,8 @@ class ExpressionResolver {
|
|
|
181
297
|
*/
|
|
182
298
|
finishPreScan() {
|
|
183
299
|
this.resetFileSymbols();
|
|
300
|
+
// Mirroring onto import aliases writes bare names only; each replay restores its own file
|
|
301
|
+
this.currentModule = undefined;
|
|
184
302
|
// ponytail: each round fixes one more link of a chain declared against file order; 10 is plenty
|
|
185
303
|
for (let round = 0; round < 10; round++) {
|
|
186
304
|
this.applyImportAliases();
|
|
@@ -404,7 +522,7 @@ class ExpressionResolver {
|
|
|
404
522
|
if (!tsType)
|
|
405
523
|
return;
|
|
406
524
|
if (this.recording)
|
|
407
|
-
this.replays.push(() => this.captureTypeAliasDeclaration(node));
|
|
525
|
+
this.replays.push(this.inCurrentFile(() => this.captureTypeAliasDeclaration(node)));
|
|
408
526
|
const params = node.typeParams?.parameters;
|
|
409
527
|
// `type IProps = { size: ChangeType }` — object shape, not a string union.
|
|
410
528
|
if (tsType.type === 'TsTypeLiteral') {
|
|
@@ -441,18 +559,31 @@ class ExpressionResolver {
|
|
|
441
559
|
*/
|
|
442
560
|
captureImportDeclaration(node) {
|
|
443
561
|
try {
|
|
562
|
+
const from = node?.type === 'ImportDeclaration' && typeof node.source?.value === 'string' ? this.importPath(node.source.value) : undefined;
|
|
563
|
+
const imports = from && this.currentModule ? (this.fileImports.get(this.currentModule) ?? new Map()) : undefined;
|
|
564
|
+
if (imports)
|
|
565
|
+
this.fileImports.set(this.currentModule, imports);
|
|
444
566
|
for (const spec of node?.specifiers ?? []) {
|
|
445
567
|
// `import * as Types from …` / `export * as Types from …`
|
|
446
|
-
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value)
|
|
568
|
+
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value) {
|
|
447
569
|
this.sharedNamespaceNames.add(spec.local.value);
|
|
570
|
+
if (from) {
|
|
571
|
+
if (!this.fileNamespaces.has(this.currentModule))
|
|
572
|
+
this.fileNamespaces.set(this.currentModule, new Map());
|
|
573
|
+
this.fileNamespaces.get(this.currentModule).set(spec.local.value, from);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
448
576
|
if (spec?.type === 'ExportNamespaceSpecifier' && spec.name?.value)
|
|
449
577
|
this.sharedNamespaceNames.add(spec.name.value);
|
|
450
578
|
if (spec?.type !== 'ImportSpecifier')
|
|
451
579
|
continue;
|
|
452
580
|
const local = spec.local?.value;
|
|
453
|
-
const imported = spec.imported?.value;
|
|
581
|
+
const imported = spec.imported?.value ?? local;
|
|
454
582
|
if (local && imported && local !== imported)
|
|
455
583
|
this.sharedImportAliases.set(local, imported);
|
|
584
|
+
// `import { components as githubComponents } from './github-api'` → that module's `components`
|
|
585
|
+
if (local && imported && imports)
|
|
586
|
+
imports.set(local, { from: from, name: imported });
|
|
456
587
|
}
|
|
457
588
|
}
|
|
458
589
|
catch {
|
|
@@ -469,7 +600,10 @@ class ExpressionResolver {
|
|
|
469
600
|
const ns = expr.object.value;
|
|
470
601
|
if (!this.sharedNamespaceNames.has(this.sharedImportAliases.get(ns) ?? ns))
|
|
471
602
|
return expr;
|
|
472
|
-
|
|
603
|
+
// `GH.components` with `import * as GH from './github-api'` → that module's `components`
|
|
604
|
+
const from = this.currentModule ? this.fileNamespaces.get(this.currentModule)?.get(ns) : undefined;
|
|
605
|
+
const module = from && this.moduleOf(from);
|
|
606
|
+
return { type: 'Identifier', value: module ? `${module}#${expr.property.value}` : expr.property.value, span: expr.span };
|
|
473
607
|
}
|
|
474
608
|
// The variable a `typeof` names: `typeof LABELS`, or `typeof Types.LABELS` through a namespace import
|
|
475
609
|
typeQueryName(exprName) {
|
|
@@ -519,7 +653,7 @@ class ExpressionResolver {
|
|
|
519
653
|
if (!name)
|
|
520
654
|
return;
|
|
521
655
|
if (this.recording)
|
|
522
|
-
this.replays.push(() => this.captureInterfaceDeclaration(node));
|
|
656
|
+
this.replays.push(this.inCurrentFile(() => this.captureInterfaceDeclaration(node)));
|
|
523
657
|
const params = node.typeParams?.parameters;
|
|
524
658
|
if (!this.replaying && Array.isArray(node?.body?.body))
|
|
525
659
|
this.setObjectTypeRaw(name, node.body.body, params);
|
|
@@ -658,7 +792,7 @@ class ExpressionResolver {
|
|
|
658
792
|
}
|
|
659
793
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
660
794
|
}
|
|
661
|
-
const name = tsType.type === 'TsTypeReference' ? typeRefName(tsType) : undefined;
|
|
795
|
+
const name = tsType.type === 'TsTypeReference' ? this.typeRefName(tsType) : undefined;
|
|
662
796
|
if (name) {
|
|
663
797
|
// `Base<'DUCK'>` → instantiate the generic type's members with the argument
|
|
664
798
|
const args = tsType.typeParams?.params;
|
|
@@ -713,7 +847,7 @@ class ExpressionResolver {
|
|
|
713
847
|
obj = obj.typeAnnotation;
|
|
714
848
|
if (obj?.type === 'TsIndexedAccessType')
|
|
715
849
|
obj = this.indexedAccessTarget(obj);
|
|
716
|
-
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? typeRefName(obj) : undefined;
|
|
850
|
+
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? this.typeRefName(obj) : undefined;
|
|
717
851
|
const members = obj?.type === 'TsTypeLiteral'
|
|
718
852
|
? obj.members
|
|
719
853
|
: name && !this.objectTypeParams.has(name) ? this.objectTypeMembersRaw.get(name) : undefined;
|
|
@@ -871,7 +1005,7 @@ class ExpressionResolver {
|
|
|
871
1005
|
};
|
|
872
1006
|
store();
|
|
873
1007
|
if (this.recording && (returnType || refs.length > 0))
|
|
874
|
-
this.replays.push(store);
|
|
1008
|
+
this.replays.push(this.inCurrentFile(store));
|
|
875
1009
|
}
|
|
876
1010
|
/**
|
|
877
1011
|
* Collect a function's return expressions (the expression body of an arrow
|
|
@@ -1332,7 +1466,7 @@ class ExpressionResolver {
|
|
|
1332
1466
|
// where `type ChangeType = 'all' | 'next' | 'this'` was captured earlier.
|
|
1333
1467
|
// Also handles `declare const d: SomeEnum` where SomeEnum is a TS enum with string values.
|
|
1334
1468
|
if (type.type === 'TsTypeReference') {
|
|
1335
|
-
const typeName = typeRefName(type);
|
|
1469
|
+
const typeName = this.typeRefName(type);
|
|
1336
1470
|
if (typeName) {
|
|
1337
1471
|
// Inside a generic type: the parameter's argument, default or constraint
|
|
1338
1472
|
const bound = this.typeParamBindings.get(typeName);
|
|
@@ -1482,4 +1616,3 @@ class ExpressionResolver {
|
|
|
1482
1616
|
|
|
1483
1617
|
exports.ExpressionResolver = ExpressionResolver;
|
|
1484
1618
|
exports.nestedMembers = nestedMembers;
|
|
1485
|
-
exports.typeRefName = typeRefName;
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var config = require('./config.js');
|
|
|
4
4
|
var extractor = require('./extractor/core/extractor.js');
|
|
5
5
|
var keyFinder = require('./extractor/core/key-finder.js');
|
|
6
6
|
var translationManager = require('./extractor/core/translation-manager.js');
|
|
7
|
+
require('node:path');
|
|
7
8
|
require('node:module');
|
|
8
9
|
var linter = require('./linter.js');
|
|
9
10
|
var syncer = require('./syncer.js');
|
|
@@ -15,7 +16,6 @@ require('./utils/jsx-attributes.js');
|
|
|
15
16
|
require('magic-string');
|
|
16
17
|
var localize = require('./localize/localize.js');
|
|
17
18
|
require('node:fs/promises');
|
|
18
|
-
require('node:path');
|
|
19
19
|
var agentPrompt = require('./localize/agent-prompt.js');
|
|
20
20
|
|
|
21
21
|
|
|
@@ -8,8 +8,8 @@ var glob = require('glob');
|
|
|
8
8
|
var config = require('../config.js');
|
|
9
9
|
var heuristicConfig = require('../heuristic-config.js');
|
|
10
10
|
var extractor = require('../extractor/core/extractor.js');
|
|
11
|
-
require('node:module');
|
|
12
11
|
require('node:path');
|
|
12
|
+
require('node:module');
|
|
13
13
|
var nestedObject = require('../utils/nested-object.js');
|
|
14
14
|
require('jiti');
|
|
15
15
|
require('@croct/json5-parser');
|
package/dist/esm/cli.js
CHANGED
|
@@ -7,8 +7,8 @@ import { styleText } from 'node:util';
|
|
|
7
7
|
import { ensureConfig, loadConfig } from './config.js';
|
|
8
8
|
import { detectConfig } from './heuristic-config.js';
|
|
9
9
|
import { runExtractor } from './extractor/core/extractor.js';
|
|
10
|
-
import 'node:module';
|
|
11
10
|
import 'node:path';
|
|
11
|
+
import 'node:module';
|
|
12
12
|
import { getNestedKeys, getNestedValue } from './utils/nested-object.js';
|
|
13
13
|
import 'node:fs/promises';
|
|
14
14
|
import 'jiti';
|
|
@@ -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.2') // 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
|
|
2
|
+
import { ExpressionResolver, nestedMembers } 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';
|
|
@@ -824,8 +824,8 @@ class ASTVisitors {
|
|
|
824
824
|
let members;
|
|
825
825
|
if (tsType.type === 'TsTypeLiteral')
|
|
826
826
|
members = tsType.members;
|
|
827
|
-
else if (tsType.type === 'TsTypeReference' && typeRefName(tsType)) {
|
|
828
|
-
members = this.expressionResolver.getObjectTypeMembersRaw(typeRefName(tsType));
|
|
827
|
+
else if (tsType.type === 'TsTypeReference' && this.expressionResolver.typeRefName(tsType)) {
|
|
828
|
+
members = this.expressionResolver.getObjectTypeMembersRaw(this.expressionResolver.typeRefName(tsType));
|
|
829
829
|
}
|
|
830
830
|
if (!Array.isArray(members))
|
|
831
831
|
return [];
|
|
@@ -1051,6 +1051,7 @@ class ASTVisitors {
|
|
|
1051
1051
|
setCurrentFile(file, code) {
|
|
1052
1052
|
this.currentFile = file;
|
|
1053
1053
|
this.currentCode = code;
|
|
1054
|
+
this.expressionResolver.setCurrentFile(file);
|
|
1054
1055
|
}
|
|
1055
1056
|
/**
|
|
1056
1057
|
* Returns the currently set file path.
|
|
@@ -4,6 +4,7 @@ import { ConsoleLogger } from '../../utils/logger.js';
|
|
|
4
4
|
import { createPluginContext, initializePlugins } from '../plugin-manager.js';
|
|
5
5
|
import { ASTVisitors } from './ast-visitors.js';
|
|
6
6
|
import { ExpressionResolver } from '../parsers/expression-resolver.js';
|
|
7
|
+
import { getTsConfigAliases } from '../../config.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Main function for finding translation keys across all source files in a project.
|
|
@@ -79,6 +80,7 @@ async function findKeys(config, logger = new ConsoleLogger(), fileErrors) {
|
|
|
79
80
|
// Use a shared ExpressionResolver so captured enums/objects in one file are available when resolving MemberExpressions
|
|
80
81
|
const sharedExpressionResolver = new ExpressionResolver(hooks);
|
|
81
82
|
sharedExpressionResolver.maxMemberDepth = config.extract.maxTypeDepth ?? 5;
|
|
83
|
+
sharedExpressionResolver.pathAliases = await getTsConfigAliases();
|
|
82
84
|
const astVisitors = new ASTVisitors(otherConfig, pluginContext, logger, hooks, sharedExpressionResolver);
|
|
83
85
|
// 4. "Wire up" the visitor's scope method to the context.
|
|
84
86
|
// This avoids a circular dependency while giving plugins access to the scope.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolve, dirname } from 'node:path';
|
|
1
2
|
import { unwrapParens } from './ast-utils.js';
|
|
2
3
|
|
|
3
4
|
// Whether `next` holds everything `prev` does: every value of a list, every
|
|
@@ -59,9 +60,45 @@ const memberByKey = (members, key) => {
|
|
|
59
60
|
}
|
|
60
61
|
return index.get(key);
|
|
61
62
|
};
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// `/src/api/github-api.ts`, `.d.ts`, or an import of `./github-api.js` -> `/src/api/github-api`
|
|
64
|
+
const moduleKey = (path) => path.replace(/(\.d)?\.[cm]?[jt]sx?$/, '');
|
|
65
|
+
/**
|
|
66
|
+
* A cross-file table keyed by declared name. Every entry is also kept under the module that
|
|
67
|
+
* declares it (`/src/api/github-api#components`), and a lookup made while a file is being read
|
|
68
|
+
* first tries where that file gets the name from: the module it imported it from, then its own
|
|
69
|
+
* declaration. The bare name, held by whichever file declared it last, is the fallback, so two
|
|
70
|
+
* generated clients that both declare `components` no longer overwrite each other (#306).
|
|
71
|
+
*/
|
|
72
|
+
class ModuleTable extends Map {
|
|
73
|
+
scope;
|
|
74
|
+
constructor(scope) {
|
|
75
|
+
super();
|
|
76
|
+
this.scope = scope;
|
|
77
|
+
}
|
|
78
|
+
get(name) {
|
|
79
|
+
for (const key of this.scope.keysOf(name)) {
|
|
80
|
+
const value = super.get(key);
|
|
81
|
+
if (value !== undefined)
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
return super.get(name);
|
|
85
|
+
}
|
|
86
|
+
has(name) {
|
|
87
|
+
return this.scope.keysOf(name).some(key => super.has(key)) || super.has(name);
|
|
88
|
+
}
|
|
89
|
+
set(name, value) {
|
|
90
|
+
const key = this.scope.declaringKey(name);
|
|
91
|
+
if (key)
|
|
92
|
+
super.set(key, value);
|
|
93
|
+
return super.set(name, value);
|
|
94
|
+
}
|
|
95
|
+
delete(name) {
|
|
96
|
+
const key = this.scope.declaringKey(name);
|
|
97
|
+
if (key)
|
|
98
|
+
super.delete(key);
|
|
99
|
+
return super.delete(name);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
65
102
|
// `T['a']` / `T[200]` -> 'a' / '200'
|
|
66
103
|
const indexedKey = (type) => type?.indexType?.type === 'TsLiteralType' ? literalKey(type.indexType.literal) : undefined;
|
|
67
104
|
// Whether replacing `prev` by `next` only adds to it.
|
|
@@ -94,33 +131,33 @@ class ExpressionResolver {
|
|
|
94
131
|
// - Record<string, string> (object of static string properties)
|
|
95
132
|
variableTable = new Map();
|
|
96
133
|
// Shared (cross-file) table for enums / exported object maps that should persist
|
|
97
|
-
sharedEnumTable = new
|
|
134
|
+
sharedEnumTable = new ModuleTable(this);
|
|
98
135
|
// Per-file table for type aliases: Maps typeName -> string[]
|
|
99
136
|
// e.g. `type ChangeType = 'all' | 'next' | 'this'` -> { ChangeType: ['all', 'next', 'this'] }
|
|
100
137
|
typeAliasTable = new Map();
|
|
101
138
|
// Shared (cross-file) table for string-array constants (e.g. `as const` arrays).
|
|
102
139
|
// Persists across resetFileSymbols() so exported arrays are visible to importers.
|
|
103
|
-
sharedVariableTable = new
|
|
140
|
+
sharedVariableTable = new ModuleTable(this);
|
|
104
141
|
// Shared (cross-file) table for as-const object maps, `export const LABELS = { … } as const`,
|
|
105
142
|
// so `LABELS.save` and `Object.keys(LABELS)` resolve in importing files.
|
|
106
|
-
sharedObjectMapTable = new
|
|
143
|
+
sharedObjectMapTable = new ModuleTable(this);
|
|
107
144
|
// Shared (cross-file) table for type aliases — populated alongside typeAliasTable.
|
|
108
145
|
// Persists across resetFileSymbols() so exported type aliases are visible to importers.
|
|
109
|
-
sharedTypeAliasTable = new
|
|
146
|
+
sharedTypeAliasTable = new ModuleTable(this);
|
|
110
147
|
// Shared (cross-file) table for function return-value sets. Populated from
|
|
111
148
|
// both explicit return-type annotations and body-inferred return values so
|
|
112
149
|
// that `t(fn())` / `const x = fn(); t(\`...${x}...\`)` work across files.
|
|
113
150
|
// Persists across resetFileSymbols() just like the other shared tables.
|
|
114
|
-
sharedFunctionReturnTable = new
|
|
151
|
+
sharedFunctionReturnTable = new ModuleTable(this);
|
|
115
152
|
// Temporary per-scope variable overrides, used to inject .map() / .forEach()
|
|
116
153
|
// callback parameters while the callback body is being walked.
|
|
117
154
|
temporaryVariables = new Map();
|
|
118
155
|
// Shared (cross-file) table for object-shaped types: interfaces and object
|
|
119
156
|
// type aliases. Maps typeName -> { memberName: possible string values }.
|
|
120
157
|
// e.g. `interface IProps { size: ChangeType }` -> { IProps: { size: ['all','next'] } }
|
|
121
|
-
objectTypeTable = new
|
|
158
|
+
objectTypeTable = new ModuleTable(this);
|
|
122
159
|
// Raw TS member nodes of local interfaces / object type aliases, keyed by type name.
|
|
123
|
-
objectTypeMembersRaw = new
|
|
160
|
+
objectTypeMembersRaw = new ModuleTable(this);
|
|
124
161
|
// Temporary per-scope bindings for identifiers holding an object-shaped type,
|
|
125
162
|
// e.g. `function f(props: IProps)` -> { props: { size: ['all','next'] } }.
|
|
126
163
|
temporaryObjectVariables = new Map();
|
|
@@ -137,12 +174,12 @@ class ExpressionResolver {
|
|
|
137
174
|
// members are declared under their own names, so `Types.COLORS` resolves as `COLORS`.
|
|
138
175
|
sharedNamespaceNames = new Set();
|
|
139
176
|
// Type parameters of generic object types, e.g. `type Base<T> = { type: T }`.
|
|
140
|
-
objectTypeParams = new
|
|
177
|
+
objectTypeParams = new ModuleTable(this);
|
|
141
178
|
// Values bound to type parameters while a generic type is being resolved.
|
|
142
179
|
typeParamBindings = new Map();
|
|
143
180
|
// Shared (cross-file) member maps of functions returning an object type,
|
|
144
181
|
// e.g. `const getAnimal = (): Animal => …` -> { getAnimal: { type: ['DUCK', 'DOG'] } }
|
|
145
|
-
sharedFunctionReturnMembers = new
|
|
182
|
+
sharedFunctionReturnMembers = new ModuleTable(this);
|
|
146
183
|
// Per-file identifiers holding an object type, from their annotation or from the
|
|
147
184
|
// function they were initialised by: `const animal = getAnimal()` -> { animal: { type: [...] } }
|
|
148
185
|
objectVariables = new Map();
|
|
@@ -157,9 +194,88 @@ class ExpressionResolver {
|
|
|
157
194
|
// this many levels below a declared or indexed type, so recursive types stay small
|
|
158
195
|
// (`extract.maxTypeDepth`).
|
|
159
196
|
maxMemberDepth = 5;
|
|
197
|
+
// The module being read (its path without extension), and where each module gets its
|
|
198
|
+
// names from (see ModuleTable)
|
|
199
|
+
currentModule;
|
|
200
|
+
knownModules = new Set();
|
|
201
|
+
// module -> local name -> { from: the import's resolved path, name: the declared name }
|
|
202
|
+
fileImports = new Map();
|
|
203
|
+
// module -> namespace import's local name -> the import's resolved path
|
|
204
|
+
fileNamespaces = new Map();
|
|
205
|
+
// tsconfig `paths`, `@api` -> `/abs/src/api`
|
|
206
|
+
pathAliases = {};
|
|
160
207
|
constructor(hooks) {
|
|
161
208
|
this.hooks = hooks;
|
|
162
209
|
}
|
|
210
|
+
setCurrentFile(file) {
|
|
211
|
+
this.currentModule = moduleKey(resolve(file));
|
|
212
|
+
this.knownModules.add(this.currentModule);
|
|
213
|
+
}
|
|
214
|
+
// `./api/github-api` / `@api/github-api` imported in the current file -> its path, or undefined
|
|
215
|
+
// for a package or anything else that isn't a file of this project
|
|
216
|
+
importPath(source) {
|
|
217
|
+
if (!this.currentModule)
|
|
218
|
+
return undefined;
|
|
219
|
+
if (source.startsWith('.'))
|
|
220
|
+
return moduleKey(resolve(dirname(this.currentModule), source));
|
|
221
|
+
for (const [alias, path] of Object.entries(this.pathAliases)) {
|
|
222
|
+
if (source === alias || source.startsWith(`${alias}/`))
|
|
223
|
+
return moduleKey(resolve(path, `.${source.slice(alias.length)}`));
|
|
224
|
+
}
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
227
|
+
// The scanned module an import path points to: the file itself or its `index`
|
|
228
|
+
moduleOf(path) {
|
|
229
|
+
return [path, `${path}/index`].find(m => this.knownModules.has(m));
|
|
230
|
+
}
|
|
231
|
+
// ModuleTable: the keys `name` read in the current file may be stored under, most specific first
|
|
232
|
+
keysOf(name) {
|
|
233
|
+
if (name.includes('#'))
|
|
234
|
+
return [name];
|
|
235
|
+
if (!this.currentModule)
|
|
236
|
+
return [];
|
|
237
|
+
const keys = [];
|
|
238
|
+
const imported = this.fileImports.get(this.currentModule)?.get(name);
|
|
239
|
+
const module = imported && this.moduleOf(imported.from);
|
|
240
|
+
if (module)
|
|
241
|
+
keys.push(`${module}#${imported.name}`);
|
|
242
|
+
keys.push(`${this.currentModule}#${name}`);
|
|
243
|
+
return keys;
|
|
244
|
+
}
|
|
245
|
+
// ModuleTable: the key a declaration made in the current file is also stored under
|
|
246
|
+
declaringKey(name) {
|
|
247
|
+
return this.currentModule && !name.includes('#') ? `${this.currentModule}#${name}` : undefined;
|
|
248
|
+
}
|
|
249
|
+
// Replays run after every file was read: run each in the file it was recorded in
|
|
250
|
+
inCurrentFile(fn) {
|
|
251
|
+
const module = this.currentModule;
|
|
252
|
+
return () => {
|
|
253
|
+
const saved = this.currentModule;
|
|
254
|
+
this.currentModule = module;
|
|
255
|
+
try {
|
|
256
|
+
fn();
|
|
257
|
+
}
|
|
258
|
+
finally {
|
|
259
|
+
this.currentModule = saved;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* `Color` / `Types.Color` / `NS.Inner.Color` -> 'Color'. Declarations are looked up by their
|
|
265
|
+
* own name, so a qualified name resolves by its last part, whatever namespace holds it, and
|
|
266
|
+
* through a namespace import of a module (`GH.components`) by that module's declaration.
|
|
267
|
+
*/
|
|
268
|
+
typeRefName(type) {
|
|
269
|
+
const typeName = type?.typeName;
|
|
270
|
+
if (typeName?.type === 'Identifier')
|
|
271
|
+
return typeName.value;
|
|
272
|
+
if (typeName?.type !== 'TsQualifiedName')
|
|
273
|
+
return undefined;
|
|
274
|
+
const name = typeName.right?.value;
|
|
275
|
+
const from = typeName.left?.type === 'Identifier' && this.currentModule ? this.fileNamespaces.get(this.currentModule)?.get(typeName.left.value) : undefined;
|
|
276
|
+
const module = from && this.moduleOf(from);
|
|
277
|
+
return module && name ? `${module}#${name}` : name;
|
|
278
|
+
}
|
|
163
279
|
/**
|
|
164
280
|
* Clear per-file captured variables. Enums / shared maps are kept.
|
|
165
281
|
*/
|
|
@@ -179,6 +295,8 @@ class ExpressionResolver {
|
|
|
179
295
|
*/
|
|
180
296
|
finishPreScan() {
|
|
181
297
|
this.resetFileSymbols();
|
|
298
|
+
// Mirroring onto import aliases writes bare names only; each replay restores its own file
|
|
299
|
+
this.currentModule = undefined;
|
|
182
300
|
// ponytail: each round fixes one more link of a chain declared against file order; 10 is plenty
|
|
183
301
|
for (let round = 0; round < 10; round++) {
|
|
184
302
|
this.applyImportAliases();
|
|
@@ -402,7 +520,7 @@ class ExpressionResolver {
|
|
|
402
520
|
if (!tsType)
|
|
403
521
|
return;
|
|
404
522
|
if (this.recording)
|
|
405
|
-
this.replays.push(() => this.captureTypeAliasDeclaration(node));
|
|
523
|
+
this.replays.push(this.inCurrentFile(() => this.captureTypeAliasDeclaration(node)));
|
|
406
524
|
const params = node.typeParams?.parameters;
|
|
407
525
|
// `type IProps = { size: ChangeType }` — object shape, not a string union.
|
|
408
526
|
if (tsType.type === 'TsTypeLiteral') {
|
|
@@ -439,18 +557,31 @@ class ExpressionResolver {
|
|
|
439
557
|
*/
|
|
440
558
|
captureImportDeclaration(node) {
|
|
441
559
|
try {
|
|
560
|
+
const from = node?.type === 'ImportDeclaration' && typeof node.source?.value === 'string' ? this.importPath(node.source.value) : undefined;
|
|
561
|
+
const imports = from && this.currentModule ? (this.fileImports.get(this.currentModule) ?? new Map()) : undefined;
|
|
562
|
+
if (imports)
|
|
563
|
+
this.fileImports.set(this.currentModule, imports);
|
|
442
564
|
for (const spec of node?.specifiers ?? []) {
|
|
443
565
|
// `import * as Types from …` / `export * as Types from …`
|
|
444
|
-
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value)
|
|
566
|
+
if (spec?.type === 'ImportNamespaceSpecifier' && spec.local?.value) {
|
|
445
567
|
this.sharedNamespaceNames.add(spec.local.value);
|
|
568
|
+
if (from) {
|
|
569
|
+
if (!this.fileNamespaces.has(this.currentModule))
|
|
570
|
+
this.fileNamespaces.set(this.currentModule, new Map());
|
|
571
|
+
this.fileNamespaces.get(this.currentModule).set(spec.local.value, from);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
446
574
|
if (spec?.type === 'ExportNamespaceSpecifier' && spec.name?.value)
|
|
447
575
|
this.sharedNamespaceNames.add(spec.name.value);
|
|
448
576
|
if (spec?.type !== 'ImportSpecifier')
|
|
449
577
|
continue;
|
|
450
578
|
const local = spec.local?.value;
|
|
451
|
-
const imported = spec.imported?.value;
|
|
579
|
+
const imported = spec.imported?.value ?? local;
|
|
452
580
|
if (local && imported && local !== imported)
|
|
453
581
|
this.sharedImportAliases.set(local, imported);
|
|
582
|
+
// `import { components as githubComponents } from './github-api'` → that module's `components`
|
|
583
|
+
if (local && imported && imports)
|
|
584
|
+
imports.set(local, { from: from, name: imported });
|
|
454
585
|
}
|
|
455
586
|
}
|
|
456
587
|
catch {
|
|
@@ -467,7 +598,10 @@ class ExpressionResolver {
|
|
|
467
598
|
const ns = expr.object.value;
|
|
468
599
|
if (!this.sharedNamespaceNames.has(this.sharedImportAliases.get(ns) ?? ns))
|
|
469
600
|
return expr;
|
|
470
|
-
|
|
601
|
+
// `GH.components` with `import * as GH from './github-api'` → that module's `components`
|
|
602
|
+
const from = this.currentModule ? this.fileNamespaces.get(this.currentModule)?.get(ns) : undefined;
|
|
603
|
+
const module = from && this.moduleOf(from);
|
|
604
|
+
return { type: 'Identifier', value: module ? `${module}#${expr.property.value}` : expr.property.value, span: expr.span };
|
|
471
605
|
}
|
|
472
606
|
// The variable a `typeof` names: `typeof LABELS`, or `typeof Types.LABELS` through a namespace import
|
|
473
607
|
typeQueryName(exprName) {
|
|
@@ -517,7 +651,7 @@ class ExpressionResolver {
|
|
|
517
651
|
if (!name)
|
|
518
652
|
return;
|
|
519
653
|
if (this.recording)
|
|
520
|
-
this.replays.push(() => this.captureInterfaceDeclaration(node));
|
|
654
|
+
this.replays.push(this.inCurrentFile(() => this.captureInterfaceDeclaration(node)));
|
|
521
655
|
const params = node.typeParams?.parameters;
|
|
522
656
|
if (!this.replaying && Array.isArray(node?.body?.body))
|
|
523
657
|
this.setObjectTypeRaw(name, node.body.body, params);
|
|
@@ -656,7 +790,7 @@ class ExpressionResolver {
|
|
|
656
790
|
}
|
|
657
791
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
658
792
|
}
|
|
659
|
-
const name = tsType.type === 'TsTypeReference' ? typeRefName(tsType) : undefined;
|
|
793
|
+
const name = tsType.type === 'TsTypeReference' ? this.typeRefName(tsType) : undefined;
|
|
660
794
|
if (name) {
|
|
661
795
|
// `Base<'DUCK'>` → instantiate the generic type's members with the argument
|
|
662
796
|
const args = tsType.typeParams?.params;
|
|
@@ -711,7 +845,7 @@ class ExpressionResolver {
|
|
|
711
845
|
obj = obj.typeAnnotation;
|
|
712
846
|
if (obj?.type === 'TsIndexedAccessType')
|
|
713
847
|
obj = this.indexedAccessTarget(obj);
|
|
714
|
-
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? typeRefName(obj) : undefined;
|
|
848
|
+
const name = obj?.type === 'TsTypeReference' && !obj.typeParams ? this.typeRefName(obj) : undefined;
|
|
715
849
|
const members = obj?.type === 'TsTypeLiteral'
|
|
716
850
|
? obj.members
|
|
717
851
|
: name && !this.objectTypeParams.has(name) ? this.objectTypeMembersRaw.get(name) : undefined;
|
|
@@ -869,7 +1003,7 @@ class ExpressionResolver {
|
|
|
869
1003
|
};
|
|
870
1004
|
store();
|
|
871
1005
|
if (this.recording && (returnType || refs.length > 0))
|
|
872
|
-
this.replays.push(store);
|
|
1006
|
+
this.replays.push(this.inCurrentFile(store));
|
|
873
1007
|
}
|
|
874
1008
|
/**
|
|
875
1009
|
* Collect a function's return expressions (the expression body of an arrow
|
|
@@ -1330,7 +1464,7 @@ class ExpressionResolver {
|
|
|
1330
1464
|
// where `type ChangeType = 'all' | 'next' | 'this'` was captured earlier.
|
|
1331
1465
|
// Also handles `declare const d: SomeEnum` where SomeEnum is a TS enum with string values.
|
|
1332
1466
|
if (type.type === 'TsTypeReference') {
|
|
1333
|
-
const typeName = typeRefName(type);
|
|
1467
|
+
const typeName = this.typeRefName(type);
|
|
1334
1468
|
if (typeName) {
|
|
1335
1469
|
// Inside a generic type: the parameter's argument, default or constraint
|
|
1336
1470
|
const bound = this.typeParamBindings.get(typeName);
|
|
@@ -1478,4 +1612,4 @@ class ExpressionResolver {
|
|
|
1478
1612
|
}
|
|
1479
1613
|
}
|
|
1480
1614
|
|
|
1481
|
-
export { ExpressionResolver, nestedMembers
|
|
1615
|
+
export { ExpressionResolver, nestedMembers };
|
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { defineConfig } from './config.js';
|
|
|
2
2
|
export { extract, runExtractor } from './extractor/core/extractor.js';
|
|
3
3
|
export { findKeys } from './extractor/core/key-finder.js';
|
|
4
4
|
export { getTranslations } from './extractor/core/translation-manager.js';
|
|
5
|
+
import 'node:path';
|
|
5
6
|
import 'node:module';
|
|
6
7
|
export { recommendedAcceptedAttributes, recommendedAcceptedTags, runLinter } from './linter.js';
|
|
7
8
|
export { runSyncer } from './syncer.js';
|
|
@@ -13,5 +14,4 @@ import './utils/jsx-attributes.js';
|
|
|
13
14
|
import 'magic-string';
|
|
14
15
|
export { runLocalize } from './localize/localize.js';
|
|
15
16
|
import 'node:fs/promises';
|
|
16
|
-
import 'node:path';
|
|
17
17
|
export { AGENT_PROMPT } from './localize/agent-prompt.js';
|
|
@@ -6,8 +6,8 @@ import { glob } from 'glob';
|
|
|
6
6
|
import { loadConfig, ensureConfig } from '../config.js';
|
|
7
7
|
import { detectConfig } from '../heuristic-config.js';
|
|
8
8
|
import { runExtractor } from '../extractor/core/extractor.js';
|
|
9
|
-
import 'node:module';
|
|
10
9
|
import 'node:path';
|
|
10
|
+
import 'node:module';
|
|
11
11
|
import { getNestedKeys, getNestedValue } from '../utils/nested-object.js';
|
|
12
12
|
import 'jiti';
|
|
13
13
|
import '@croct/json5-parser';
|
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":["../../../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,EAAiB,MAAM,mCAAmC,CAAA;AAuCrF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,M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EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5D;;OAEG;IACI,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAMxD;;;;;;OAMG;IACI,cAAc,IAAK,MAAM;IAIhC;;OAEG;IACI,cAAc,IAAK,MAAM;CAGjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-finder.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/key-finder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAmB,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"key-finder.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/key-finder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAmB,MAAM,gBAAgB,CAAA;AAQjG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,MAAM,GAAE,MAA4B,EACpC,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CA8FxG"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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;
|
|
5
4
|
export declare class ExpressionResolver {
|
|
6
5
|
private hooks;
|
|
7
6
|
private variableTable;
|
|
@@ -28,7 +27,24 @@ export declare class ExpressionResolver {
|
|
|
28
27
|
private grew;
|
|
29
28
|
private memberDepth;
|
|
30
29
|
maxMemberDepth: number;
|
|
30
|
+
private currentModule;
|
|
31
|
+
private knownModules;
|
|
32
|
+
private fileImports;
|
|
33
|
+
private fileNamespaces;
|
|
34
|
+
pathAliases: Record<string, string>;
|
|
31
35
|
constructor(hooks: ASTVisitorHooks);
|
|
36
|
+
setCurrentFile(file: string): void;
|
|
37
|
+
private importPath;
|
|
38
|
+
private moduleOf;
|
|
39
|
+
keysOf(name: string): string[];
|
|
40
|
+
declaringKey(name: string): string | undefined;
|
|
41
|
+
private inCurrentFile;
|
|
42
|
+
/**
|
|
43
|
+
* `Color` / `Types.Color` / `NS.Inner.Color` -> 'Color'. Declarations are looked up by their
|
|
44
|
+
* own name, so a qualified name resolves by its last part, whatever namespace holds it, and
|
|
45
|
+
* through a namespace import of a module (`GH.components`) by that module's declaration.
|
|
46
|
+
*/
|
|
47
|
+
typeRefName(type: any): string | undefined;
|
|
32
48
|
/**
|
|
33
49
|
* Clear per-file captured variables. Enums / shared maps are kept.
|
|
34
50
|
*/
|
|
@@ -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;
|
|
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;AA2BrD,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,MAAM,KAA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