i18n-validate
Advanced tools
Comparing version 1.4.3-next.4cb8ff4.0 to 1.4.3-next.4d18bd6.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-G4YG6XYC.js'; | ||
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-OSNOD3G2.js'; | ||
import process from 'node:process'; | ||
@@ -8,3 +8,3 @@ import { Command } from 'commander'; | ||
var start = performance.now(); | ||
var command = new Command().version("1.4.3-next.4cb8ff4.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.4d18bd6.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", () => { | ||
@@ -22,11 +22,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.exclude)) | ||
options.exclude = [options.exclude]; | ||
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; | ||
@@ -65,4 +61,3 @@ }).filter(Boolean); | ||
const valid = await validateKey(node, options); | ||
if (!valid) | ||
errorCount++; | ||
if (!valid) errorCount++; | ||
} else { | ||
@@ -77,5 +72,3 @@ log( | ||
} | ||
if (errorCount > 0 && options.exitOnError) { | ||
break; | ||
} | ||
if (errorCount > 0 && options.exitOnError) break; | ||
} | ||
@@ -82,0 +75,0 @@ var timeTaken = `${(performance.now() - start).toFixed(2)}ms`; |
@@ -14,3 +14,3 @@ type LogLevel = 'debug' | 'error' | 'info' | 'warn'; | ||
*/ | ||
exclude: string | string[]; | ||
exclude: string[] | string; | ||
/** | ||
@@ -33,3 +33,3 @@ * Exit immediately if an error is found | ||
*/ | ||
inputs: string | string[]; | ||
inputs: string[] | string; | ||
/** | ||
@@ -36,0 +36,0 @@ * Key separator for nested translation keys |
@@ -1,3 +0,3 @@ | ||
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-G4YG6XYC.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.4cb8ff4.0", | ||
"version": "1.4.3-next.4d18bd6.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.1.0", | ||
"commander": "^12.1.0", | ||
"fast-glob": "^3.3.2", | ||
"typescript": "^5.3.3" | ||
"typescript": "^5.5.2" | ||
}, | ||
"devDependencies": { | ||
"@favware/cliff-jumper": "^2.2.3", | ||
"@favware/cliff-jumper": "^3.0.3", | ||
"@favware/npm-deprecate": "^1.0.7", | ||
"@types/node": "^20.11.8", | ||
"@vitest/coverage-v8": "^1.2.2", | ||
"@types/node": "^20.14.8", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"esbuild-plugin-version-injector": "^1.2.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-mahir": "^0.0.36", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^15.2.0", | ||
"prettier": "^3.2.4", | ||
"tsup": "^8.0.1", | ||
"vitest": "^1.2.2" | ||
"eslint": "^8.57.0", | ||
"eslint-config-mahir": "^0.0.43", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.7", | ||
"prettier": "^3.3.2", | ||
"tsup": "^8.1.0", | ||
"vitest": "^1.6.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
58254
510
1
+ Addedcommander@12.1.0(transitive)
- Removedcommander@11.1.0(transitive)
Updatedcommander@^12.1.0
Updatedtypescript@^5.5.2