i18next-cli 1.74.0 → 1.74.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/README.md +19 -0
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/extractor/core/extractor.js +38 -0
- package/dist/cjs/extractor/core/key-finder.js +4 -1
- package/dist/cjs/extractor/parsers/ast-utils.js +21 -3
- package/dist/cjs/extractor/parsers/call-expression-handler.js +4 -4
- package/dist/cjs/extractor/parsers/expression-resolver.js +4 -0
- package/dist/cjs/extractor/parsers/scope-manager.js +1 -0
- package/dist/esm/cli.js +1 -1
- package/dist/esm/extractor/core/extractor.js +38 -0
- package/dist/esm/extractor/core/key-finder.js +4 -1
- package/dist/esm/extractor/parsers/ast-utils.js +21 -4
- package/dist/esm/extractor/parsers/call-expression-handler.js +5 -5
- package/dist/esm/extractor/parsers/expression-resolver.js +4 -0
- package/dist/esm/extractor/parsers/scope-manager.js +1 -0
- package/package.json +17 -17
- package/types/extractor/core/extractor.d.ts.map +1 -1
- package/types/extractor/parsers/ast-utils.d.ts +12 -0
- package/types/extractor/parsers/ast-utils.d.ts.map +1 -1
- package/types/extractor/parsers/expression-resolver.d.ts.map +1 -1
- package/types/extractor/parsers/scope-manager.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1528,6 +1528,25 @@ export default defineConfig({
|
|
|
1528
1528
|
The same applies to a package that ships translatable sources: glob its files and
|
|
1529
1529
|
their keys are extracted like your own.
|
|
1530
1530
|
|
|
1531
|
+
> **Careful with dependency types:** keys derived from them change when the dependency
|
|
1532
|
+
> does. If `ResourceStatus` is an enum today and widens to `string` in the next release,
|
|
1533
|
+
> the keys stop resolving and `removeUnusedKeys` (on by default) deletes them, during an
|
|
1534
|
+
> `npm update` rather than in a diff you wrote. Consider copying the type into your own
|
|
1535
|
+
> source instead and guarding it against drift, so a mismatch fails typecheck in CI
|
|
1536
|
+
> rather than silently emptying a locale file:
|
|
1537
|
+
>
|
|
1538
|
+
> ```typescript
|
|
1539
|
+
> type Equals<A, B> =
|
|
1540
|
+
> (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;
|
|
1541
|
+
> type Assert<T extends true> = T;
|
|
1542
|
+
>
|
|
1543
|
+
> // drop the `${}` when the upstream type is a string union rather than an enum
|
|
1544
|
+
> type _driftGuard = Assert<Equals<LocalStatus, `${ResourceStatus}`>>;
|
|
1545
|
+
> ```
|
|
1546
|
+
>
|
|
1547
|
+
> If you do read from `node_modules`, `preservePatterns` keeps the already-translated
|
|
1548
|
+
> entries alive even when resolution stops producing them.
|
|
1549
|
+
|
|
1531
1550
|
Only keys that are **truly runtime-dynamic** (e.g. built from API data) cannot
|
|
1532
1551
|
be statically resolved by any tool. For those, use `preservePatterns` to keep
|
|
1533
1552
|
the existing entries in your translation files:
|
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.74.
|
|
40
|
+
.version('1.74.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)');
|
|
@@ -132,6 +132,39 @@ function isExtExplicitlyInInputPatterns(ext, input) {
|
|
|
132
132
|
return new RegExp(`[{,*]${escaped}[},*]|[.]${escaped}(?:[^a-z]|$)`).test(p);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
+
const extractionSiteRegexes = new WeakMap();
|
|
136
|
+
/**
|
|
137
|
+
* Cheap textual test for anything the extraction walk can turn into a key: a call
|
|
138
|
+
* to a configured function (`t(`, `i18n.t(`, `t?.(`, `t<Ns>(`, `new TranslatedError(`, a
|
|
139
|
+
* `t(` comment), or a mention of what binds a translation function under any name
|
|
140
|
+
* (useTranslation-style hooks, getFixedT, TFunction params) or of a Trans component.
|
|
141
|
+
* A false positive only costs a parse; a false negative would drop keys.
|
|
142
|
+
*
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
function mayContainExtractionSite(code, config) {
|
|
146
|
+
let re = extractionSiteRegexes.get(config);
|
|
147
|
+
if (!re) {
|
|
148
|
+
const calls = new Set(['t']);
|
|
149
|
+
const names = new Set(['getFixedT', 'TFunction']);
|
|
150
|
+
for (const fn of config.extract.functions || ['t', '*.t']) {
|
|
151
|
+
// 'tProps.*' matches any `tProps.<x>(` call, so the prefix is what to look for
|
|
152
|
+
if (fn.endsWith('.*'))
|
|
153
|
+
names.add(fn.slice(0, -2).split('.').pop());
|
|
154
|
+
else
|
|
155
|
+
calls.add(fn.split('.').pop());
|
|
156
|
+
}
|
|
157
|
+
for (const hook of config.extract.useTranslationNames || ['useTranslation', 'getT', 'useT']) {
|
|
158
|
+
names.add(typeof hook === 'string' ? hook : hook.name);
|
|
159
|
+
}
|
|
160
|
+
for (const component of config.extract.transComponents || ['Trans'])
|
|
161
|
+
names.add(component.split('.').pop());
|
|
162
|
+
const alt = (set) => [...set].map(s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|');
|
|
163
|
+
re = new RegExp(`(?<!\\w)(?:(?:${alt(calls)})\\s*(?:\\?\\.\\s*)?[(<]|(?:${alt(names)})(?![\\w$]))`);
|
|
164
|
+
extractionSiteRegexes.set(config, re);
|
|
165
|
+
}
|
|
166
|
+
return re.test(code);
|
|
167
|
+
}
|
|
135
168
|
/**
|
|
136
169
|
* Processes an individual source file for translation key extraction.
|
|
137
170
|
*
|
|
@@ -197,6 +230,11 @@ async function processFile(file, plugins, astVisitors, pluginContext, config, lo
|
|
|
197
230
|
}
|
|
198
231
|
return;
|
|
199
232
|
}
|
|
233
|
+
// A file that mentions no translation function, hook or component cannot yield
|
|
234
|
+
// a key, so skip the parse and walk (#297). The pre-scan has already harvested
|
|
235
|
+
// its constants and types for the other files. onVisitNode plugins see every node.
|
|
236
|
+
if (!plugins.some(p => p.onVisitNode) && !mayContainExtractionSite(code, config))
|
|
237
|
+
return;
|
|
200
238
|
// When a plugin transformed a non-native file, always use tsx so SWC can
|
|
201
239
|
// handle TypeScript syntax that the plugin may have extracted from the file.
|
|
202
240
|
const effectiveExt = (!isNativeExt && wasTransformedByPlugin) ? '.tsx' : fileExt;
|
|
@@ -140,13 +140,16 @@ async function processSourceFiles(config) {
|
|
|
140
140
|
const userIgnore = Array.isArray(config.extract.ignore)
|
|
141
141
|
? config.extract.ignore
|
|
142
142
|
: config.extract.ignore ? [config.extract.ignore] : [];
|
|
143
|
-
|
|
143
|
+
const files = await glob.glob(config.extract.input, {
|
|
144
144
|
// Combine default ignore patterns with user-configured ones
|
|
145
145
|
ignore: [...defaultIgnore, ...userIgnore],
|
|
146
146
|
cwd: process.cwd(),
|
|
147
147
|
// A directory named e.g. `abc.tsx` matches the input globs
|
|
148
148
|
nodir: true,
|
|
149
149
|
});
|
|
150
|
+
// glob's order is not stable across runs, and when two call sites give one key
|
|
151
|
+
// different defaults the file visited first wins, so sort for reproducible output (#296)
|
|
152
|
+
return files.sort();
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
exports.findKeys = findKeys;
|
|
@@ -286,6 +286,23 @@ function collectIgnoredLineRanges(ast, code) {
|
|
|
286
286
|
}
|
|
287
287
|
return ignored;
|
|
288
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Strips redundant parentheses from an expression (#295).
|
|
291
|
+
*
|
|
292
|
+
* SWC keeps them as `ParenthesisExpression` nodes, so any code that switches on
|
|
293
|
+
* an expression's type sees the wrapper instead of the literal/object inside.
|
|
294
|
+
* These parens are easy to hit by accident: Prettier adds them around the
|
|
295
|
+
* longer branch of a ternary that doesn't fit on one line.
|
|
296
|
+
*
|
|
297
|
+
* Only parens are removed; TS assertions (`as`, `satisfies`) carry type
|
|
298
|
+
* information some callers need and are left alone.
|
|
299
|
+
*/
|
|
300
|
+
function unwrapParens(expr) {
|
|
301
|
+
let current = expr;
|
|
302
|
+
while (current?.type === 'ParenthesisExpression')
|
|
303
|
+
current = current.expression;
|
|
304
|
+
return current;
|
|
305
|
+
}
|
|
289
306
|
/**
|
|
290
307
|
* Finds and returns the full property node (KeyValueProperty) for the given
|
|
291
308
|
* property name from an ObjectExpression.
|
|
@@ -321,9 +338,9 @@ function getObjectProperty(object, propName) {
|
|
|
321
338
|
* @returns The matching value node if found, otherwise undefined.
|
|
322
339
|
*/
|
|
323
340
|
function getObjectPropValueExpression(object, propName) {
|
|
324
|
-
return getObjectProperty(object, propName)?.value ?? (object.properties).find(
|
|
341
|
+
return unwrapParens(getObjectProperty(object, propName)?.value ?? (object.properties).find(
|
|
325
342
|
// For shorthand properties like { ns }.
|
|
326
|
-
(p) => p.type === 'Identifier' && p.value === propName);
|
|
343
|
+
(p) => p.type === 'Identifier' && p.value === propName));
|
|
327
344
|
}
|
|
328
345
|
/**
|
|
329
346
|
* Checks if the given template literal has no interpolation expressions
|
|
@@ -353,7 +370,7 @@ function isSimpleTemplateLiteral(literal) {
|
|
|
353
370
|
function getObjectPropValue(object, propName, identifierResolver, expressionResolver) {
|
|
354
371
|
const prop = getObjectProperty(object, propName);
|
|
355
372
|
if (prop?.type === 'KeyValueProperty') {
|
|
356
|
-
const val = prop.value;
|
|
373
|
+
const val = unwrapParens(prop.value);
|
|
357
374
|
if (val.type === 'StringLiteral')
|
|
358
375
|
return val.value;
|
|
359
376
|
if (val.type === 'Identifier' && identifierResolver)
|
|
@@ -380,3 +397,4 @@ exports.isSimpleTemplateLiteral = isSimpleTemplateLiteral;
|
|
|
380
397
|
exports.lineColumnFromOffset = lineColumnFromOffset;
|
|
381
398
|
exports.normalizeASTSpans = normalizeASTSpans;
|
|
382
399
|
exports.normalizeSpansToCharIndices = normalizeSpansToCharIndices;
|
|
400
|
+
exports.unwrapParens = unwrapParens;
|
|
@@ -53,7 +53,7 @@ class CallExpressionHandler {
|
|
|
53
53
|
// For call / new expressions, prefer the first argument's span
|
|
54
54
|
if ((node.type === 'CallExpression' || node.type === 'NewExpression') &&
|
|
55
55
|
node.arguments?.length > 0) {
|
|
56
|
-
const firstArg = node.arguments[0].expression;
|
|
56
|
+
const firstArg = astUtils.unwrapParens(node.arguments[0].expression);
|
|
57
57
|
if (firstArg?.span && typeof firstArg.span.start === 'number') {
|
|
58
58
|
return astUtils.lineColumnFromOffset(this.getCurrentCode(), firstArg.span.start);
|
|
59
59
|
}
|
|
@@ -127,7 +127,7 @@ class CallExpressionHandler {
|
|
|
127
127
|
let defaultValue;
|
|
128
128
|
let options;
|
|
129
129
|
if (node.arguments.length > 1) {
|
|
130
|
-
const arg2 = node.arguments[1].expression;
|
|
130
|
+
const arg2 = astUtils.unwrapParens(node.arguments[1].expression);
|
|
131
131
|
if (arg2.type === 'ObjectExpression') {
|
|
132
132
|
options = arg2;
|
|
133
133
|
}
|
|
@@ -142,7 +142,7 @@ class CallExpressionHandler {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
if (node.arguments.length > 2) {
|
|
145
|
-
const arg3 = node.arguments[2].expression;
|
|
145
|
+
const arg3 = astUtils.unwrapParens(node.arguments[2].expression);
|
|
146
146
|
if (arg3.type === 'ObjectExpression') {
|
|
147
147
|
options = arg3;
|
|
148
148
|
}
|
|
@@ -573,7 +573,7 @@ class CallExpressionHandler {
|
|
|
573
573
|
* @returns An object containing the keys to process and a flag indicating if the selector API is used
|
|
574
574
|
*/
|
|
575
575
|
handleCallExpressionArgument(node, argIndex, scopeInfo) {
|
|
576
|
-
const firstArg = node.arguments[argIndex].expression;
|
|
576
|
+
const firstArg = astUtils.unwrapParens(node.arguments[argIndex].expression);
|
|
577
577
|
const keysToProcess = [];
|
|
578
578
|
// Mirror of keysToProcess BEFORE selector-ns rewriting. For non-selector
|
|
579
579
|
// calls and selector calls that don't trigger a rewrite, both arrays hold
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var astUtils = require('./ast-utils.js');
|
|
4
|
+
|
|
3
5
|
class ExpressionResolver {
|
|
4
6
|
hooks;
|
|
5
7
|
// Per-file symbol table for statically analyzable variables.
|
|
@@ -714,6 +716,8 @@ class ExpressionResolver {
|
|
|
714
716
|
* @returns An array of possible string values that the expression may produce.
|
|
715
717
|
*/
|
|
716
718
|
resolvePossibleStringValuesFromExpression(expression, returnEmptyStrings = false) {
|
|
719
|
+
// `t(('key'))` / `t(cond ? 'a' : ('b'))`: parens are just a wrapper node (#295).
|
|
720
|
+
expression = astUtils.unwrapParens(expression);
|
|
717
721
|
// Support selector-style arrow functions used by the selector API:
|
|
718
722
|
// e.g. ($) => $.path.to.key -> ['path.to.key']
|
|
719
723
|
// e.g. ($) => $.table.columns[field] -> ['table.columns.name', 'table.columns.age']
|
|
@@ -40,6 +40,7 @@ class ScopeManager {
|
|
|
40
40
|
case 'TsConstAssertion':
|
|
41
41
|
case 'TsAsExpression':
|
|
42
42
|
case 'TsSatisfiesExpression':
|
|
43
|
+
case 'ParenthesisExpression': // `useTranslation(('ns'))` (#295)
|
|
43
44
|
return ScopeManager.unwrapTsExpression(node.expression);
|
|
44
45
|
default:
|
|
45
46
|
return node;
|
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.74.
|
|
34
|
+
.version('1.74.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)');
|
|
@@ -130,6 +130,39 @@ function isExtExplicitlyInInputPatterns(ext, input) {
|
|
|
130
130
|
return new RegExp(`[{,*]${escaped}[},*]|[.]${escaped}(?:[^a-z]|$)`).test(p);
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
const extractionSiteRegexes = new WeakMap();
|
|
134
|
+
/**
|
|
135
|
+
* Cheap textual test for anything the extraction walk can turn into a key: a call
|
|
136
|
+
* to a configured function (`t(`, `i18n.t(`, `t?.(`, `t<Ns>(`, `new TranslatedError(`, a
|
|
137
|
+
* `t(` comment), or a mention of what binds a translation function under any name
|
|
138
|
+
* (useTranslation-style hooks, getFixedT, TFunction params) or of a Trans component.
|
|
139
|
+
* A false positive only costs a parse; a false negative would drop keys.
|
|
140
|
+
*
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
function mayContainExtractionSite(code, config) {
|
|
144
|
+
let re = extractionSiteRegexes.get(config);
|
|
145
|
+
if (!re) {
|
|
146
|
+
const calls = new Set(['t']);
|
|
147
|
+
const names = new Set(['getFixedT', 'TFunction']);
|
|
148
|
+
for (const fn of config.extract.functions || ['t', '*.t']) {
|
|
149
|
+
// 'tProps.*' matches any `tProps.<x>(` call, so the prefix is what to look for
|
|
150
|
+
if (fn.endsWith('.*'))
|
|
151
|
+
names.add(fn.slice(0, -2).split('.').pop());
|
|
152
|
+
else
|
|
153
|
+
calls.add(fn.split('.').pop());
|
|
154
|
+
}
|
|
155
|
+
for (const hook of config.extract.useTranslationNames || ['useTranslation', 'getT', 'useT']) {
|
|
156
|
+
names.add(typeof hook === 'string' ? hook : hook.name);
|
|
157
|
+
}
|
|
158
|
+
for (const component of config.extract.transComponents || ['Trans'])
|
|
159
|
+
names.add(component.split('.').pop());
|
|
160
|
+
const alt = (set) => [...set].map(s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|');
|
|
161
|
+
re = new RegExp(`(?<!\\w)(?:(?:${alt(calls)})\\s*(?:\\?\\.\\s*)?[(<]|(?:${alt(names)})(?![\\w$]))`);
|
|
162
|
+
extractionSiteRegexes.set(config, re);
|
|
163
|
+
}
|
|
164
|
+
return re.test(code);
|
|
165
|
+
}
|
|
133
166
|
/**
|
|
134
167
|
* Processes an individual source file for translation key extraction.
|
|
135
168
|
*
|
|
@@ -195,6 +228,11 @@ async function processFile(file, plugins, astVisitors, pluginContext, config, lo
|
|
|
195
228
|
}
|
|
196
229
|
return;
|
|
197
230
|
}
|
|
231
|
+
// A file that mentions no translation function, hook or component cannot yield
|
|
232
|
+
// a key, so skip the parse and walk (#297). The pre-scan has already harvested
|
|
233
|
+
// its constants and types for the other files. onVisitNode plugins see every node.
|
|
234
|
+
if (!plugins.some(p => p.onVisitNode) && !mayContainExtractionSite(code, config))
|
|
235
|
+
return;
|
|
198
236
|
// When a plugin transformed a non-native file, always use tsx so SWC can
|
|
199
237
|
// handle TypeScript syntax that the plugin may have extracted from the file.
|
|
200
238
|
const effectiveExt = (!isNativeExt && wasTransformedByPlugin) ? '.tsx' : fileExt;
|
|
@@ -138,13 +138,16 @@ async function processSourceFiles(config) {
|
|
|
138
138
|
const userIgnore = Array.isArray(config.extract.ignore)
|
|
139
139
|
? config.extract.ignore
|
|
140
140
|
: config.extract.ignore ? [config.extract.ignore] : [];
|
|
141
|
-
|
|
141
|
+
const files = await glob(config.extract.input, {
|
|
142
142
|
// Combine default ignore patterns with user-configured ones
|
|
143
143
|
ignore: [...defaultIgnore, ...userIgnore],
|
|
144
144
|
cwd: process.cwd(),
|
|
145
145
|
// A directory named e.g. `abc.tsx` matches the input globs
|
|
146
146
|
nodir: true,
|
|
147
147
|
});
|
|
148
|
+
// glob's order is not stable across runs, and when two call sites give one key
|
|
149
|
+
// different defaults the file visited first wins, so sort for reproducible output (#296)
|
|
150
|
+
return files.sort();
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
export { findKeys };
|
|
@@ -284,6 +284,23 @@ function collectIgnoredLineRanges(ast, code) {
|
|
|
284
284
|
}
|
|
285
285
|
return ignored;
|
|
286
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* Strips redundant parentheses from an expression (#295).
|
|
289
|
+
*
|
|
290
|
+
* SWC keeps them as `ParenthesisExpression` nodes, so any code that switches on
|
|
291
|
+
* an expression's type sees the wrapper instead of the literal/object inside.
|
|
292
|
+
* These parens are easy to hit by accident: Prettier adds them around the
|
|
293
|
+
* longer branch of a ternary that doesn't fit on one line.
|
|
294
|
+
*
|
|
295
|
+
* Only parens are removed; TS assertions (`as`, `satisfies`) carry type
|
|
296
|
+
* information some callers need and are left alone.
|
|
297
|
+
*/
|
|
298
|
+
function unwrapParens(expr) {
|
|
299
|
+
let current = expr;
|
|
300
|
+
while (current?.type === 'ParenthesisExpression')
|
|
301
|
+
current = current.expression;
|
|
302
|
+
return current;
|
|
303
|
+
}
|
|
287
304
|
/**
|
|
288
305
|
* Finds and returns the full property node (KeyValueProperty) for the given
|
|
289
306
|
* property name from an ObjectExpression.
|
|
@@ -319,9 +336,9 @@ function getObjectProperty(object, propName) {
|
|
|
319
336
|
* @returns The matching value node if found, otherwise undefined.
|
|
320
337
|
*/
|
|
321
338
|
function getObjectPropValueExpression(object, propName) {
|
|
322
|
-
return getObjectProperty(object, propName)?.value ?? (object.properties).find(
|
|
339
|
+
return unwrapParens(getObjectProperty(object, propName)?.value ?? (object.properties).find(
|
|
323
340
|
// For shorthand properties like { ns }.
|
|
324
|
-
(p) => p.type === 'Identifier' && p.value === propName);
|
|
341
|
+
(p) => p.type === 'Identifier' && p.value === propName));
|
|
325
342
|
}
|
|
326
343
|
/**
|
|
327
344
|
* Checks if the given template literal has no interpolation expressions
|
|
@@ -351,7 +368,7 @@ function isSimpleTemplateLiteral(literal) {
|
|
|
351
368
|
function getObjectPropValue(object, propName, identifierResolver, expressionResolver) {
|
|
352
369
|
const prop = getObjectProperty(object, propName);
|
|
353
370
|
if (prop?.type === 'KeyValueProperty') {
|
|
354
|
-
const val = prop.value;
|
|
371
|
+
const val = unwrapParens(prop.value);
|
|
355
372
|
if (val.type === 'StringLiteral')
|
|
356
373
|
return val.value;
|
|
357
374
|
if (val.type === 'Identifier' && identifierResolver)
|
|
@@ -367,4 +384,4 @@ function getObjectPropValue(object, propName, identifierResolver, expressionReso
|
|
|
367
384
|
return undefined;
|
|
368
385
|
}
|
|
369
386
|
|
|
370
|
-
export { buildByteToCharMap, collectIgnoredLineRanges, convertSpansToCharIndices, findFirstTokenIndex, getObjectPropValue, getObjectPropValueExpression, getObjectProperty, isSimpleTemplateLiteral, lineColumnFromOffset, normalizeASTSpans, normalizeSpansToCharIndices };
|
|
387
|
+
export { buildByteToCharMap, collectIgnoredLineRanges, convertSpansToCharIndices, findFirstTokenIndex, getObjectPropValue, getObjectPropValueExpression, getObjectProperty, isSimpleTemplateLiteral, lineColumnFromOffset, normalizeASTSpans, normalizeSpansToCharIndices, unwrapParens };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { safePluralRules } from '../../utils/plural-rules.js';
|
|
2
2
|
import { parseNestedReferences } from '../../utils/nesting.js';
|
|
3
|
-
import { getObjectPropValue, lineColumnFromOffset, isSimpleTemplateLiteral, getObjectPropValueExpression } from './ast-utils.js';
|
|
3
|
+
import { getObjectPropValue, unwrapParens, lineColumnFromOffset, isSimpleTemplateLiteral, getObjectPropValueExpression } from './ast-utils.js';
|
|
4
4
|
import { matchesFunctionPattern } from '../utils/function-matcher.js';
|
|
5
5
|
|
|
6
6
|
// Helper to escape regex characters
|
|
@@ -51,7 +51,7 @@ class CallExpressionHandler {
|
|
|
51
51
|
// For call / new expressions, prefer the first argument's span
|
|
52
52
|
if ((node.type === 'CallExpression' || node.type === 'NewExpression') &&
|
|
53
53
|
node.arguments?.length > 0) {
|
|
54
|
-
const firstArg = node.arguments[0].expression;
|
|
54
|
+
const firstArg = unwrapParens(node.arguments[0].expression);
|
|
55
55
|
if (firstArg?.span && typeof firstArg.span.start === 'number') {
|
|
56
56
|
return lineColumnFromOffset(this.getCurrentCode(), firstArg.span.start);
|
|
57
57
|
}
|
|
@@ -125,7 +125,7 @@ class CallExpressionHandler {
|
|
|
125
125
|
let defaultValue;
|
|
126
126
|
let options;
|
|
127
127
|
if (node.arguments.length > 1) {
|
|
128
|
-
const arg2 = node.arguments[1].expression;
|
|
128
|
+
const arg2 = unwrapParens(node.arguments[1].expression);
|
|
129
129
|
if (arg2.type === 'ObjectExpression') {
|
|
130
130
|
options = arg2;
|
|
131
131
|
}
|
|
@@ -140,7 +140,7 @@ class CallExpressionHandler {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
if (node.arguments.length > 2) {
|
|
143
|
-
const arg3 = node.arguments[2].expression;
|
|
143
|
+
const arg3 = unwrapParens(node.arguments[2].expression);
|
|
144
144
|
if (arg3.type === 'ObjectExpression') {
|
|
145
145
|
options = arg3;
|
|
146
146
|
}
|
|
@@ -571,7 +571,7 @@ class CallExpressionHandler {
|
|
|
571
571
|
* @returns An object containing the keys to process and a flag indicating if the selector API is used
|
|
572
572
|
*/
|
|
573
573
|
handleCallExpressionArgument(node, argIndex, scopeInfo) {
|
|
574
|
-
const firstArg = node.arguments[argIndex].expression;
|
|
574
|
+
const firstArg = unwrapParens(node.arguments[argIndex].expression);
|
|
575
575
|
const keysToProcess = [];
|
|
576
576
|
// Mirror of keysToProcess BEFORE selector-ns rewriting. For non-selector
|
|
577
577
|
// calls and selector calls that don't trigger a rewrite, both arrays hold
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { unwrapParens } from './ast-utils.js';
|
|
2
|
+
|
|
1
3
|
class ExpressionResolver {
|
|
2
4
|
hooks;
|
|
3
5
|
// Per-file symbol table for statically analyzable variables.
|
|
@@ -712,6 +714,8 @@ class ExpressionResolver {
|
|
|
712
714
|
* @returns An array of possible string values that the expression may produce.
|
|
713
715
|
*/
|
|
714
716
|
resolvePossibleStringValuesFromExpression(expression, returnEmptyStrings = false) {
|
|
717
|
+
// `t(('key'))` / `t(cond ? 'a' : ('b'))`: parens are just a wrapper node (#295).
|
|
718
|
+
expression = unwrapParens(expression);
|
|
715
719
|
// Support selector-style arrow functions used by the selector API:
|
|
716
720
|
// e.g. ($) => $.path.to.key -> ['path.to.key']
|
|
717
721
|
// e.g. ($) => $.table.columns[field] -> ['table.columns.name', 'table.columns.age']
|
|
@@ -38,6 +38,7 @@ class ScopeManager {
|
|
|
38
38
|
case 'TsConstAssertion':
|
|
39
39
|
case 'TsAsExpression':
|
|
40
40
|
case 'TsSatisfiesExpression':
|
|
41
|
+
case 'ParenthesisExpression': // `useTranslation(('ns'))` (#295)
|
|
41
42
|
return ScopeManager.unwrapTsExpression(node.expression);
|
|
42
43
|
default:
|
|
43
44
|
return node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18next-cli",
|
|
3
|
-
"version": "1.74.
|
|
3
|
+
"version": "1.74.2",
|
|
4
4
|
"description": "A unified, high-performance i18next CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,37 +56,37 @@
|
|
|
56
56
|
"@rollup/plugin-terser": "^1.0.0",
|
|
57
57
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
58
58
|
"@types/inquirer": "^9.0.10",
|
|
59
|
-
"@types/node": "^26.
|
|
60
|
-
"@types/react": "^19.
|
|
61
|
-
"@typescript-eslint/parser": "^8.
|
|
62
|
-
"@vitest/coverage-v8": "^
|
|
59
|
+
"@types/node": "^26.6.3",
|
|
60
|
+
"@types/react": "^19.3.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.70.1",
|
|
62
|
+
"@vitest/coverage-v8": "^5.0.2",
|
|
63
63
|
"eslint": "^9.39.5",
|
|
64
64
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
65
65
|
"eslint-plugin-import": "^2.32.0",
|
|
66
|
-
"memfs": "^4.
|
|
66
|
+
"memfs": "^4.79.0",
|
|
67
67
|
"neostandard": "^0.13.0",
|
|
68
|
-
"react": "^19.
|
|
69
|
-
"rollup": "^4.
|
|
68
|
+
"react": "^19.3.0",
|
|
69
|
+
"rollup": "^4.63.5",
|
|
70
70
|
"typescript": "^6.0.3",
|
|
71
|
-
"unplugin-swc": "^
|
|
72
|
-
"vitest": "^
|
|
71
|
+
"unplugin-swc": "^2.0.0",
|
|
72
|
+
"vitest": "^5.0.2"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@croct/json5-parser": "^0.2.2",
|
|
76
|
-
"@swc/core": "^1.16.
|
|
76
|
+
"@swc/core": "^1.16.2",
|
|
77
77
|
"chokidar": "^5.0.0",
|
|
78
78
|
"commander": "^15.0.0",
|
|
79
79
|
"execa": "^10.0.1",
|
|
80
80
|
"glob": "^13.0.6",
|
|
81
|
-
"i18next": "^26.4.
|
|
82
|
-
"i18next-resources-for-ts": "^2.1.
|
|
83
|
-
"inquirer": "^14.
|
|
81
|
+
"i18next": "^26.4.2",
|
|
82
|
+
"i18next-resources-for-ts": "^2.1.1",
|
|
83
|
+
"inquirer": "^14.2.2",
|
|
84
84
|
"jiti": "^2.7.0",
|
|
85
85
|
"jsonc-parser": "^3.3.1",
|
|
86
|
-
"magic-string": "^1.
|
|
86
|
+
"magic-string": "^1.4.2",
|
|
87
87
|
"minimatch": "^10.2.6",
|
|
88
88
|
"ora": "^9.4.1",
|
|
89
|
-
"react-i18next": "^17.0.
|
|
90
|
-
"yaml": "^2.9.
|
|
89
|
+
"react-i18next": "^17.0.15",
|
|
90
|
+
"yaml": "^2.9.1"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/extractor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAO5G,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAQ/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,oB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WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAC7C,MAAM,GAAE,MAA4B,EACpC,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAsJf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAC7C,MAAM,GAAE,MAA4B,EACpC,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CA4Df;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,OAAO,CAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,uBAA+B,EAAE,GAAE;IAAE,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAO1K"}
|
|
@@ -87,6 +87,18 @@ export declare function normalizeSpansToCharIndices(ast: any, code: string): voi
|
|
|
87
87
|
* (see {@link normalizeASTSpans} / {@link convertSpansToCharIndices}).
|
|
88
88
|
*/
|
|
89
89
|
export declare function collectIgnoredLineRanges(ast: any, code: string): Set<number>;
|
|
90
|
+
/**
|
|
91
|
+
* Strips redundant parentheses from an expression (#295).
|
|
92
|
+
*
|
|
93
|
+
* SWC keeps them as `ParenthesisExpression` nodes, so any code that switches on
|
|
94
|
+
* an expression's type sees the wrapper instead of the literal/object inside.
|
|
95
|
+
* These parens are easy to hit by accident: Prettier adds them around the
|
|
96
|
+
* longer branch of a ternary that doesn't fit on one line.
|
|
97
|
+
*
|
|
98
|
+
* Only parens are removed; TS assertions (`as`, `satisfies`) carry type
|
|
99
|
+
* information some callers need and are left alone.
|
|
100
|
+
*/
|
|
101
|
+
export declare function unwrapParens<T>(expr: T): T;
|
|
90
102
|
/**
|
|
91
103
|
* Finds and returns the full property node (KeyValueProperty) for the given
|
|
92
104
|
* property name from an ObjectExpression.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/ast-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAc,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE1F;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA2BzD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CA0BhE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQhH;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CA0BpE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAwBhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAKzE;AAgBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CA4D7E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAA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|
|
@@ -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;AAGrD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,KAAK,CAAiB;IAK9B,OAAO,CAAC,aAAa,CAA4D;IAGjF,OAAO,CAAC,eAAe,CAAiD;IAIxE,OAAO,CAAC,cAAc,CAAmC;IAIzD,OAAO,CAAC,mBAAmB,CAAmC;IAI9D,OAAO,CAAC,oBAAoB,CAAmC;IAM/D,OAAO,CAAC,yBAAyB,CAAmC;IAIpE,OAAO,CAAC,kBAAkB,CAAmC;IAK7D,OAAO,CAAC,eAAe,CAAmD;IAE1E,OAAO,CAAC,oBAAoB,CAAgC;IAI5D,OAAO,CAAC,wBAAwB,CAAmD;IAKnF,OAAO,CAAC,mBAAmB,CAAmD;IAM9E,OAAO,CAAC,mBAAmB,CAAiC;gBAE/C,KAAK,EAAE,eAAe;IAInC;;OAEG;IACI,gBAAgB,IAAK,IAAI;IAOhC;;;;;;;;;OASG;IACH,yBAAyB,CAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAgN3C;;;;;;;OAOG;IACH,2BAA2B,CAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAyB7C;;;;;;OAMG;IACH,wBAAwB,CAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAa1C;;;;;;;OAOG;IACI,kBAAkB,IAAK,IAAI;IAg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