From 33b377c897a4b4cbb46d03f19bad10be524b75f0 Mon Sep 17 00:00:00 2001 From: Vitaly Zakutny Date: Thu, 23 Nov 2023 22:17:26 +0300 Subject: [PATCH 1/2] chore: changed default options for xml parser and builder. Do not trimming values, and don't convert chars to HTML Entities --- packages/xml-locales/src/utils/xml.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/xml-locales/src/utils/xml.ts b/packages/xml-locales/src/utils/xml.ts index 0f33c7a..3a68d3d 100644 --- a/packages/xml-locales/src/utils/xml.ts +++ b/packages/xml-locales/src/utils/xml.ts @@ -15,7 +15,7 @@ export interface XmlConstructor { } const defaultParserOptions: X2jOptionsOptional = { - trimValues: true, + trimValues: false, ignoreDeclaration: true, attributeNamePrefix: 'key_', alwaysCreateTextNode: true, @@ -24,7 +24,8 @@ const defaultParserOptions: X2jOptionsOptional = { const defaultBuilderOptions: XmlBuilderOptionsOptional = { ignoreAttributes: false, - attributeNamePrefix: 'key_' + attributeNamePrefix: 'key_', + processEntities: false }; const defaultFormatterOptions: XMLFormatterOptions = { From 157eeddcb4b443532fdba7c0bb46e79c845afc01 Mon Sep 17 00:00:00 2001 From: Vitaly Zakutny Date: Thu, 23 Nov 2023 22:36:59 +0300 Subject: [PATCH 2/2] feat: bump versions --- packages/cli/CHANGELOG.md | 7 +++++++ packages/cli/package.json | 4 ++-- packages/xml-locales/CHANGELOG.md | 6 ++++++ packages/xml-locales/package.json | 2 +- pnpm-lock.yaml | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index fc772a1..9456ec2 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,12 @@ # @xml-locales/cli +## 0.0.6 + +### Patch Changes + +- Updated dependencies + - xml-locales@0.0.4 + ## 0.0.5 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 7e6cd39..03f3754 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@xml-locales/cli", - "version": "0.0.5", + "version": "0.0.6", "type": "module", "bin": { "xml-locales": "./dist/bin.js" @@ -28,7 +28,7 @@ "dependencies": { "@inquirer/prompts": "3.3.0", "@types/yargs": "17.0.32", - "xml-locales": "workspace:0.0.3", + "xml-locales": "workspace:0.0.4", "yargs": "17.7.2" } } diff --git a/packages/xml-locales/CHANGELOG.md b/packages/xml-locales/CHANGELOG.md index 18fd83b..6f7bf05 100644 --- a/packages/xml-locales/CHANGELOG.md +++ b/packages/xml-locales/CHANGELOG.md @@ -1,5 +1,11 @@ # xml-locales +## 0.0.4 + +### Patch Changes + +- fix default options for xml parser and builder + ## 0.0.3 ### Patch Changes diff --git a/packages/xml-locales/package.json b/packages/xml-locales/package.json index f23e4c3..c656b92 100644 --- a/packages/xml-locales/package.json +++ b/packages/xml-locales/package.json @@ -1,7 +1,7 @@ { "name": "xml-locales", "description": "Tool for locales in xml files", - "version": "0.0.3", + "version": "0.0.4", "type": "module", "keywords": [ "xml-locales", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c3cd6ce..c56f1ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,7 +51,7 @@ importers: specifier: 17.0.32 version: 17.0.32 xml-locales: - specifier: workspace:0.0.3 + specifier: workspace:0.0.4 version: link:../xml-locales yargs: specifier: 17.7.2