i18n-validate
Advanced tools
Comparing version 1.4.3-next.f9c39c5.0 to 1.4.3-next.fb11ed3.0
@@ -9,12 +9,12 @@ # Changelog | ||
- Empty string check ([09ac1d2](https://github.com/imranbarbhuiya/i18n-validate/commit/09ac1d23ebe08eecfe4c1562c16d7ac4e0bdba30)) | ||
- Dynamic import ([58b2196](https://github.com/imranbarbhuiya/i18n-validate/commit/58b21966f8ef1c0365f2d05516435c6bceb773a2)) | ||
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa)) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
- Empty string check ([09ac1d2](https://github.com/imranbarbhuiya/i18n-validate/commit/09ac1d23ebe08eecfe4c1562c16d7ac4e0bdba30)) | ||
- Dynamic import ([58b2196](https://github.com/imranbarbhuiya/i18n-validate/commit/58b21966f8ef1c0365f2d05516435c6bceb773a2)) | ||
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa)) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
### 🚀 Features | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
@@ -25,10 +25,10 @@ ## [i18n-validate@1.4.1](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.4.1) - (2023-07-19) | ||
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa)) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa)) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
### 🚀 Features | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
@@ -39,9 +39,9 @@ ## [i18n-validate@1.4.0](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.4.0) - (2023-07-18) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
### 🚀 Features | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
@@ -52,7 +52,7 @@ ## [i18n-validate@1.3.0](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.3.0) - (2023-07-18) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8)) | ||
### 🚀 Features | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16)) | ||
@@ -59,0 +59,0 @@ ## [1.2.1](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.0...v1.2.1) - (2023-07-16) |
#!/usr/bin/env node | ||
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-STXOAPH2.js'; | ||
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-OSNOD3G2.js'; | ||
import process from 'node:process'; | ||
import { Command } from 'commander'; | ||
import { Glob } from 'glob'; | ||
import { stream } from 'fast-glob'; | ||
var start = performance.now(); | ||
var command = new Command().version("1.4.3-next.f9c39c5.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level").option("--exclude <exclude...>", "Exclude files from parsing").option("--exit-on-error", "Exit immediately if an error is found"); | ||
var command = new Command().version("1.4.3-next.fb11ed3.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level").option("--exclude <exclude...>", "Exclude files from parsing").option("--exit-on-error", "Exit immediately if an error is found"); | ||
command.on("--help", () => { | ||
@@ -21,9 +21,7 @@ console.log(""); | ||
options.inputs = program.args.length > 0 ? program.args : options.inputs; | ||
if (!Array.isArray(options.inputs)) | ||
options.inputs = [options.inputs]; | ||
if (!Array.isArray(options.inputs)) options.inputs = [options.inputs]; | ||
if (!Array.isArray(options.exclude)) options.exclude = [options.exclude]; | ||
options.inputs = options.inputs.map((_input) => { | ||
let input = _input.trim().replaceAll("\\", "/"); | ||
if (/^'.*'$|^".*"$/.test(input)) { | ||
input = input.slice(1, -1); | ||
} | ||
if (/^'.*'$|^".*"$/.test(input)) input = input.slice(1, -1); | ||
return input; | ||
@@ -37,3 +35,3 @@ }).filter(Boolean); | ||
} | ||
var glob = new Glob(options.inputs, { | ||
var glob = stream(options.inputs, { | ||
ignore: options.exclude | ||
@@ -47,3 +45,3 @@ }); | ||
log(`Parsing ${file}`, "debug", options); | ||
const translationNodes = parseFile(file, options); | ||
const translationNodes = parseFile(file.toString(), options); | ||
for (const node of translationNodes) { | ||
@@ -64,4 +62,3 @@ if (!node.isStaticKey) { | ||
const valid = await validateKey(node, options); | ||
if (!valid) | ||
errorCount++; | ||
if (!valid) errorCount++; | ||
} else { | ||
@@ -76,5 +73,3 @@ log( | ||
} | ||
if (errorCount > 0 && options.exitOnError) { | ||
break; | ||
} | ||
if (errorCount > 0 && options.exitOnError) break; | ||
} | ||
@@ -81,0 +76,0 @@ var timeTaken = `${(performance.now() - start).toFixed(2)}ms`; |
@@ -121,2 +121,2 @@ type LogLevel = 'debug' | 'error' | 'info' | 'warn'; | ||
export { LogLevel, Options, TranslationNode, ValidationError, parseFile, parseOptionsFile, validateKey }; | ||
export { type LogLevel, type Options, type TranslationNode, ValidationError, parseFile, parseOptionsFile, validateKey }; |
@@ -1,3 +0,3 @@ | ||
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-STXOAPH2.js'; | ||
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-OSNOD3G2.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "i18n-validate", | ||
"version": "1.4.3-next.f9c39c5.0", | ||
"version": "1.4.3-next.fb11ed3.0", | ||
"description": "A cli tool to find invalid i18n keys, missing variables and many more", | ||
@@ -32,19 +32,19 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"commander": "^11.0.0", | ||
"glob": "^10.3.3", | ||
"typescript": "^5.1.6" | ||
"commander": "^12.1.0", | ||
"fast-glob": "^3.3.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"devDependencies": { | ||
"@favware/cliff-jumper": "^2.1.1", | ||
"@favware/cliff-jumper": "^3.0.3", | ||
"@favware/npm-deprecate": "^1.0.7", | ||
"@types/node": "^20.4.2", | ||
"@vitest/coverage-v8": "^0.33.0", | ||
"esbuild-plugin-version-injector": "^1.2.0", | ||
"eslint": "^8.45.0", | ||
"eslint-config-mahir": "^0.0.29", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^13.2.3", | ||
"prettier": "^3.0.0", | ||
"tsup": "^7.1.0", | ||
"vitest": "^0.33.0" | ||
"@types/node": "^20.14.2", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"esbuild-plugin-version-injector": "^1.2.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-mahir": "^0.0.43", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.5", | ||
"prettier": "^3.3.1", | ||
"tsup": "^8.1.0", | ||
"vitest": "^1.6.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58254
510
1
+ Addedfast-glob@^3.3.2
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedcommander@12.1.0(transitive)
+ Addedfast-glob@3.3.3(transitive)
+ Addedfastq@1.18.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedglob@^10.3.3
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removedansi-regex@5.0.16.1.0(transitive)
- Removedansi-styles@4.3.06.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcommander@11.1.0(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removedemoji-regex@8.0.09.2.2(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedglob@10.4.5(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedminimatch@9.0.5(transitive)
- Removedminipass@7.1.2(transitive)
- Removedpackage-json-from-dist@1.0.1(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@4.1.0(transitive)
- Removedstring-width@4.2.35.1.2(transitive)
- Removedstrip-ansi@6.0.17.1.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@7.0.08.1.0(transitive)
Updatedcommander@^12.1.0
Updatedtypescript@^5.4.5