i18n-validate
Advanced tools
Comparing version 1.4.3-next.ff161ed.0 to 1.4.3
@@ -5,2 +5,14 @@ # Changelog | ||
## [i18n-validate@1.4.3](https://github.com/imranbarbhuiya/i18n-validate/compare/i18n-validate@1.4.2...i18n-validate@1.4.3) - (2024-11-01) | ||
### 🏃 Performance | ||
- Use fast-glob ([09978ec](https://github.com/imranbarbhuiya/i18n-validate/commit/09978ec68cecd90dc8e0673f6a56f2372a5b99ac)) | ||
### 🐛 Bug Fixes | ||
- **deps:** Update all non-major dependencies (#123) ([2311155](https://github.com/imranbarbhuiya/i18n-validate/commit/2311155f18b760a02f2abbc00bb946f77f5bb3e2)) | ||
- **deps:** Update dependency commander to v12 (#72) ([8a37e45](https://github.com/imranbarbhuiya/i18n-validate/commit/8a37e4567ca3800dfdea7eecfd552b6b22735e55)) | ||
- **deps:** Update all non-major dependencies ([4704ae5](https://github.com/imranbarbhuiya/i18n-validate/commit/4704ae587048fb9eceaf32ab1f5b1099d93d0fee)) | ||
## [i18n-validate@1.4.2](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.4.2) - (2023-07-20) | ||
@@ -10,12 +22,12 @@ | ||
- 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)) | ||
@@ -26,10 +38,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)) | ||
@@ -40,9 +52,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)) | ||
@@ -53,7 +65,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)) | ||
@@ -60,0 +72,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-RUFXM4UQ.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.ff161ed.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").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; | ||
} | ||
@@ -89,3 +82,3 @@ var timeTaken = `${(performance.now() - start).toFixed(2)}ms`; | ||
process.exit(errorCount > 0 ? 1 : 0); | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=cli.js.map | ||
//# sourceMappingURL=cli.js.map |
@@ -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; | ||
/** | ||
@@ -123,2 +123,2 @@ * Key separator for nested translation keys | ||
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-G4YG6XYC.js'; | ||
//# sourceMappingURL=out.js.map | ||
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-RUFXM4UQ.js'; | ||
//# sourceMappingURL=index.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "i18n-validate", | ||
"version": "1.4.3-next.ff161ed.0", | ||
"version": "1.4.3", | ||
"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", | ||
"fast-glob": "^3.3.1", | ||
"typescript": "^5.2.2" | ||
"commander": "^12.1.0", | ||
"fast-glob": "^3.3.2", | ||
"typescript": "^5.6.3" | ||
}, | ||
"devDependencies": { | ||
"@favware/cliff-jumper": "^2.2.0", | ||
"@favware/npm-deprecate": "^1.0.7", | ||
"@types/node": "^20.6.4", | ||
"@vitest/coverage-v8": "^0.34.5", | ||
"@favware/cliff-jumper": "^5.0.0", | ||
"@favware/npm-deprecate": "^2.0.0", | ||
"@types/node": "^22.8.6", | ||
"@vitest/coverage-v8": "^2.1.4", | ||
"esbuild-plugin-version-injector": "^1.2.1", | ||
"eslint": "^8.50.0", | ||
"eslint-config-mahir": "^0.0.33", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^14.0.1", | ||
"prettier": "^3.0.3", | ||
"tsup": "^7.2.0", | ||
"vitest": "^0.34.5" | ||
"eslint": "^9.13.0", | ||
"eslint-config-mahir": "^1.0.4", | ||
"husky": "^9.1.6", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "^3.3.3", | ||
"tsup": "^8.3.5", | ||
"vitest": "^2.1.4" | ||
}, | ||
@@ -51,0 +51,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
63937
0
1
510
+ Addedcommander@12.1.0(transitive)
- Removedcommander@11.1.0(transitive)
Updatedcommander@^12.1.0
Updatedfast-glob@^3.3.2
Updatedtypescript@^5.6.3