Skip to content

Commit

Permalink
Merge pull request #12101 from keymanapp/refactor/common/9665-move-xm…
Browse files Browse the repository at this point in the history
…l2js-and-related-deps-to-developer

refactor(common): move xml2js and related deps to @keymanapp/developer-utils 🐉
  • Loading branch information
mcdurdin authored Aug 7, 2024
2 parents 6428230 + edf47d7 commit d55558f
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion common/web/types/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function do_configure() {
function do_test() {
eslint .
tsc --build test
readonly C8_THRESHOLD=40
readonly C8_THRESHOLD=50
c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha "${builder_extra_params[@]}"
builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal."
builder_echo warning "Please increase threshold in build.sh as test coverage improves."
Expand Down
9 changes: 1 addition & 8 deletions common/web/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,17 @@
"dependencies": {
"@keymanapp/ldml-keyboard-constants": "*",
"@keymanapp/keyman-version": "*",
"restructure": "3.0.1",
"semver": "^7.5.2",
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
"restructure": "3.0.1"
},
"devDependencies": {
"@types/chai": "^4.1.7",
"@types/git-diff": "^2.0.3",
"@types/mocha": "^5.2.7",
"@types/node": "^20.4.1",
"@types/semver": "^7.3.12",
"@types/xml2js": "^0.4.5",
"ajv": "^8.12.0",
"ajv-cli": "^5.0.0",
"ajv-formats": "^2.1.1",
"c8": "^7.12.0",
"chalk": "^2.4.2",
"git-diff": "^2.0.6",
"hexy": "^0.3.4",
"mocha": "^8.4.0",
"typescript": "^5.4.5"
Expand Down
2 changes: 0 additions & 2 deletions common/web/types/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export * as KeymanFileTypes from './util/file-types.js';
export * as Schemas from './schemas.js';
export * as SchemaValidators from './schema-validators.js';

export * as xml2js from './deps/xml2js/xml2js.js';

export * as KMXPlus from './kmx/kmx-plus/kmx-plus.js';
// TODO: these exports are really not well named
export { UnicodeSetParser, UnicodeSet } from './ldml-keyboard/unicodeset-parser-api.js';
Expand Down
1 change: 0 additions & 1 deletion common/web/types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"preserveConstEnums": true,
},
"include": [
"src/deps/xml2js/*.js",
"src/**/*.ts",
"src/schemas/*.mjs", // Import the validators
],
Expand Down
2 changes: 1 addition & 1 deletion developer/src/common/web/utils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ builder_run_action build do_build
if builder_start_action test; then
eslint .
tsc --build test
readonly C8_THRESHOLD=45
readonly C8_THRESHOLD=40
c8 --reporter=lcov --reporter=text --exclude-after-remap --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha
builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal."
builder_echo warning "Please increase threshold in build.sh as test coverage improves."
Expand Down
9 changes: 8 additions & 1 deletion developer/src/common/web/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
],
"dependencies": {
"@sentry/node": "^7.57.0",
"restructure": "^3.0.1"
"restructure": "^3.0.1",
"semver": "^7.5.2",
"sax": ">=0.6.0",
"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",
"typescript": "^5.4.5"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions developer/src/common/web/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ export { defaultCompilerOptions, CompilerBaseOptions, CompilerCallbacks, Compile
} from './compiler-interfaces.js';

export { CommonTypesMessages } from './common-events.js';

export * as xml2js from './deps/xml2js/xml2js.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { xml2js } from '@keymanapp/common-types';
import { xml2js } from '../../index.js';
import { KPJFile, KPJFileProject } from './kpj-file.js';
import { util } from '@keymanapp/common-types';
import { KeymanDeveloperProject, KeymanDeveloperProjectFile10, KeymanDeveloperProjectType } from './keyman-developer-project.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SchemaValidators as SV, KvkFile, xml2js, util, Constants } from '@keymanapp/common-types';
import { SchemaValidators as SV, KvkFile, util, Constants } from '@keymanapp/common-types';
import { xml2js } from '../../index.js'
import KVKSourceFile from './kvks-file.js';
const SchemaValidators = SV.default;
import boxXmlArray = util.boxXmlArray;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { VisualKeyboard as VK, Constants, xml2js } from '@keymanapp/common-types';
import { VisualKeyboard as VK, Constants } from '@keymanapp/common-types';
import KVKSourceFile, { KVKSEncoding, KVKSFlags, KVKSKey, KVKSLayer } from './kvks-file.js';
import { xml2js } from '../../index.js';

import USVirtualKeyCodes = Constants.USVirtualKeyCodes;
import VisualKeyboard = VK.VisualKeyboard;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SchemaValidators, util, xml2js } from '@keymanapp/common-types';
import { SchemaValidators, util } from '@keymanapp/common-types';
import { xml2js } from '../../index.js';
import { CommonTypesMessages } from '../../common-events.js';
import { CompilerCallbacks } from '../../compiler-interfaces.js';
import { LDMLKeyboardXMLSourceFile, LKImport, ImportStatus } from './ldml-keyboard-xml.js';
Expand Down
1 change: 1 addition & 0 deletions developer/src/common/web/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
},
"include": [
"src/**/*.ts",
"src/deps/xml2js/*.js",
],
}
2 changes: 1 addition & 1 deletion developer/src/kmc-package/src/compiler/kmp-compiler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { xml2js } from '@keymanapp/common-types';
import { xml2js } from '@keymanapp/developer-utils';
import JSZip from 'jszip';
import KEYMAN_VERSION from "@keymanapp/keyman-version";

Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d55558f

Please sign in to comment.