From aa377f9a4af2396a47afa62816f0210638053088 Mon Sep 17 00:00:00 2001 From: Vitalij Ryndin Date: Tue, 5 Dec 2023 17:18:06 +0800 Subject: [PATCH 1/5] feat: print diff --- packages/cli/package.json | 2 ++ packages/cli/src/commands/add.ts | 6 +++- packages/cli/src/commands/remove.ts | 7 +++- packages/cli/src/commands/sort.ts | 6 +++- packages/cli/src/commands/update.ts | 6 +++- packages/cli/src/utils/diff.ts | 55 +++++++++++++++++++++++++++++ packages/cli/src/utils/files.ts | 3 +- pnpm-lock.yaml | 15 ++++++++ 8 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 packages/cli/src/utils/diff.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 581682d..a341041 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -27,10 +27,12 @@ }, "dependencies": { "@inquirer/prompts": "3.3.0", + "diff": "5.1.0", "xml-locales": "workspace:0.0.4", "yargs": "17.7.2" }, "devDependencies": { + "@types/diff": "5.0.8", "@types/yargs": "17.0.32" } } diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index 6c2c140..ae779d4 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -2,6 +2,7 @@ import type { ArgumentsCamelCase, Argv } from 'yargs'; import { keyValueOptions } from '../options/key-value.js'; import { pathOption } from '../options/path.js'; +import { Diff } from '../utils/diff.js'; import { readFiles, writeFile } from '../utils/files.js'; export const command = 'add'; @@ -24,6 +25,9 @@ export async function handler({ }>) { const files = await readFiles(path); for (const [path, file] of files) { - await writeFile(path, file.add({ key, value }).toXML()); + const diff = new Diff(path, file); + const xml = file.add({ key, value }).toXML(); + await writeFile(path, xml); + diff.print(xml); } } diff --git a/packages/cli/src/commands/remove.ts b/packages/cli/src/commands/remove.ts index 8cc919d..9f67615 100644 --- a/packages/cli/src/commands/remove.ts +++ b/packages/cli/src/commands/remove.ts @@ -2,6 +2,7 @@ import type { ArgumentsCamelCase, Argv } from 'yargs'; import { keyValueOptions } from '../options/key-value.js'; import { pathOption } from '../options/path.js'; +import { Diff } from '../utils/diff.js'; import { readFiles, writeFile } from '../utils/files.js'; export const command = 'remove'; @@ -24,6 +25,8 @@ export async function handler({ }>) { const files = await readFiles(path); for (let [path, file] of files) { + const diff = new Diff(path, file); + if (key) { file = file.deleteByKey(key); } @@ -32,6 +35,8 @@ export async function handler({ file = file.deleteByValue(value); } - await writeFile(path, file.toXML()); + const xml = file.toXML(); + await writeFile(path, xml); + diff.print(xml); } } diff --git a/packages/cli/src/commands/sort.ts b/packages/cli/src/commands/sort.ts index 4e24a5c..2b3f8fc 100644 --- a/packages/cli/src/commands/sort.ts +++ b/packages/cli/src/commands/sort.ts @@ -3,6 +3,7 @@ import type { ArgumentsCamelCase, Argv } from 'yargs'; import { directionOption } from '../options/direction.js'; import { pathOption } from '../options/path.js'; +import { Diff } from '../utils/diff.js'; import { readFiles, writeFile } from '../utils/files.js'; export const command = 'sort'; @@ -20,6 +21,9 @@ export async function handler({ }: ArgumentsCamelCase<{ path: string; direction: SortDirection }>) { const files = await readFiles(path); for (const [path, file] of files) { - await writeFile(path, file.sort(direction).toXML()); + const diff = new Diff(path, file); + const xml = file.sort(direction).toXML(); + await writeFile(path, xml); + diff.print(xml); } } diff --git a/packages/cli/src/commands/update.ts b/packages/cli/src/commands/update.ts index 072e99d..fc95a52 100644 --- a/packages/cli/src/commands/update.ts +++ b/packages/cli/src/commands/update.ts @@ -2,6 +2,7 @@ import type { ArgumentsCamelCase, Argv } from 'yargs'; import { oldKeyOrValueOptions } from '../options/key-value.js'; import { pathOption } from '../options/path.js'; +import { Diff } from '../utils/diff.js'; import { readFiles, writeFile } from '../utils/files.js'; export const command = 'update'; @@ -24,6 +25,9 @@ export async function handler({ }>) { const files = await readFiles(path); for (const [path, file] of files) { - await writeFile(path, file.update({ oldValue, newValue }).toXML()); + const diff = new Diff(path, file); + const xml = file.update({ oldValue, newValue }).toXML(); + await writeFile(path, xml); + diff.print(xml); } } diff --git a/packages/cli/src/utils/diff.ts b/packages/cli/src/utils/diff.ts new file mode 100644 index 0000000..15e1d3e --- /dev/null +++ b/packages/cli/src/utils/diff.ts @@ -0,0 +1,55 @@ +import { createPatch } from 'diff'; +import { XmlLocales } from 'xml-locales'; + +export class Diff { + /** @internal */ + private filePath: string; + + /** @internal */ + private actual: string; + + constructor(filePath: string, xmlLocales: XmlLocales) { + this.filePath = filePath; + this.actual = xmlLocales.toXML(); + } + + print(expected: string): void { + const patch = createPatch('string', this.actual, expected); + const lines = patch.split('\n').slice(4).map(rework).filter(notNull); + console.log( + `${this.filePath}: ${ + lines.length ? `\n${lines.join('\n')}` : 'no changes' + }\n` + ); + } +} + +function rework(line: string): string | null { + switch (line.charAt(0)) { + case '+': + return colorize('added', line); + case '-': + return colorize('removed', line); + case ' ': + return line; + case '@': + return null; + case '\\': + return null; + default: + return null; + } +} + +function notNull(line: string | null): line is T { + return line !== null; +} + +const colors = { + added: 32, + removed: 31 +} as const; + +function colorize(color: keyof typeof colors, string: string): string { + return `\u001b[${colors[color]}m${string}\u001b[0m`; +} diff --git a/packages/cli/src/utils/files.ts b/packages/cli/src/utils/files.ts index 87e14b1..25a9759 100644 --- a/packages/cli/src/utils/files.ts +++ b/packages/cli/src/utils/files.ts @@ -1,4 +1,5 @@ import fs from 'node:fs/promises'; +import { resolve } from 'node:path'; import { XmlLocales } from 'xml-locales'; async function scanPath(path: string): Promise { @@ -9,7 +10,7 @@ async function scanPath(path: string): Promise { const paths = await fs.readdir(path); return paths .filter((file) => file.endsWith('.xml')) - .map((file) => `${path}/${file}`); + .map((file) => resolve(`${path}/${file}`)); } } catch (err) { throw new Error( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index baf961a..819bc8f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,9 @@ importers: '@inquirer/prompts': specifier: 3.3.0 version: 3.3.0 + diff: + specifier: 5.1.0 + version: 5.1.0 xml-locales: specifier: workspace:0.0.4 version: link:../xml-locales @@ -54,6 +57,9 @@ importers: specifier: 17.7.2 version: 17.7.2 devDependencies: + '@types/diff': + specifier: 5.0.8 + version: 5.0.8 '@types/yargs': specifier: 17.0.32 version: 17.0.32 @@ -1225,6 +1231,10 @@ packages: resolution: {integrity: sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg==} dev: true + /@types/diff@5.0.8: + resolution: {integrity: sha512-kR0gRf0wMwpxQq6ME5s+tWk9zVCfJUl98eRkD05HWWRbhPB/eu4V1IbyZAsvzC1Gn4znBJ0HN01M4DGXdBEV8Q==} + dev: true + /@types/is-ci@3.0.4: resolution: {integrity: sha512-AkCYCmwlXeuH89DagDCzvCAyltI2v9lh3U3DqSg/GrBYoReAaWwxfXCqMx9UV5MajLZ4ZFwZzV4cABGIxk2XRw==} dependencies: @@ -1780,6 +1790,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /diff@5.1.0: + resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + engines: {node: '>=0.3.1'} + dev: false + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} From 66bdde978c84f2da890845f04b6fc31c3c5b1e61 Mon Sep 17 00:00:00 2001 From: Vitalij Ryndin Date: Tue, 5 Dec 2023 17:18:21 +0800 Subject: [PATCH 2/5] fix: --help flag now it works --- packages/cli/src/bin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts index 4e59983..0f3ab13 100644 --- a/packages/cli/src/bin.ts +++ b/packages/cli/src/bin.ts @@ -9,4 +9,4 @@ yargs(hideBin(process.argv)) .usage('$0 [args]') // @ts-ignore .command(commands) - .help(); + .help().argv; From 734635f44592fec906e96807f68bd09a9d50c274 Mon Sep 17 00:00:00 2001 From: Vitalij Ryndin Date: Tue, 5 Dec 2023 17:18:37 +0800 Subject: [PATCH 3/5] fix: filtering undefined xml nodes --- packages/xml-locales/src/xml-locales.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/xml-locales/src/xml-locales.ts b/packages/xml-locales/src/xml-locales.ts index f70808d..aa98ac4 100644 --- a/packages/xml-locales/src/xml-locales.ts +++ b/packages/xml-locales/src/xml-locales.ts @@ -41,7 +41,13 @@ export class XmlLocales { if (xmlData) { const parsedXml = this.xmlParser.xmlToJson(xmlData); if (Array.isArray(parsedXml.resources.string)) { - this.xmlData = parsedXml; + const filteredNodes = parsedXml.resources.string.filter( + (element) => element !== undefined + ); + + this.xmlData = new XmlJsonData({ + resources: { string: filteredNodes } + }); } else { this.xmlData = new XmlJsonData({ resources: { string: [parsedXml.resources.string] } From 340af128da5f2f8ef7e861e3adfaf1f762c1356a Mon Sep 17 00:00:00 2001 From: Vitalij Ryndin Date: Tue, 5 Dec 2023 17:19:40 +0800 Subject: [PATCH 4/5] chore: remove unused prompts --- packages/cli/package.json | 1 - packages/cli/src/utils/prompts.ts | 49 -------- pnpm-lock.yaml | 189 ++---------------------------- 3 files changed, 13 insertions(+), 226 deletions(-) delete mode 100644 packages/cli/src/utils/prompts.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index a341041..d4d12ce 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -26,7 +26,6 @@ "test:watch": "vitest --ui --watch --coverage" }, "dependencies": { - "@inquirer/prompts": "3.3.0", "diff": "5.1.0", "xml-locales": "workspace:0.0.4", "yargs": "17.7.2" diff --git a/packages/cli/src/utils/prompts.ts b/packages/cli/src/utils/prompts.ts deleted file mode 100644 index 78bdd63..0000000 --- a/packages/cli/src/utils/prompts.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { expand } from '@inquirer/prompts'; - -export async function hasConflict(fileName: string) { - return await expand({ - message: `Conflict on ${fileName}`, - default: 'y', - choices: [ - { - key: 'y', - name: 'Overwrite', - value: 'yes' - }, - { - key: 'a', - name: 'Overwrite this one and all next', - value: 'all' - }, - { - key: 's', - name: 'Skip', - value: 'skip' - } - ] - }); -} - -export async function deleteAnswer(fileName: string) { - return await expand({ - message: `Delete on ${fileName}?`, - default: 'y', - choices: [ - { - key: 'y', - name: 'Delete', - value: 'yes' - }, - { - key: 'a', - name: 'Delete this one and all next', - value: 'all' - }, - { - key: 's', - name: 'Skip', - value: 'skip' - } - ] - }); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 819bc8f..80f6865 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,9 +44,6 @@ importers: packages/cli: dependencies: - '@inquirer/prompts': - specifier: 3.3.0 - version: 3.3.0 diff: specifier: 5.1.0 version: 5.1.0 @@ -898,125 +895,6 @@ packages: - supports-color dev: true - /@inquirer/checkbox@1.5.0: - resolution: {integrity: sha512-3cKJkW1vIZAs4NaS0reFsnpAjP0azffYII4I2R7PTI7ZTMg5Y1at4vzXccOH3762b2c2L4drBhpJpf9uiaGNxA==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - figures: 3.2.0 - dev: false - - /@inquirer/confirm@2.0.15: - resolution: {integrity: sha512-hj8Q/z7sQXsF0DSpLQZVDhWYGN6KLM/gNjjqGkpKwBzljbQofGjn0ueHADy4HUY+OqDHmXuwk/bY+tZyIuuB0w==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - chalk: 4.1.2 - dev: false - - /@inquirer/core@5.1.1: - resolution: {integrity: sha512-IuJyZQUg75+L5AmopgnzxYrgcU6PJKL0hoIs332G1Gv55CnmZrhG6BzNOeZ5sOsTi1YCGOopw4rYICv74ejMFg==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/type': 1.1.5 - '@types/mute-stream': 0.0.4 - '@types/node': 20.9.3 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - cli-spinners: 2.9.1 - cli-width: 4.1.0 - figures: 3.2.0 - mute-stream: 1.0.0 - run-async: 3.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - dev: false - - /@inquirer/editor@1.2.13: - resolution: {integrity: sha512-gBxjqt0B9GLN0j6M/tkEcmcIvB2fo9Cw0f5NRqDTkYyB9AaCzj7qvgG0onQ3GVPbMyMbbP4tWYxrBOaOdKpzNA==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - chalk: 4.1.2 - external-editor: 3.1.0 - dev: false - - /@inquirer/expand@1.1.14: - resolution: {integrity: sha512-yS6fJ8jZYAsxdxuw2c8XTFMTvMR1NxZAw3LxDaFnqh7BZ++wTQ6rSp/2gGJhMacdZ85osb+tHxjVgx7F+ilv5g==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - chalk: 4.1.2 - figures: 3.2.0 - dev: false - - /@inquirer/input@1.2.14: - resolution: {integrity: sha512-tISLGpUKXixIQue7jypNEShrdzJoLvEvZOJ4QRsw5XTfrIYfoWFqAjMQLerGs9CzR86yAI89JR6snHmKwnNddw==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - chalk: 4.1.2 - dev: false - - /@inquirer/password@1.1.14: - resolution: {integrity: sha512-vL2BFxfMo8EvuGuZYlryiyAB3XsgtbxOcFs4H9WI9szAS/VZCAwdVqs8rqEeaAf/GV/eZOghIOYxvD91IsRWSg==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/input': 1.2.14 - '@inquirer/type': 1.1.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - dev: false - - /@inquirer/prompts@3.3.0: - resolution: {integrity: sha512-BBCqdSnhNs+WziSIo4f/RNDu6HAj4R/Q5nMgJb5MNPFX8sJGCvj9BoALdmR0HTWXyDS7TO8euKj6W6vtqCQG7A==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/checkbox': 1.5.0 - '@inquirer/confirm': 2.0.15 - '@inquirer/core': 5.1.1 - '@inquirer/editor': 1.2.13 - '@inquirer/expand': 1.1.14 - '@inquirer/input': 1.2.14 - '@inquirer/password': 1.1.14 - '@inquirer/rawlist': 1.2.14 - '@inquirer/select': 1.3.1 - dev: false - - /@inquirer/rawlist@1.2.14: - resolution: {integrity: sha512-xIYmDpYgfz2XGCKubSDLKEvadkIZAKbehHdWF082AyC2I4eHK44RUfXaoOAqnbqItZq4KHXS6jDJ78F2BmQvxg==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - chalk: 4.1.2 - dev: false - - /@inquirer/select@1.3.1: - resolution: {integrity: sha512-EgOPHv7XOHEqiBwBJTyiMg9r57ySyW4oyYCumGp+pGyOaXQaLb2kTnccWI6NFd9HSi5kDJhF7YjA+3RfMQJ2JQ==} - engines: {node: '>=14.18.0'} - dependencies: - '@inquirer/core': 5.1.1 - '@inquirer/type': 1.1.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - figures: 3.2.0 - dev: false - - /@inquirer/type@1.1.5: - resolution: {integrity: sha512-wmwHvHozpPo4IZkkNtbYenem/0wnfI6hvOcGKmPEa0DwuaH5XUQzFqy6OpEpjEegZMhYIk8HDYITI16BPLtrRA==} - engines: {node: '>=14.18.0'} - dev: false - /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} @@ -1249,12 +1127,6 @@ packages: resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} dev: true - /@types/mute-stream@0.0.4: - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - dependencies: - '@types/node': 20.9.3 - dev: false - /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true @@ -1263,6 +1135,7 @@ packages: resolution: {integrity: sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==} dependencies: undici-types: 5.26.5 + dev: true /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1272,10 +1145,6 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true - /@types/wrap-ansi@3.0.0: - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - dev: false - /@types/yargs-parser@21.0.3: resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} dev: true @@ -1376,13 +1245,6 @@ packages: engines: {node: '>=6'} dev: true - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.21.3 - dev: false - /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1592,9 +1454,11 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + dev: true /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: true /check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} @@ -1622,16 +1486,6 @@ packages: engines: {node: '>=8'} dev: true - /cli-spinners@2.9.1: - resolution: {integrity: sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==} - engines: {node: '>=6'} - dev: false - - /cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - dev: false - /cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -1959,6 +1813,7 @@ packages: /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + dev: true /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -1992,6 +1847,7 @@ packages: chardet: 0.7.0 iconv-lite: 0.4.24 tmp: 0.0.33 + dev: true /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} @@ -2021,13 +1877,6 @@ packages: resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==} dev: true - /figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} - dependencies: - escape-string-regexp: 1.0.5 - dev: false - /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -2235,6 +2084,7 @@ packages: /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + dev: true /has-property-descriptors@1.0.1: resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} @@ -2288,6 +2138,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 + dev: true /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} @@ -2750,11 +2601,6 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: false - /mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} dependencies: @@ -2834,6 +2680,7 @@ packages: /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + dev: true /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} @@ -3165,11 +3012,6 @@ packages: fsevents: 2.3.3 dev: true - /run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - dev: false - /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -3196,6 +3038,7 @@ packages: /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} @@ -3278,11 +3121,6 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - dev: false - /sirv@2.0.3: resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} @@ -3466,6 +3304,7 @@ packages: engines: {node: '>=8'} dependencies: has-flag: 4.0.0 + dev: true /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -3518,6 +3357,7 @@ packages: engines: {node: '>=0.6.0'} dependencies: os-tmpdir: 1.0.2 + dev: true /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} @@ -3679,11 +3519,6 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - dev: false - /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -3763,6 +3598,7 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -4002,6 +3838,7 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} From 504a1337bab054d2db079b67f828894ba7c33cde Mon Sep 17 00:00:00 2001 From: Vitalij Ryndin Date: Tue, 5 Dec 2023 17:22:35 +0800 Subject: [PATCH 5/5] chore: changeset --- .changeset/fair-yaks-boil.md | 7 +++++++ .changeset/kind-birds-change.md | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/fair-yaks-boil.md create mode 100644 .changeset/kind-birds-change.md diff --git a/.changeset/fair-yaks-boil.md b/.changeset/fair-yaks-boil.md new file mode 100644 index 0000000..2beb886 --- /dev/null +++ b/.changeset/fair-yaks-boil.md @@ -0,0 +1,7 @@ +--- +'@xml-locales/cli': patch +--- + +feat: print diff +fix: --help flag now it works +chore: remove unused prompts diff --git a/.changeset/kind-birds-change.md b/.changeset/kind-birds-change.md new file mode 100644 index 0000000..f5471d5 --- /dev/null +++ b/.changeset/kind-birds-change.md @@ -0,0 +1,5 @@ +--- +'xml-locales': patch +--- + +fix: filtering undefined xml nodes