i18next-cli 1.51.2 → 1.51.3
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
CHANGED
|
@@ -683,10 +683,10 @@ export default defineConfig({
|
|
|
683
683
|
// options for linter
|
|
684
684
|
lint: {
|
|
685
685
|
/** Optional accept-list of JSX attribute names to exclusively lint (takes precedence over ignoredAttributes). */
|
|
686
|
-
acceptedAttributes: ['title']
|
|
686
|
+
acceptedAttributes: ['title'],
|
|
687
687
|
|
|
688
688
|
/** Optional accept-list of JSX tag names to exclusively lint (takes precedence over ignoredTags). */
|
|
689
|
-
acceptedTags: ['p']
|
|
689
|
+
acceptedTags: ['p'],
|
|
690
690
|
|
|
691
691
|
// Optional custom JSX attributes to ignore during linting
|
|
692
692
|
ignoredAttributes: ['data-testid', 'aria-label'],
|
package/dist/cjs/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ const program = new commander.Command();
|
|
|
31
31
|
program
|
|
32
32
|
.name('i18next-cli')
|
|
33
33
|
.description('A unified, high-performance i18next CLI.')
|
|
34
|
-
.version('1.51.
|
|
34
|
+
.version('1.51.3'); // This string is replaced with the actual version at build time by rollup
|
|
35
35
|
// new: global config override option
|
|
36
36
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
37
37
|
program
|
|
@@ -149,6 +149,10 @@ function isExtExplicitlyInInputPatterns(ext, input) {
|
|
|
149
149
|
*/
|
|
150
150
|
async function processFile(file, plugins, astVisitors, pluginContext, config, logger$1 = new logger.ConsoleLogger(), fileErrors) {
|
|
151
151
|
try {
|
|
152
|
+
// Skip directories that happen to match file-extension globs (e.g. a directory named "Foo.tsx")
|
|
153
|
+
const fileStat = await promises.stat(file);
|
|
154
|
+
if (fileStat.isDirectory())
|
|
155
|
+
return;
|
|
152
156
|
let code = await promises.readFile(file, 'utf-8');
|
|
153
157
|
// Run onLoad hooks from plugins with error handling.
|
|
154
158
|
// Track whether any plugin actually transformed the code so we can make
|
|
@@ -302,6 +306,10 @@ async function processFile(file, plugins, astVisitors, pluginContext, config, lo
|
|
|
302
306
|
*/
|
|
303
307
|
async function preScanFile(file, astVisitors, config, logger$1 = new logger.ConsoleLogger(), fileErrors) {
|
|
304
308
|
try {
|
|
309
|
+
// Skip directories that happen to match file-extension globs (e.g. a directory named "Foo.tsx")
|
|
310
|
+
const fileStat = await promises.stat(file);
|
|
311
|
+
if (fileStat.isDirectory())
|
|
312
|
+
return;
|
|
305
313
|
const code = await promises.readFile(file, 'utf-8');
|
|
306
314
|
const fileExt = node_path.extname(file).toLowerCase();
|
|
307
315
|
// Non-native files (e.g. .svelte, .vue) cannot be parsed by SWC in the
|
package/dist/esm/cli.js
CHANGED
|
@@ -29,7 +29,7 @@ const program = new Command();
|
|
|
29
29
|
program
|
|
30
30
|
.name('i18next-cli')
|
|
31
31
|
.description('A unified, high-performance i18next CLI.')
|
|
32
|
-
.version('1.51.
|
|
32
|
+
.version('1.51.3'); // This string is replaced with the actual version at build time by rollup
|
|
33
33
|
// new: global config override option
|
|
34
34
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
35
35
|
program
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSpinnerLike } from '../../utils/wrap-ora.js';
|
|
2
2
|
import { styleText } from 'node:util';
|
|
3
3
|
import { parse } from '@swc/core';
|
|
4
|
-
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
|
4
|
+
import { mkdir, writeFile, stat, readFile } from 'node:fs/promises';
|
|
5
5
|
import { dirname, extname } from 'node:path';
|
|
6
6
|
import { findKeys } from './key-finder.js';
|
|
7
7
|
import { getTranslations } from './translation-manager.js';
|
|
@@ -147,6 +147,10 @@ function isExtExplicitlyInInputPatterns(ext, input) {
|
|
|
147
147
|
*/
|
|
148
148
|
async function processFile(file, plugins, astVisitors, pluginContext, config, logger = new ConsoleLogger(), fileErrors) {
|
|
149
149
|
try {
|
|
150
|
+
// Skip directories that happen to match file-extension globs (e.g. a directory named "Foo.tsx")
|
|
151
|
+
const fileStat = await stat(file);
|
|
152
|
+
if (fileStat.isDirectory())
|
|
153
|
+
return;
|
|
150
154
|
let code = await readFile(file, 'utf-8');
|
|
151
155
|
// Run onLoad hooks from plugins with error handling.
|
|
152
156
|
// Track whether any plugin actually transformed the code so we can make
|
|
@@ -300,6 +304,10 @@ async function processFile(file, plugins, astVisitors, pluginContext, config, lo
|
|
|
300
304
|
*/
|
|
301
305
|
async function preScanFile(file, astVisitors, config, logger = new ConsoleLogger(), fileErrors) {
|
|
302
306
|
try {
|
|
307
|
+
// Skip directories that happen to match file-extension globs (e.g. a directory named "Foo.tsx")
|
|
308
|
+
const fileStat = await stat(file);
|
|
309
|
+
if (fileStat.isDirectory())
|
|
310
|
+
return;
|
|
303
311
|
const code = await readFile(file, 'utf-8');
|
|
304
312
|
const fileExt = extname(file).toLowerCase();
|
|
305
313
|
// Non-native files (e.g. .svelte, .vue) cannot be parsed by SWC in the
|
package/package.json
CHANGED
|
@@ -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;AAK/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,oBAAoB,EAC5B,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CACX,GACL,OA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