Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(common): xml2js -> fast-xml-parser #12331

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ca848cb
chore(common): xml2js -> fast-xml-parser
srl295 Aug 29, 2024
3bf7ff2
chore(common): xml2js -> fast-xml-parser first pass at implementation
srl295 Aug 29, 2024
7bc8747
chore(common): fast-xml-parser: kbd and test data loads
srl295 Aug 29, 2024
1086b3f
chore(common): fast-xml-parser: delving into kpj and kvks
srl295 Aug 29, 2024
b044396
chore(common): fast-xml-parser: fix test inconsistencies with number/…
srl295 Aug 30, 2024
419a752
chore(common): fast-xml-parser: kvks reader
srl295 Aug 30, 2024
06672d5
chore(common): kvks: updated schema
srl295 Aug 30, 2024
067ad73
chore(developer): improve test messages messages
srl295 Aug 30, 2024
030e1b6
chore(developer): improve kpj schema
srl295 Aug 30, 2024
8779ca9
chore(developer): Drop stray package-lock.json
srl295 Aug 31, 2024
a1f1bf7
chore(developer): update kps/kmp parsing
srl295 Aug 31, 2024
877522c
chore(developer): kmc-package working
srl295 Sep 1, 2024
1cb33da
chore(developer): add invalid XML error
srl295 Sep 6, 2024
06a5683
chore(developer): unboxing fix for displays
srl295 Sep 6, 2024
171e37c
chore(developer): fix for overly-trimmed attributes
srl295 Sep 9, 2024
c24ba0f
chore(common): handle an empty <transformGroup/> properly
srl295 Sep 10, 2024
f11e77a
Merge remote-tracking branch 'upstream/master' into chore/common/1220…
srl295 Sep 12, 2024
02330e1
chore(developer): fix for kvks writing
srl295 Sep 12, 2024
6f7f268
chore(developer): fix for NCR parsing
srl295 Sep 12, 2024
d4a3407
Merge remote-tracking branch 'origin/master' into chore/common/12208/…
srl295 Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 17 additions & 44 deletions common/schemas/kvks/kvks.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,18 @@
"$ref": "#/definitions/kvk-layer"
}
},
"$": {
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/kvk-encoding-name"
},
"fontname": {
"type": "string"
},
"fontsize": {
"type": "string"
}
},
"required": [
"name"
],
"additionalProperties": false
"name": {
"$ref": "#/definitions/kvk-encoding-name"
},
"fontname": {
"type": "string"
},
"fontsize": {
"type": "string"
}
},
"required": [
"$"
"name"
],
"additionalProperties": false
},
Expand All @@ -108,21 +99,12 @@
"$ref": "#/definitions/kvk-key"
}
},
"$": {
"type": "object",
"properties": {
"shift": {
"$ref": "#/definitions/kvk-layer-shift"
}
},
"required": [
"shift"
],
"additionalProperties": false
"shift": {
"$ref": "#/definitions/kvk-layer-shift"
}
},
"required": [
"$"
"shift"
],
"additionalProperties": false
},
Expand All @@ -132,24 +114,15 @@
"bitmap": {
"type": "string"
},
"$": {
"type": "object",
"properties": {
"vkey": {
"type": "string"
}
},
"required": [
"vkey"
],
"additionalProperties": false
"vkey": {
"type": "string"
},
"_": {
"#text": {
"type": "string"
}
},
"required": [
"$"
"vkey"
],
"additionalProperties": false
},
Expand Down Expand Up @@ -179,4 +152,4 @@
"pattern": "(\\d+\\.)+(\\d+)"
}
}
}
}
4 changes: 3 additions & 1 deletion common/web/types/src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { MATCH_HEX_ESCAPE, CONTAINS_QUAD_ESCAPE, MATCH_QUAD_ESCAPE } from './con
export { MATCH_HEX_ESCAPE, CONTAINS_QUAD_ESCAPE, MATCH_QUAD_ESCAPE };

/**
* xml2js will not place single-entry objects into arrays. Easiest way to fix
* fast-xml-parser will not place single-entry objects into arrays.
* We could set a list of items expected to be arrays,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this declarative approach viable? It seems like it would be cleaner

* but the easiest way to fix
* this is to box them ourselves as needed. Ensures that o.x is an array.
*
* @param o Object with property to box
Expand Down
5 changes: 2 additions & 3 deletions developer/src/common/web/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
"/build/"
],
"dependencies": {
"@sentry/node": "^7.57.0",
"@keymanapp/common-types": "*",
"@sentry/node": "^7.57.0",
"eventemitter3": "^5.0.0",
"restructure": "^3.0.1",
"semver": "^7.5.4",
"sax": ">=0.6.0",
"semver": "^7.5.4",
"xmlbuilder": "~11.0.0"
},
"devDependencies": {
"@types/git-diff": "^2.0.3",
"@types/node": "^20.4.1",
"@types/semver": "^7.3.12",
"@types/xml2js": "^0.4.5",
"c8": "^7.12.0",
"git-diff": "^2.0.6",
"mocha": "^8.4.0",
Expand Down
19 changes: 0 additions & 19 deletions developer/src/common/web/utils/src/deps/xml2js/LICENSE

This file was deleted.

Loading
Loading