diff --git a/.github/renovate.json b/.github/renovate.json index 4e49c43f03..6ee8e82a26 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -46,7 +46,6 @@ "!/playwright/", "!/typescript/", "!/vite/", - "!/yargs/", "!/zone.js/" ] }, diff --git a/change/@ni-xliff-to-json-converter-5fd8dba9-f517-4d05-a753-435eba883a1c.json b/change/@ni-xliff-to-json-converter-5fd8dba9-f517-4d05-a753-435eba883a1c.json new file mode 100644 index 0000000000..de4249ee90 --- /dev/null +++ b/change/@ni-xliff-to-json-converter-5fd8dba9-f517-4d05-a753-435eba883a1c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update yargs dependency version", + "packageName": "@ni/xliff-to-json-converter", + "email": "jattasNI@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/package-lock.json b/package-lock.json index 4df16f9275..29232c8281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3493,6 +3493,7 @@ "os": [ "aix" ], + "peer": true, "engines": { "node": ">=18" } @@ -3510,6 +3511,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -3527,6 +3529,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -3544,6 +3547,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -3561,6 +3565,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -3578,6 +3583,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -3595,6 +3601,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3612,6 +3619,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3629,6 +3637,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3646,6 +3655,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3663,6 +3673,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3680,6 +3691,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3697,6 +3709,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3714,6 +3727,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3731,6 +3745,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3748,6 +3763,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3765,6 +3781,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -3782,6 +3799,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3799,6 +3817,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3816,6 +3835,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3833,6 +3853,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -3850,6 +3871,7 @@ "os": [ "openharmony" ], + "peer": true, "engines": { "node": ">=18" } @@ -3867,6 +3889,7 @@ "os": [ "sunos" ], + "peer": true, "engines": { "node": ">=18" } @@ -3884,6 +3907,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -3901,6 +3925,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -3918,6 +3943,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -8297,6 +8323,7 @@ "hasInstallScript": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "detect-libc": "^2.0.3", "is-glob": "^4.0.3", @@ -8339,6 +8366,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8360,6 +8388,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8381,6 +8410,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8402,6 +8432,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8423,6 +8454,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8444,6 +8476,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8465,6 +8498,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8486,6 +8520,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8507,6 +8542,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8528,6 +8564,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8549,6 +8586,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8570,6 +8608,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8591,6 +8630,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -8605,7 +8645,8 @@ "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/@parcel/watcher/node_modules/picomatch": { "version": "4.0.4", @@ -8614,6 +8655,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=12" }, @@ -13304,6 +13346,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -13318,12 +13361,14 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, "license": "MIT" }, "node_modules/cliui/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -13333,6 +13378,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -13347,6 +13393,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -13359,6 +13406,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -15094,6 +15142,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "prr": "~1.0.1" }, @@ -18368,6 +18417,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "bin": { "image-size": "bin/image-size.js" }, @@ -20601,6 +20651,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "bin": { "mime": "cli.js" }, @@ -20615,6 +20666,7 @@ "dev": true, "license": "BSD-3-Clause", "optional": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -25562,6 +25614,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "iconv-lite": "^0.6.3", "sax": "^1.2.4" @@ -25580,6 +25633,7 @@ "dev": true, "license": "MIT", "optional": true, + "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -28031,7 +28085,8 @@ "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", "dev": true, "license": "MIT", - "optional": true + "optional": true, + "peer": true }, "node_modules/pump": { "version": "3.0.4", @@ -29858,6 +29913,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -34809,6 +34865,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, "license": "MIT", "dependencies": { "cliui": "^8.0.1", @@ -34827,6 +34884,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -34836,12 +34894,14 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, "license": "MIT" }, "node_modules/yargs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -34851,6 +34911,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -34865,6 +34926,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -35483,7 +35545,7 @@ "license": "MIT", "dependencies": { "xliff": "^6.1.0", - "yargs": "^17.5.1" + "yargs": "^18.0.0" }, "bin": { "xliff-to-json-converter": "dist/esm/index.js" @@ -35491,11 +35553,97 @@ "devDependencies": { "@ni-private/eslint-config-nimble": "*", "@types/jasmine": "^5.1.4", - "@types/yargs": "^17.0.10", + "@types/yargs": "^17.0.35", "jasmine": "^5.1.0", "jasmine-core": "^5.1.2", "typescript": "~5.8.3" } + }, + "packages/xliff-to-json-converter/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/xliff-to-json-converter/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "packages/xliff-to-json-converter/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/xliff-to-json-converter/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "packages/xliff-to-json-converter/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "packages/xliff-to-json-converter/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } } } } diff --git a/packages/xliff-to-json-converter/package.json b/packages/xliff-to-json-converter/package.json index 2cde2222d9..93f15db0f0 100644 --- a/packages/xliff-to-json-converter/package.json +++ b/packages/xliff-to-json-converter/package.json @@ -45,12 +45,12 @@ "license": "MIT", "dependencies": { "xliff": "^6.1.0", - "yargs": "^17.5.1" + "yargs": "^18.0.0" }, "devDependencies": { "@ni-private/eslint-config-nimble": "*", "@types/jasmine": "^5.1.4", - "@types/yargs": "^17.0.10", + "@types/yargs": "^17.0.35", "jasmine": "^5.1.0", "jasmine-core": "^5.1.2", "typescript": "~5.8.3" diff --git a/packages/xliff-to-json-converter/src/tests/index.spec.ts b/packages/xliff-to-json-converter/src/tests/index.spec.ts new file mode 100644 index 0000000000..a345f690d4 --- /dev/null +++ b/packages/xliff-to-json-converter/src/tests/index.spec.ts @@ -0,0 +1,61 @@ +import { execFile as execFileCallback } from 'node:child_process'; +import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { promisify } from 'node:util'; + +const execFile = promisify(execFileCallback); + +describe('xliff-to-json-converter cli', () => { + let tempDir: string; + let sourceFile: string; + let destinationFile: string; + + beforeEach(async () => { + tempDir = await mkdtemp(join(tmpdir(), 'xliff-to-json-converter-')); + sourceFile = join(tempDir, 'messages.de.xlf'); + destinationFile = join(tempDir, 'messages.de.json'); + }); + + afterEach(async () => { + await rm(tempDir, { recursive: true, force: true }); + }); + + it('converts an xliff file passed on the command line', async () => { + const cliPath = fileURLToPath(new URL('../index.js', import.meta.url)); + const xliffContents = ` + + + + + + HomeStartseite + + + + + `; + + await writeFile(sourceFile, xliffContents); + + const { stdout } = await execFile(process.execPath, [ + cliPath, + '--source', + sourceFile, + '--destination', + destinationFile + ]); + + const jsonContents = await readFile(destinationFile, 'utf-8'); + + expect(stdout).toContain(`Converting ${sourceFile} -> ${destinationFile}`); + expect(JSON.parse(jsonContents)).toEqual({ + locale: 'de-DE', + translations: { + // eslint-disable-next-line @typescript-eslint/naming-convention + '2821179408673282599': 'Startseite' + } + }); + }); +}); \ No newline at end of file